Skip to content

Cursor color (OSC 12)

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

ESC ] 12 ; color BEL
OSC 12 sets or queries the text cursor color. To set: ESC ] 12 ; color BEL where color is an X11 color specification. To query: ESC ] 12 ; ? BEL — the terminal responds with the current cursor color in rgb:RR/GG/BB format. Applications use this to make the cursor match their color scheme, or to provide visual feedback (e.g. changing cursor color to red in insert mode). Widely supported by xterm-compatible terminals.
How this is testedautomated
Query cursor color with OSC 12 ; ? BEL, verify response matches OSC 12 ; 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 4 of 9 terminals (44%). Not supported by: vterm.js, vt100.js, Alacritty, WezTerm, xterm.js. Part of the Modern TUI baseline.

Supported by 6 of 14 backends (43%)

Terminal Applications

TerminalVersionSupportNotes
iTerm23.6.9✓ yes
Ghostty1.3.1✓ yes
VS Code✓ yes
Warp✓ yes
Cursor✓ yes
Terminal.app✓ yes

Headless Backends

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

BackendVersionSupportNotes
Alacritty0.26.0✗ noOSC 12 cursor color query requires a real display — headless backends have no color palette to query
Kitty0.40.0✗ noOSC 12 cursor 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 12 cursor color query not implemented in vterm.js
WezTerm0.1.0-fork.5✗ noOSC 12 cursor color query requires a real display — headless backends have no color palette to query
xterm.js5.5.0✗ noOSC 12 cursor color query requires a real display — headless backends have no color palette to query