The “index.php” in the URL is redundant.
Frankly, the way the functionality needed to implement LF-to-CRLF conversion on output/CR-to-LF conversion on input/line editing/session and process management is split between the terminal itself, the kernel, and the application code is quite awkward.
And of course, the concerns of the serial line driver are thrown into the mix too, for the added entertainment.
The low level details of the Linux TTY driver is a surprisingly deep subject. This very old page taught me a lot about it and a recent HN discussion reminded me to dig up the old link. Hopefully others find it as enlightening as I have.