Skip to content

Highlight foreground (OSC 19)

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

ESC ] 19 ; spec BEL
OSC 19 sets or queries the terminal's selection highlight foreground color. The query is ESC ] 19 ; ? BEL and the terminal responds with the color in X11 rgb:RR/GG/BB format. Setting uses ESC ] 19 ; spec BEL. This is the complement to OSC 17 (highlight background) — together they give applications full control over selection appearance. Fewer terminals support OSC 19 than OSC 17, as some terminals use a fixed or alpha-blended selection foreground. Supported by xterm and foot.
How this is tested: Query highlight foreground color with OSC 19 ; ? BEL, verify response matches OSC 19 ; rgb:... pattern via feedCapture.
Analysis2026-04-06

Supported by 2 of 8 terminals (25%). Part of the Rich TUI baseline.

Supported by 2 of 14 backends (14%)

Terminal Applications

TerminalVersionSupportNotes
iTerm23.6.9✓ yes
Kitty0.46.2✓ yesOSC 19 highlight foreground query requires a real display — headless backends have no color palette to query
Ghostty1.3.1✗ noNo OSC 19 response
VS Code1.113.0? unknown
Warp0.2026.03.18.08.24.03? unknown
Cursor2.6.21? unknown
Terminal.app2.15? unknown

Headless Backends

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

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