Skip to content

Reset underline color (SGR 59)

Category: sgr · Baseline: rich · Tags: ECMA-48 Standard, Kitty Extensions · Specification ↗

CSI 59 m
SGR 59 resets the underline color to its default value, which typically matches the current text foreground color. The sequence is ESC [ 59 m. This is the companion reset for SGR 58 (set underline color), analogous to how SGR 39 resets the foreground color set by SGR 38. Using SGR 59 allows applications to clear an explicit underline color without resetting other attributes — the underline style itself (single, double, curly, dotted, dashed) and any other SGR state remain in effect. To remove the underline entirely, use SGR 24 instead. SGR 59 is supported wherever SGR 58 is supported: Kitty, WezTerm, foot, Ghostty, Alacritty, VTE-based terminals, iTerm2, mintty, Konsole, and Windows Terminal.
How this is testedautomated
Send \x1b[4m\x1b[58;2;255;0;128mX\x1b[59mY, verify the cell at (0,0) has the colored underline and the cell at (0,1) has underline active but no explicit underlineColor (or a null/default value).

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 8 of 9 terminals (89%). Not supported by: vt100.js. Part of the Rich TUI baseline. Notes: vt100.js: Colored underline (SGR 59) post-dates VT220 — not implemented in vt100.js baseline.

Supported by 10 of 14 backends (71%)

Terminal Applications

TerminalVersionSupportNotes
iTerm23.6.9✓ yes
Ghostty1.3.1✓ yes
Terminal.app2.15✓ yes
Kitty0.46.2✓ yes
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✓ yes
vterm0.2.0✓ yes
WezTerm0.1.0-fork.5✓ yes
xterm.js5.5.0✓ yes
vt100.js0.2.1✗ noColored underline (SGR 59) post-dates VT220 — not implemented in vt100.js baseline