Skip to content

Kitty color protocol (OSC 21)

Category: extensions · Baseline: rich · Tags: Operating System Commands (OSC), Kitty Extensions · Specification ↗

ESC ] 21 ; key=value BEL
OSC 21 is Kitty's key-value color protocol, designed as a structured replacement for the scattered OSC 10–19 color sequences. Instead of issuing separate sequences for foreground, background, cursor, selection, and palette colors, applications send a single ESC ] 21 ; key=value;... BEL sequence that updates any combination of named color slots. Both setting and querying are supported: key=? requests the current value, and the terminal responds with the same key-value framing. The protocol is well-defined and avoids the parsing ambiguities of the legacy xterm color sequences. Currently supported by Kitty, Ghostty, and foot.
How this is testedpartial
Send OSC 21 ; foreground=? BEL and verify the terminal responds with the foreground color in key-value form.

The same probe runs against headless backends (via Termless) and real terminal apps (via a daemon launched in each terminal). This lets us distinguish parser correctness from rendering correctness.

Analysis2026-04-06

Supported by 4 of 9 terminals (44%). Not supported by: vterm.js, vt100.js, Alacritty, WezTerm, xterm.js. Part of the Rich TUI baseline.

Supported by 6 of 14 backends (43%)

Terminal Applications

TerminalVersionSupportNotes
iTerm23.6.9✓ yesConsumed (no query response)
Ghostty1.3.1✓ yes
Terminal.app2.15✓ yesConsumed (no query response)
Kitty0.46.2✓ yesOSC 21 query responses not exposed via Python batch bridge
VS Code1.113.0? unknown
Warp0.2026.03.18.08.24.03? unknown
Cursor2.6.21? unknown

Headless Backends

Parser correctness only — a means the parser accepts the sequence.

BackendVersionSupportNotes
Alacritty0.26.0✗ noKitty color protocol (OSC 21) not implemented by alacritty
vt100.js0.2.1✗ noKitty color protocol (OSC 21) not implemented — post-dates VT220 baseline
vterm0.2.0✗ noKitty color protocol (OSC 21) not implemented in vterm.js
WezTerm0.1.0-fork.5✗ noKitty color protocol (OSC 21) not implemented by wezterm
xterm.js5.5.0✗ noKitty color protocol (OSC 21) not implemented in xterm.js