Skip to content

Underline color (SGR 58)

Category: sgr · Baseline: modern · Tags: Kitty Extensions · Specification ↗

ESC [ 58;2;R;G;B m
SGR 58 sets the underline color independently of the text foreground color. The syntax mirrors SGR 38 (foreground): ESC [ 58:2::R:G:B m for truecolor, ESC [ 58:5:N m for 256-color. Reset the underline color to default with SGR 59. This is particularly useful with curly underlines (SGR 4:3) for diagnostic indicators: red underline for errors, yellow for warnings, blue for hints — all while keeping the text color unchanged. Introduced by Kitty and adopted by other modern terminals.
How this is testedautomated
Send \x1b[4m\x1b[58;2;255;0;128mX, verify the cell has underline active and underlineColor matches RGB(255, 0, 128).

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 11 of 12 terminals (92%). Not supported by: vt100.js. Part of the Modern TUI baseline. Notes: vt100.js: Not implemented — pure TypeScript emulator.

Supported by 10 of 14 backends (71%)

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
vterm0.2.0✓ yes
xterm.js5.5.0✓ yes
Alacritty0.26.0~ partialNot exposed via alacritty_terminal API
Kitty0.40.0~ partialNot exposed via Python batch bridge
WezTerm0.1.0-fork.5~ partialNot exposed via wezterm-term API
vt100.js0.2.1✗ noNot implemented — pure TypeScript emulator