136 private links
*0:00* - Introduction to Terminals, PTY, and TTY
*0:08* - Running Commands and the Role of the Shell (e.g., Zsh, Bash)
*1:50* - What is TTY (Teletypewriter)?
*2:09* - Virtual Consoles and Terminal Emulators
*2:41* - Pseudo-Terminals (PTY) and Terminal Simulation
*2:50* - ANSI Escape Codes for Formatting (Color, Underline, Bold)
*3:57* - Interpretation of ANSI Codes by Terminal Emulators
*4:46* - Parsing ANSI Codes (Example with `pyte` and HTML)
*6:29* - Processes, Controlling Terminals, and Signals (Ctrl+C, SIGHUP)
*7:47* - How PTY Works and Why it's Needed
*8:32* - Line Discipline: Cooked Mode (Canonical) vs. Raw Mode
*9:40* - Line Discipline: Echoing
*9:53* - Changing Terminal Options with `stty` (Disabling Canonical Mode and Echoing)
*10:41* - Signal Management and Flow Control (Ctrl+S, Ctrl+Q)
*11:49* - Window Size and Resizing Events (SIGWINCH)
*13:47* - PTY and Remote Connections (SSH and PTY)
*14:58* - Summary
The TTY subsystem is central to the design of Linux, and UNIX in general. Unfortunately, its importance is often overlooked, and it is difficult to find good introductory articles about it. I believe that a basic understanding of TTYs in Linux is essential for the developer and the advanced user.
Beware, though: What you are about to see is not particularly elegant. In fact, the TTY subsystem — while quite functional from a user's point of view — is a twisty little mess of special cases. To understand how this came to be, we have to go back in time.
Right now, I want to talk about the heritage of these input/output mechanisms. Why is it that punched paper tape and the teleprinter were the most obvious way to interact with the first electronic computers? As you might suspect, the arrangement was one of convenience. Paper tape punches and readers were already being manufactured, as were teleprinters. They were both used for communications.
It is time for me to re-do my old thread about the origins of "80 columns" and how it can very well be related to pretty ancient stuff, not dissimilar to "space shuttle and horse's rear end".
As you know, the default mode on IBM PCs is text 80x25. The limitation of 80 columns per line, also known as "80 column rule" is still widespread; for example, that's the rule for Linux kernel. But why 80? Why not 70 or 90?
The answer to that is usually "IBM punch cards are 80 characters wide", but things are more interesting than that!
First, the commonly accepted column width was supposed to be 72. American typewriters used to have just 72 columns, earlier DEC terminals supported only 72 columns, and even IBM punch cards had only 72 columns for text.
Second, yes, IBM punch cards were 80 characters wide, but why?