-
Notifications
You must be signed in to change notification settings - Fork 1.3k
End of line / EOL #1447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
End of line / EOL #1447
Comments
Hi @vivek-verma202, are you copying text from a Theia editor and pasting them in an Ubuntu Terminal, or the other way around? (Or what are copying from where to where?) Maybe it could be helpful if you provide a screenshot or screencast demonstrating the problem. |
kreyren is infuriated by the bash used and can't resist not commenting on it fwiw double-quote the variables to avoid word-splitting, don't use echo since it's non-standard on XNU, useless use of cat and surrounding variables in curly brackets is bloat, use shellcheck https://github.com/koalaman/shellcheck so the correct version would look like: for int in {1..22}; do
<<-EOF > "test_$int"
#!/usr/bin/env bash
printf '%s\n' "$int"
EOF
done kreyren runs away, because it's off-topic |
Is this gitpod on windows parsing the content to WSL ubuntu terminal? (Windows is placing garbage on new-line that usually cause this behaviour) Relevant: https://github.com/koalaman/shellcheck/wiki/SC1017 |
I am using Google chrome on Ubuntu machine. Copying lines from Gitpod -> text editor (Gedit) -> Ubuntu 20 / CentOS 7 terminal: again, no anomalous line line breaks. I have asked Gitpod explicitly to use \n as EOL. But I do notice a small "!" on my settings.json file. Is something wrong with it? |
Afaik gedit won't show these since it's formatting the text, can you copy paste these in http://dpaste.com/ ? (or any other way to get raw to us like github's gists https://gist.github.com/)
recommends removing double-quotes
Note that gitpod is linting
|
FWIW I also cannot reproduce this on my mac using chrome. I tried with auto and \n settings for files.eol. |
Thank-you so much guys! I was able to fix silly issues in my settings.json and get rid of the annoying "!". Copy paste from Gitpod to http://dpaste.com/ did not show extra line breaks. My "version"of Gitpod / Theia is doing something non-fatal but non-trivial with eols. This is not a generic Gitpod / Theia issue as I was not able to reproduce it when I copy-pasted from: https://ec77d690-8322-4dd1-8052-e70cfe28fd72.ws-us02.gitpod.io/#/workspace/spring-petclinic Hence, there seems to be something specific with the docker image that I am using. How can I fix it? I need no special functionality (just vanilla sh). Thanks again. |
If it's in the raw it won't show up on browser's view of dpaste (browsers do not render these by default) where i was expecting the dpaste link alike http://dpaste.com/0QGE4X4 which looks like this on dpaste: So that i could pipe it in or in editor capable of rendering invisibles like gitpod (see https://stackoverflow.com/a/61355603 if you want to know how):
kreyren still suspect this being relevant to cascadian return on Windows/DOS Can you share your:
|
The dpaste link: http://dpaste.com/3V6Z4SBGitpod is not allowing me to use:
I have made the following workspaces public:
I am using Google chrome, Version 81.0.4044.129 (Official Build) (64-bit).User agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36 Linux Kernel:tried it on two (same problem):
|
Attempts-to-resolve: gitpod-io/gitpod#1447 Signed-off-by: Jacob Hrbek < kreyren@member.fsf.org>
Interesting! i see what i assume is unexpected But this is usually specific to Windows/DOS (never seen this on linux in 14 years) so i find it unexpected that this behavior has been observed on linux which is using ‘\n’ == ASCII 10 == 0x0A == line feed ‘\r’ == ASCII 13 == 0x0D == carriage return Based on available informations my best guess would be that this is caused by some extension that is not optimized for usage on Linux. If this solves the issue i recommend filing a new issue to extension developer (that is likely the responsible for this behavior assuming that we can't reproduce it and available info above) informing them about this behavior. Looking at the provided repository (https://github.com/vivek-verma202/GWAS_FM):
|
Also as referenced on https://stackoverflow.com/a/61355603 you need this extension https://marketplace.visualstudio.com/items?itemName=medo64.render-crlf for gitpod to recognize these properties |
Also note https://www.gitpod.io/docs/languages/bash/ for shell-relevant development on gitpod |
kreyren forgot that option is there x.x @vivek-verma202 also a solution! :p but you should consider using shellcheck anyway it prevents lots of problems ^-^ |
The bug
I am not sure if this issue traces back to Theia. The IDE adds extra line breaks.
The behavior
when I copy (cntrl + c) and paste in my Ubuntu terminal, the output looks:
Expected behavior
Additional information
tried fixing it manually (with no luck):
"files.eol": "\n"
The text was updated successfully, but these errors were encountered: