The Terminal Ecosystem
What every real terminal emulator, multiplexer, and terminal library is — architecturally — and what to steal from each.
Warning: Version numbers, feature sets, and architectures move. This page describes the shape of each project and the design idea it demonstrates, not a current feature matrix. Where a capability matters to you, check the project — and better, run the probe from the differential-testing chapter.
Terminal Emulators
| Project | Language | Rendering | The design idea |
|---|---|---|---|
| xterm | C | X11 | The reference implementation. Thirty years of accretion, and the compatibility target everything claims. |
| st (suckless) | C | X11 | A whole terminal in ~2,500 lines. The best codebase to read end to end. |
| urxvt | C++ | X11 | Daemon mode: one process, many windows — a precursor to the mux idea. |
| Alacritty | Rust | GPU (OpenGL) | Proved GPU rendering; split its parser (vte) and core (alacritty_terminal) into reusable crates. |
| kitty | C + Python | GPU (OpenGL) | The protocol innovator: graphics, keyboard, and several other extensions started here. |
| WezTerm | Rust | GPU (wgpu) | Batteries included: multiplexing, ssh, and termwiz/portable-pty as reusable libraries. |
| foot | C | Wayland (CPU + damage) | Small, fast, Wayland-native. Proof that CPU rendering is fine when damage tracking is right. |
| Ghostty | Zig | GPU (Metal/OpenGL) | libghostty: a reusable core behind a C ABI, with native Swift and GTK apps on top. |
| contour | C++ | GPU | Protocol research — synchronized output and grapheme clustering were proposed here. |
| iTerm2 | Objective-C | macOS native | Feature maximalism; the origin of several OSC extensions. |
| Windows Terminal | C++ | DirectWrite | The ConPTY consumer; forced Windows to grow a real pseudoconsole. |
| rio | Rust | GPU (wgpu) | A modern Rust terminal with multiplexing built in. |
| Terminal.app | Objective-C | macOS native | Deliberately conservative. A useful "minimum baseline" to test against. |
What to steal from each
| Read | For |
|---|---|
| st | The whole shape of a terminal, in one sitting. Start here. |
vte | The parser. The cleanest implementation of the Williams state machine anywhere. |
alacritty_terminal | The screen model, and the grid-as-ring-of-lines optimization. |
| foot | Damage tracking and CPU rendering done properly. |
| kitty | Protocol extensions and their rationale documents. |
| Ghostty | The core/platform split — the subject of Section 5. |
| xterm | Authoritative behavior when sources disagree. Reference, not a style model. |
Multiplexers
| Project | Language | The design idea |
|---|---|---|
| GNU screen (1987) | C | Invented detach/attach. Still everywhere; showing its age. |
| tmux (2007) | C | The modern standard. Server + clients, a scripting API, and control mode (-CC) for embedding. |
| zellij | Rust | Multiplexing with a WASM plugin system and discoverable keybindings. |
| dvtm | C | A tiny tiling multiplexer; readable in an afternoon. |
| abduco | C | Detach/attach only — no panes. The clearest possible demonstration of the core idea. |
| WezTerm mux | Rust | Multiplexing inside the terminal, including over SSH. |
| Zed / VS Code terminals | Rust / TS | Terminals as an embedded panel — the IDE scenario from Section 5. |
Tip: Read abduco before tmux. It is detach/attach with nothing else attached to it — a few hundred lines that make the "why a server" argument concrete without the distraction of panes, layouts, and a scripting language.
tmux vs. your implementation
Worth understanding because you made a different choice deliberately:
| Aspect | tmux | This curriculum |
|---|---|---|
| What the server sends clients | Escape sequences for the client's terminal | Screen state (styled runs) |
| Consequence | Must know the client's terminfo; re-implements terminal output | Clients can be dumb; different sizes and capabilities are easy |
| Cost | Deep compatibility with any client terminal | Your client must render, so it must be yours |
| Multi-client sizing | Smallest-wins, with aggressive-resize per window | Smallest-wins (documented) |
| Client-side prefix | Yes | Yes |
| Copy mode | Client-side, vi/emacs bindings | Client-side |
Neither is wrong. tmux's choice buys universality; yours buys simplicity and multi-client flexibility. Being able to state that trade-off is the point — it is a capstone write-up question.
Terminal Libraries (Reusable Cores)
The projects that already did what Section 5 asks of you.
| Library | Language | Scope | Maps to your |
|---|---|---|---|
vte | Rust | Parser only | terminal-protocol |
alacritty_terminal | Rust | Parser + screen + grid | terminal-protocol + terminal-core |
termwiz | Rust | Parser, screen, input, surfaces, line editing | protocol + core + input + render-model |
portable-pty | Rust | PTY + ConPTY behind one API | terminal-pty |
| libghostty | Zig (C ABI) | Parser, state, input, PTY | Sections 1–3's core, behind an FFI |
libvte (GNOME) | C | A full terminal widget for GTK | core + gui, fused |
pyte | Python | Parser + screen, headless | protocol + core |
xterm.js | TypeScript | A terminal in the browser | core + gui, for the web |
The exercise
Pick one, clone it, and produce the mapping table onto your nine crates:
git clone https://github.com/alacritty/vte && cd vte
cargo tree --depth 1 # how many dependencies? why so few?
tokei src/ # how many lines is a production parser?
Then ask, for each difference: what did their choice buy them? That question is worth more than another chapter of prose, and it is Lab 20's challenge 3.
Terminal Programs Worth Testing Against
Your compatibility matrix uses these. Grouped by what they stress:
| Category | Programs | Stresses |
|---|---|---|
| Shells | bash, zsh, fish, nushell | Line editing, job control, SIGWINCH, heavy SGR |
| Editors | vim, neovim, emacs -nw, nano, helix | Alt screen, scroll regions, mouse, focus, paste |
| Pagers | less, most, bat | Alt screen, \r overwriting, search highlight |
| Monitors | top, htop, btop, glances | Scroll regions, mouse, 256 colors, 1 Hz redraw |
| TUI frameworks | ncurses apps, dialog, ratatui demos, gum | Cursor addressing, box drawing, the DEC graphics charset |
| Multiplexers | tmux, screen, zellij | Everything, nested — the hardest test |
| REPLs | python3, node, irb, ghci | Readline, multi-line editing, colored tracebacks |
| Network | ssh, mosh, telnet | Split sequences, latency, TERM propagation |
| Graphics | timg, chafa, viu, img2sixel | Sixel or the kitty graphics protocol |
| Unicode torture | man, CJK text, emoji files, git log --graph | Widths, combining marks, overstrike, box drawing |
# A quick torture corpus:
printf '日本語 中文 한국어\n'
printf '👨👩👧👦 👍🏽 🇯🇵 ❤️\n'
printf 'e\xcc\x81 a\xcc\x80 o\xcc\x88\n'
printf '┌───┬───┐\n│ a │ 日 │\n└───┴───┘\n'
man ls | head -20 # overstrike bold
git log --graph --oneline -20 --color=always
Benchmarks and Comparisons
| Tool | Measures |
|---|---|
vtebench (Alacritty) | Throughput: scrolling, dense SGR, unicode, cursor motion |
termbench | Similar, different corpus |
time (cat bigfile) | The crudest and most honest throughput test |
typometer | Input latency, measured optically |
| Dan Luu's latency methodology | Why "fast" terminals sometimes feel slow |
git clone https://github.com/alacritty/vtebench && cd vtebench
cargo build --release
./target/release/vtebench -b ./benchmarks alt-screen-random-write | your-terminal
Run these against your terminal at the capstone. The numbers belong in your write-up — and a terminal that is 10× slower than Alacritty is fine and expected; one that is 1000× slower has a specific bug worth finding.
Where the Protocol Is Going
Active work, and the projects driving it:
| Area | Driven by | Status |
|---|---|---|
| Keyboard protocol | kitty; adopted by foot, WezTerm, Ghostty, Neovim | Growing adoption |
| Graphics | kitty protocol vs. sixel revival | Contested; both in use |
Synchronized output (?2026) | contour, kitty, Ghostty, tmux | Broadly adopted |
Grapheme clustering (?2027) | contour, Ghostty | Early |
| Semantic prompts (OSC 133) | iTerm2, kitty, WezTerm, Ghostty | Growing; shells need to opt in |
| Hyperlinks (OSC 8) | broad | Adopted |
| A shared terminal-features registry | community efforts | Ongoing, and genuinely needed |
This is the most active the terminal protocol has been since the 1990s. Several of the capstone portfolio projects are implementations of things on this list, and a good implementation plus a written report is a real contribution.
Where to Contribute
Once you finish this curriculum you have the context to be useful immediately. In rough order of approachability:
| Project | Good first contributions |
|---|---|
Alacritty / vte | Parser edge cases, escape-sequence support, tests |
| zellij | Rust, active, welcoming; plugin and layout work |
| WezTerm | Broad surface; termwiz and portable-pty are well-scoped |
| foot | C, small, focused; performance and Wayland work |
| Ghostty | Zig; the libghostty split needs API work |
| tmux | C, mature, conservative; bug fixes and documentation |
unicode-width / unicode-segmentation | The width tables everything depends on |
| terminfo / ncurses | Database corrections — unglamorous and genuinely valuable |
What makes you useful on day one: you can read a bug report, reproduce it with a recording, bisect to the offending byte, and name the missing capability. That workflow — from the debugger chapter — is most of what maintaining a terminal consists of.
Validation / Self-check
- Which project split its parser into a separately published crate, and what did that buy the ecosystem?
- What is libghostty, and which two applications consume it?
- Why read
stbefore reading xterm? - Why read
abducobefore reading tmux? - What does tmux send its clients, what do you send yours, and what does each choice cost?
- Name three protocol proposals from the last decade and the project that drove each.
- Map
vte,alacritty_terminal,termwiz, andportable-ptyonto your nine crates. - Which programs would you use to test scroll regions, mouse drag, and overstrike bold?
- What does
vtebenchmeasure, and what would a 1000× slowdown against Alacritty indicate? - You want to contribute a parser fix upstream. Which project, and what would your PR contain?
See also: Primary Sources · The Capstone Portfolio · Interactive Compatibility