Comment by somat
1 year ago
> "like literally every other OS did (and continued to do)."
If I remember correctly macs used a bare carrage return as the line delimiter.
So the trick when you got a text document was to figure out where it came from.
windows = crlf mac = cr unix = lf
I suspect nowadays(don't have a mac so this is a guess) because macs are more or less a unix system they default to linefeeds.
Yeah, Macs IIRC just stored the keyboard input instead (the Enter key generates CR, which is also an old and venerable tradition, that's why there is ICRNL flag for the terminal input).
Obviously, in a perfect world we would have a single NL character for storing in text files in memory/on disk/in transit, and terminals would use entirely different CR and IND control codes, and internally translate NL to CR+IND combination when printing text, and send NL to the host as the keycode of the Enter key when it's pressed. Alas, that train has sailed long ago (and let's not even start on choosing BS versus DEL).
Apple switched to LF line breaks in 2001 with the release of Mac OS X. Nothing uses bare CR anymore.