Skip to content

Special color (OSC 5)

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

ESC ] 5 ; c ; spec BEL
OSC 5 sets or queries special color resources used for text attributes. The sequence is ESC ] 5 ; c ; spec BEL where c identifies the special color: 0=bold, 1=underline, 2=blink, 3=reverse, 4=italic. To query: ESC ] 5 ; c ; ? BEL. These special colors override the rendered color of text with specific attributes — for example, making all bold text appear in a specific color regardless of the foreground setting. Support is limited to xterm and a few other terminals.
How this is testedautomated
Query special color 0 (bold) with OSC 5 ; 0 ; ? BEL, verify response matches OSC 5 ; 0 ; rgb:... pattern.

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 2 of 9 terminals (22%). Part of the Rich TUI baseline.

Supported by 1 of 14 backends (7%)

Terminal Applications

TerminalVersionSupportNotes
Terminal.app✓ yes
iTerm23.6.9✗ noNo OSC 5 response
Ghostty1.3.1✗ noNo OSC 5 response
VS Code✗ no
Warp✗ no
Cursor✗ no

Headless Backends

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

BackendVersionSupportNotes
Alacritty0.26.0✗ noOSC 5 special color query requires a real display — headless backends have no color palette to query
Kitty0.40.0✗ noOSC 5 special color query requires a real display — headless backends have no color palette to query
vt100.js0.2.1✗ noNot implemented — pure TypeScript emulator
vterm0.2.0✗ noOSC 5 special color query not implemented in vterm.js
WezTerm0.1.0-fork.5✗ noOSC 5 special color query requires a real display — headless backends have no color palette to query
xterm.js5.5.0✗ noOSC 5 special color query requires a real display — headless backends have no color palette to query