Skip to main content

Dashed underline

AI-Generated Content
This page was generated with the assistance of AI and may contain inaccuracies. It is intended as a placeholder for future human verification. If you spot issues ahead of its initial review, please report them on GitHub!
Experimental

Dashed underline (SGR 4:5) is an extended underline style that renders a dashed line below the text.

Syntax​

CSI 4:5 m    SGR 4:5 — Dashed underline
CSI 24 m SGR 24 — Not underlined
Formal syntax
SGR-dashed-underline = 0x1b, "[", "4:5", "m" ;
SGR-not-underline    = 0x1b, "[", "24", "m" ;

Description​

SGR 4:5 selects a dashed underline style using the sub-parameter syntax from the Kitty underline extension. The line below the text is rendered as a series of dashes rather than a continuous line.

Dashed underline is reset by SGR 24 or SGR 0.

The underline color can be set independently using SGR 58.

Examples​

printf '\e[4:5mDashed underlined text\e[24m Normal text\n'

Specifications​

SpecificationSection
Kitty Underlines Extension—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✓YesSGR 4:5 - DASHED_UNDERLINE flag defined in cell.rs:32
Bobcat??Implemented in external TerminalCtrl library, not in Bobcat source code
contour✓v0.3.6.240SGR 4:5 implemented
foot✓YesSGR 4:5, enum UNDERLINE_DASHED in terminal.h:114, csi.c:102-119
Ghostty✓v1.1.0
iTerm2✓v20260216-nightly
Kitty✓v0.24.2
Konsole✓YesRE_UNDERLINE_DASH (value 5) handled via SGR 4:5 in src/Vt102Emulation.cpp:596,2040
mintty✓YesSGR 4:5 implemented at termout.c:2142-2144, mapped to ATTR_BROKENUND | ATTR_DOUBLYUND, rendered as PS_DASH
mlterm✗NoOnly single and double underline styles are implemented
PuTTY✗NoOnly basic underline (SGR 4) supported; no colon-based subparameters
Rio✓v0.0.3
rxvt-unicode✗No
st✗NoOnly basic underline (SGR 4) is supported
terminology✗NoOnly basic underline (SGR 4) supported, no style variants
VT100✗No
VTE✓YesSGR 4:5 supported via subparameter handling in sgr.hh
WezTerm✓YesImplemented via SGR 4:5 - see wezterm-escape-parser/src/csi.rs:2667
Windows Terminal✓YesSGR 4:5 - DashedUnderlined (value 5) in UnderlineStyle enum
xterm✗NoNo evidence of SGR 4:5 support. Only basic underline (SGR 4) and double underline (SGR 21) are implemented
xterm.js✓4.6.0
Multiplexers
cy✗NoOnly basic underline (SGR 4) is supported
GNU Screen✗No
tmux✓2.9SGR 4:5 - Requires Smulx capability
tuios✓v0.2.0
Zellij✓v0.39.0

See also​