Skip to content
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

Text editor writes LF vs CRLF line endings on Windows? #3901

Closed
quant9 opened this issue Feb 20, 2018 · 5 comments
Closed

Text editor writes LF vs CRLF line endings on Windows? #3901

quant9 opened this issue Feb 20, 2018 · 5 comments

Comments

@quant9
Copy link

@quant9 quant9 commented Feb 20, 2018

I'm using Windows 7 Professional and observe the following:

  • if I open a .py file in Jupyterlab (say constants.py) it immediately opens with "unsaved changes" without any edits.

constants

  • if I then save the file, git status will note that the file was modified. git diff will give this
    warning:

warning: LF will be replaced by CRLF in constants.py

Could it be that Jupyterlab text editor is writing the wrong line endings for Windows?

More context on LF vs CRLF:
https://stackoverflow.com/questions/5834014/lf-will-be-replaced-by-crlf-in-git-what-is-that-and-is-it-important

@blink1073
Copy link
Member

@blink1073 blink1073 commented Feb 20, 2018

Hi @wkzhu, we are using LF for all line endings, so what you are seeing is expected. We could guess the line endings of the file and set it accordingly.

@quant9
Copy link
Author

@quant9 quant9 commented Feb 20, 2018

That functionality would be welcomed! Thank you...

@sccolbert
Copy link
Contributor

@sccolbert sccolbert commented Feb 20, 2018

I'm not sure how I feel about trying to guess line endings automatically, particularly in a browser environment. I'd prefer to just make it a user setting.

@vidartf
Copy link
Member

@vidartf vidartf commented Feb 21, 2018

I'd prefer to just make it a user setting.

+1, but with one option being "automatically detect" :)

@jasongrout jasongrout removed this from the 1.0 milestone Sep 5, 2018
@blink1073 blink1073 added this to the Future milestone Sep 11, 2018
@jasongrout jasongrout removed this from the Future milestone Sep 12, 2018
@jasongrout jasongrout added this to the 1.0 milestone Sep 12, 2018
@t-makaro
Copy link

@t-makaro t-makaro commented Oct 17, 2018

I'd just like to point out vscode's solution is to have an option on the status bar.
image

Makes it very transparent.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

7 participants