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

ProjectLanguageRenderingThe design idea
xtermCX11The reference implementation. Thirty years of accretion, and the compatibility target everything claims.
st (suckless)CX11A whole terminal in ~2,500 lines. The best codebase to read end to end.
urxvtC++X11Daemon mode: one process, many windows — a precursor to the mux idea.
AlacrittyRustGPU (OpenGL)Proved GPU rendering; split its parser (vte) and core (alacritty_terminal) into reusable crates.
kittyC + PythonGPU (OpenGL)The protocol innovator: graphics, keyboard, and several other extensions started here.
WezTermRustGPU (wgpu)Batteries included: multiplexing, ssh, and termwiz/portable-pty as reusable libraries.
footCWayland (CPU + damage)Small, fast, Wayland-native. Proof that CPU rendering is fine when damage tracking is right.
GhosttyZigGPU (Metal/OpenGL)libghostty: a reusable core behind a C ABI, with native Swift and GTK apps on top.
contourC++GPUProtocol research — synchronized output and grapheme clustering were proposed here.
iTerm2Objective-CmacOS nativeFeature maximalism; the origin of several OSC extensions.
Windows TerminalC++DirectWriteThe ConPTY consumer; forced Windows to grow a real pseudoconsole.
rioRustGPU (wgpu)A modern Rust terminal with multiplexing built in.
Terminal.appObjective-CmacOS nativeDeliberately conservative. A useful "minimum baseline" to test against.

What to steal from each

ReadFor
stThe whole shape of a terminal, in one sitting. Start here.
vteThe parser. The cleanest implementation of the Williams state machine anywhere.
alacritty_terminalThe screen model, and the grid-as-ring-of-lines optimization.
footDamage tracking and CPU rendering done properly.
kittyProtocol extensions and their rationale documents.
GhosttyThe core/platform split — the subject of Section 5.
xtermAuthoritative behavior when sources disagree. Reference, not a style model.

Multiplexers

ProjectLanguageThe design idea
GNU screen (1987)CInvented detach/attach. Still everywhere; showing its age.
tmux (2007)CThe modern standard. Server + clients, a scripting API, and control mode (-CC) for embedding.
zellijRustMultiplexing with a WASM plugin system and discoverable keybindings.
dvtmCA tiny tiling multiplexer; readable in an afternoon.
abducoCDetach/attach only — no panes. The clearest possible demonstration of the core idea.
WezTerm muxRustMultiplexing inside the terminal, including over SSH.
Zed / VS Code terminalsRust / TSTerminals 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:

AspecttmuxThis curriculum
What the server sends clientsEscape sequences for the client's terminalScreen state (styled runs)
ConsequenceMust know the client's terminfo; re-implements terminal outputClients can be dumb; different sizes and capabilities are easy
CostDeep compatibility with any client terminalYour client must render, so it must be yours
Multi-client sizingSmallest-wins, with aggressive-resize per windowSmallest-wins (documented)
Client-side prefixYesYes
Copy modeClient-side, vi/emacs bindingsClient-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.

LibraryLanguageScopeMaps to your
vteRustParser onlyterminal-protocol
alacritty_terminalRustParser + screen + gridterminal-protocol + terminal-core
termwizRustParser, screen, input, surfaces, line editingprotocol + core + input + render-model
portable-ptyRustPTY + ConPTY behind one APIterminal-pty
libghosttyZig (C ABI)Parser, state, input, PTYSections 1–3's core, behind an FFI
libvte (GNOME)CA full terminal widget for GTKcore + gui, fused
pytePythonParser + screen, headlessprotocol + core
xterm.jsTypeScriptA terminal in the browsercore + 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:

CategoryProgramsStresses
Shellsbash, zsh, fish, nushellLine editing, job control, SIGWINCH, heavy SGR
Editorsvim, neovim, emacs -nw, nano, helixAlt screen, scroll regions, mouse, focus, paste
Pagersless, most, batAlt screen, \r overwriting, search highlight
Monitorstop, htop, btop, glancesScroll regions, mouse, 256 colors, 1 Hz redraw
TUI frameworksncurses apps, dialog, ratatui demos, gumCursor addressing, box drawing, the DEC graphics charset
Multiplexerstmux, screen, zellijEverything, nested — the hardest test
REPLspython3, node, irb, ghciReadline, multi-line editing, colored tracebacks
Networkssh, mosh, telnetSplit sequences, latency, TERM propagation
Graphicstimg, chafa, viu, img2sixelSixel or the kitty graphics protocol
Unicode tortureman, CJK text, emoji files, git log --graphWidths, 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

ToolMeasures
vtebench (Alacritty)Throughput: scrolling, dense SGR, unicode, cursor motion
termbenchSimilar, different corpus
time (cat bigfile)The crudest and most honest throughput test
typometerInput latency, measured optically
Dan Luu's latency methodologyWhy "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:

AreaDriven byStatus
Keyboard protocolkitty; adopted by foot, WezTerm, Ghostty, NeovimGrowing adoption
Graphicskitty protocol vs. sixel revivalContested; both in use
Synchronized output (?2026)contour, kitty, Ghostty, tmuxBroadly adopted
Grapheme clustering (?2027)contour, GhosttyEarly
Semantic prompts (OSC 133)iTerm2, kitty, WezTerm, GhosttyGrowing; shells need to opt in
Hyperlinks (OSC 8)broadAdopted
A shared terminal-features registrycommunity effortsOngoing, 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:

ProjectGood first contributions
Alacritty / vteParser edge cases, escape-sequence support, tests
zellijRust, active, welcoming; plugin and layout work
WezTermBroad surface; termwiz and portable-pty are well-scoped
footC, small, focused; performance and Wayland work
GhosttyZig; the libghostty split needs API work
tmuxC, mature, conservative; bug fixes and documentation
unicode-width / unicode-segmentationThe width tables everything depends on
terminfo / ncursesDatabase 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

  1. Which project split its parser into a separately published crate, and what did that buy the ecosystem?
  2. What is libghostty, and which two applications consume it?
  3. Why read st before reading xterm?
  4. Why read abduco before reading tmux?
  5. What does tmux send its clients, what do you send yours, and what does each choice cost?
  6. Name three protocol proposals from the last decade and the project that drove each.
  7. Map vte, alacritty_terminal, termwiz, and portable-pty onto your nine crates.
  8. Which programs would you use to test scroll regions, mouse drag, and overstrike bold?
  9. What does vtebench measure, and what would a 1000× slowdown against Alacritty indicate?
  10. 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