Appearance
Underline color, indexed (SGR 58;5)
CSI 58 ; 5 ; N mSGR 58;5;N sets the underline color to one of the 256 indexed palette colors, mirroring the SGR 38;5 syntax used for foreground color. The sequence is
ESC [ 58 ; 5 ; N m, where N is a palette index (0-15 system colors, 16-231 6×6×6 RGB cube, 232-255 grayscale ramp). The colon-separated form ESC [ 58 : 5 : N m is also accepted by terminals that support ECMA-48 sub-parameter syntax.
Indexed underline color is widely supported on terminals that implement the broader Kitty extended underline protocol: Kitty, WezTerm, foot, Ghostty, VTE-based terminals (GNOME Terminal, Tilix), mintty, and iTerm2. Combine with curly underlines (SGR 4:3) to render diagnostic indicators in palette colors that match the user's theme.
Reset the underline color to default (typically the foreground color) with SGR 59.How this is testedautomated
Send
Send
\x1b[4m\x1b[58;5;5mX, verify the cell at (0,0) has underline active. If the backend tracks underline color per cell, also verify underlineColor matches palette index 5 (magenta).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 14 backends (57%)
Terminal Applications
| Terminal | Version | Support | Notes |
|---|---|---|---|
| iTerm2 | 3.6.9 | ✓ yes | |
| Ghostty | 1.3.1 | ✓ yes | |
| Terminal.app | 2.15 | ✓ yes | |
| Kitty | 0.46.2 | ✓ yes | Underline color not exposed via Python batch bridge |
| VS Code | 1.113.0 | ? unknown | |
| Warp | 0.2026.03.18.08.24.03 | ? unknown | |
| Cursor | 2.6.21 | ? unknown |
Headless Backends
Parser correctness only — a ✓ means the parser accepts the sequence.
| Backend | Version | Support | Notes |
|---|---|---|---|
| vterm | 0.2.0 | ✓ yes | |
| xterm.js | 5.5.0 | ✓ yes | |
| Alacritty | 0.26.0 | ~ partial | Headless alacritty backend doesn't expose underlineColor on cells |
| WezTerm | 0.1.0-fork.5 | ~ partial | Headless wezterm backend doesn't expose underlineColor on cells |
| vt100.js | 0.2.1 | ✗ no | Colored underline (SGR 58) post-dates VT220 — not implemented in vt100.js baseline |