How Terminals Work
33 points by mgm
33 points by mgm
Sections 5 & 6 are not quite right, FWIW. Input processing and signal generation does not occur in the terminal, but in the line discipline within a UNIX operating system. A terminal could be attached to, say, a serial line of a random piece of equipment or a TCP socket of some user process, and none of what we perceive as classical input processing and signal sending would occur -- but everything else described in the document about modes and escape sequences and so on still would.
I have a question. If the things I type aren't sent to my shell until I hit "enter", then how do zsh plugins like https://github.com/zsh-users/zsh-autosuggestions and https://github.com/zsh-users/zsh-syntax-highlighting work? These all do things before I hit enter and as far as I know are completely implemented through the shell.
From what I can gather, its just wrong. Bash, ZSH, etc are in raw mode
Yeah, that'll do it. I already had my doubts because the text gave an ai smell(the "not just x, it's Y" and the em-dashes) but the demonstrations were so well-made i was willing to give benefit of the doubt. A shame, really.
As a strong confirmation,
I asked Claude to make an explainer with interactive examples.
That is disappointing and scary at the same time. I was hoping that this was ai but with some human effort put in, as I couldn't believe the demonstrations were all ai-made.
Maybe this is a good overview if you know nothing of terminals or squint your eyes, but the details are misleading.