Problem with CR-only line breaks

Hi! I have problem to view some .txt files with Atom. Seems that it can’t recognize right line ending.

So, I have regular plain text file (originally created by program for preferences) and when I open it in Atom, it shows up just one long line. If I open it to any other text editor like mac os TextEdit, it will show up like it should.

I tried following and got this in Terminal. So it has CR line terminators, but seems that Atom can’t view those.

file Preferences_test.txt 
Preferences_test.txt: ASCII text, with CR line terminators

Tried already to change that LF to CRLF setting in Atom, but that didin’t work and as I understood that CRLF is different than CR. I can’t even see those linebreaks as a hidden character. :man_shrugging:

So, is there any way to view that txt file correctly in Atom?

There are two common text file line-ending formats in use today:

  • LF (ASCII 0x0A) – Unix including macOS (starting with Mac OS X)
  • CRLF (ASCII 0x0D 0x0A) – Windows

Historically, there is also a third:

  • CR (ASCII 0x0D) – Mac OS prior to Mac OS X

Mac OS was the only operating system to use this line ending format and it was replaced by Mac OS X nearly 19 years ago.

With the history out of the way, this issue discusses why Atom doesn’t support this line ending format.