Terminal Internals — Trivia & Interesting Facts¶
Surprising, historical, and little-known facts about terminal emulators and the terminal subsystem.
The "terminal" is named after physical hardware endpoints from the 1960s-70s¶
The word "terminal" originally referred to physical devices — the DEC VT100 (1978), IBM 3270, Wyse 50 — that sat at the "terminus" (end point) of a serial cable connected to a mainframe or minicomputer. When we open "Terminal.app" or "xterm," we're running software that emulates the behavior of hardware that hasn't been manufactured in decades. The ghost of the VT100 haunts every terminal emulator alive today.
ANSI escape codes were standardized in 1979 and are still how your terminal renders color¶
ANSI X3.64 (1979), later adopted as ECMA-48 and ISO 6429, defined the escape sequences that control cursor position, text color, and screen clearing. The sequence \e[31m (red text) has been unchanged for over 45 years. Every modern terminal emulator — iTerm2, Windows Terminal, Alacritty, kitty — still interprets these same escape codes. The 16-color palette (8 colors + 8 bright variants) from the original specification persists as the default.
The Ctrl+C key combination sends SIGINT because of how terminals encode characters¶
Ctrl+key combinations work by masking bits 6 and 7 of the ASCII character code. Ctrl+C sends ASCII 3 (ETX, End of Text), which the terminal driver interprets as "send SIGINT." Ctrl+Z sends ASCII 26 (SUB), mapped to SIGTSTP. Ctrl+D sends ASCII 4 (EOT), which signals end-of-file. This bit-masking trick is why Ctrl can only modify letters and a few symbols — it's an artifact of 7-bit ASCII encoding from 1963.
The TTY subsystem in the Linux kernel is one of the most complex and least understood components¶
The Linux TTY (teletypewriter) subsystem handles terminal I/O, serial ports, pseudoterminals, and console devices. It includes line discipline processing, job control, signal delivery, and session management. The code has layers dating back to Unix V6 (1975) and is notorious for its complexity. Even experienced kernel developers approach the TTY layer with caution — it's one of the few areas where Linus Torvalds has said "I still don't understand all of it."
Pseudoterminals (PTYs) are the mechanism behind SSH, screen, tmux, and every terminal emulator¶
A pseudoterminal is a pair of virtual devices: a master (held by the terminal emulator) and a slave (seen by the shell as a real terminal). When you type in xterm, keystrokes go to the PTY master; the PTY slave delivers them to the shell. SSH uses PTYs to make remote sessions behave like local terminals. This master/slave architecture, designed in the 1980s, is what makes it possible to run terminal programs inside other programs.
The 80-column line width comes from IBM punched cards, which came from dollar bills¶
IBM's standard punched card was 80 columns wide — a size chosen by Herman Hollerith in the 1890s to match the US dollar bill's dimensions (the cards were stored in currency-handling equipment). The DEC VT100 defaulted to 80 columns because that's what punched card programs expected. Today, coding style guides recommending 80-character line limits are enforcing a constraint that traces back to 1890s currency dimensions.
Terminal emulators can render faster than most people realize¶
Modern GPU-accelerated terminal emulators like Alacritty (Rust, OpenGL), kitty (C, OpenGL), and WezTerm (Rust, OpenGL) can render text at thousands of frames per second. The perceived slowness of terminals is almost always caused by the shell, the program producing output, or the PTY buffer — not the renderer. Alacritty, released in 2017, proved this by being noticeably faster at scrolling through large outputs than traditional emulators.
The TERM environment variable and terminfo database exist because terminals were wildly incompatible¶
Different physical terminals used different escape codes for the same operations. The VT100 used \e[H for home cursor; the Wyse 50 used \e^^. The terminfo database (and its predecessor termcap) maps abstract capabilities ("move cursor home") to terminal-specific escape sequences. When you set TERM=xterm-256color, you're telling programs which terminfo entry to use. This indirection layer, designed in the 1970s, is still consulted by every curses-based program.
tmux was created because GNU Screen's codebase was considered unmaintainable¶
Nicholas Marriott created tmux in 2007 as a BSD-licensed replacement for GNU Screen (1987). Screen's codebase had accumulated 20 years of patches with minimal refactoring, making it difficult to add features or fix bugs. tmux was designed with a client-server architecture from the start and a cleaner codebase. By 2015, tmux had surpassed Screen in adoption for most users, though Screen remains in use at organizations that haven't updated their dotfiles.
Unicode support in terminals is still surprisingly broken in edge cases¶
While modern terminals support Unicode, complex scripts (Arabic, Thai, CJK), emoji (varying widths), combining characters (accents), and bidirectional text still cause rendering issues. The fundamental problem is that terminals operate on a fixed-width character grid, but Unicode characters can be zero-width (combining marks), single-width, or double-width (CJK). The wcwidth() function attempts to report character widths, but implementations disagree on thousands of codepoints.
The bell character (ASCII 7, BEL) originally rang a physical bell on teletypewriters¶
The \a escape (ASCII 7, BEL) was designed to ring a physical bell on teletypewriter hardware to alert the operator. Terminal emulators replaced the bell with a system beep, then a visual flash ("visual bell"), and now many terminals play a sound, flash the taskbar icon, or do nothing. The progression from mechanical bell to taskbar notification spans 60+ years of terminal evolution, but the same ASCII code triggers all of them.
xterm has been in continuous development since 1984 and supports features most people never discover¶
xterm, written by Mark Vandevoorde and later maintained by Thomas Dickey, has been continuously developed for over 40 years. It supports features most users never discover: Tektronix 4014 graphics emulation, ReGIS graphics, sixel graphics, mouse tracking, alternate screen buffers, and dozens of escape sequence extensions. Thomas Dickey has maintained xterm essentially single-handedly since 1996, making it one of the longest-tenured maintainerships in open source.