Comment

Comment by satiated_grue

I'm surprised by the existence of \n\r line terminations!

\r\n was how lines were terminated on the wire for many early devices (for example, the Teletype ASR-33 seen in the famous photograph of Thompson and Ritchie at Bell Labs).

If the carriage is very far to the right, and an LF is sent followed by the CR, then the carriage will still be returning when the next character arrives, which will print at some random location along the return path.

CR followed by the mechanically much faster LF operation gives enough time for the carriage to be fully homed and in proper position for the printable character to be struck.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton