3 ms·
This is also where Windows CRLF for a new line comes from. CR is Carriage Return, which on a typewriter you could do by moving the carriage back to the start o
by SAI_Peregrinus 5y ago
This is also where Windows CRLF for a new line comes from.
CR is Carriage Return, which on a typewriter you could do by moving the carriage back to the start of the line. Often there was a lever for this.
LF is Line Feed, accomplished by turning the platen. The horizontal position on the page stayed the same, just one line down vertically.
Having these separate made it possible to easily fill in tabular data and printed forms of various sorts. It also made it possible to type some (rather messy) accented characters by using CR and hitting space until you reached the character to accent, then typing an appropriate punctuation mark. A number of modern Compose Key sequences follow the same patterns, eg o" for ö.
Later typewriters added ways to do this automatically; eg the IBM Selectric had a "RETURN" key. This both returned the carriage to the start of the line and fed down one line. It was still possible to perform either action separately to fill in tables and other forms.
- gumby 5y agoWindows did it because DOS did it, and DOS did it because almost everybody else did. IIRC Multics was the first to have just a newline character (^j) and Unix adopted it, along with case sensitivity etc etc. The Mac was the only system I ever saw to use ^M as newline. Multics is also why @ is erase line and # erase character in the Unix tty driver. Oho, you’ve never seen that? It’s because disabling that became the default in the early 90s or perhaps even late 80s, but I’m pretty sure it’s still there. Probably made it into POSIX for back compatibility with some gereatric system.
- dhosek 5y ago^M for new line on the Mac was a holdover from the Apple ][, so you can blame Woz for that one. I don’t know about other contemporaneous 8-bit systems like Commodore or Tandy
- mike_hock 5y agoI hate to say it, but Windows has the line breaks right. Why did Unix see fit to just type further and further to the right on a never ending paper?
- ByteJockey 5y agoIf you want to get a newline without moving all the way to the left, you can use the vertical tab character. No reason to complicate line endings for a rare circumstance like this.
- moron4hire 5y agoThat's not the Unix way. The Unix way is to compose crappy, half-assed solutions like CRLF from parts, rather than create dedicated solutions like VT.
- mike_hock 5y agoDo one thing and do it well! There's no reason a line feed should also need to return the carriage. What is this, systemd-lf? What if I want to swap the carriage return implementation for the BSD one?
- zabzonk 5y ago> Later typewriters added ways to do this automatically All in at least the last 70 years did (I had a Remington that would be at least 70 years old now). There is a lever on manual typewriters on the right-hand side that you yank leftwards that does a CR and then a LF (or vice-versa, can't remember).
- zabzonk 5y agoEdit: Thinking about it, the Remington would be about 90 years old now - it was ancient when I got it, and I'm quite ancient now. And mechanically, it must have been LF first.
- SAI_Peregrinus 5y agoYep, and often that lever had two positions, so you yank it partway for a LF, and the rest of the way for a CR. But the really early manual typewriters didn't have this. Typewriters are old, the first commercial one was invented in 1865 and manufactured in 1870, and the first commercially successful typewriter was manufactured in 1874. Neither had such a lever.