Strikethrough
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!
Standard
Strikethrough (SGR 9) is an SGR attribute that renders text with a horizontal line through the middle.
Syntax
CSI 9 m SGR 9 — Strikethrough (crossed out)
CSI 29 m SGR 29 — Not strikethrough
Formal syntax
SGR-strikethrough = 0x1b, "[", "9", "m" ; SGR-not-strikethrough = 0x1b, "[", "29", "m" ;
Description
Per ECMA-48 §8.3.117, SGR parameter 9 selects "crossed-out (characters still legible but marked as to be deleted)." A horizontal line is drawn through the center of each character.
Strikethrough is reset by SGR 29 or SGR 0.
Strikethrough was not supported on DEC VT terminals. It is widely supported by modern terminal emulators.
Examples
printf '\e[9mStrikethrough text\e[29m Normal text\n'
printf '\e[9;31mRed strikethrough\e[0m\n'
Specifications
| Specification | Section |
|---|---|
| VT510 Reference | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✓ | Yes | |
| Bobcat | ? | ? | Implemented in external TerminalCtrl library, not in Bobcat source code |
| contour | ✓ | v0.1.0 | |
| foot | ✓ | Yes | Implemented at csi.c:129 |
| Ghostty | ✓ | v1.0.0 | |
| iTerm2 | ✓ | Yes | Strikethrough (SGR 9) fully supported via VT100CHARATTR_STRIKETHROUGH in VT100GraphicRendition structure. |
| Kitty | ✓ | Yes | |
| Konsole | ✓ | Yes | SGR 9 sets RE_STRIKEOUT rendition flag |
| mintty | ✓ | Yes | Implemented at src/termout.c:2156. Sets ATTR_STRIKEOUT flag. |
| mlterm | ✓ | rel-3_3_7 | |
| PuTTY | ✓ | 0.75 | SGR 9 sets ATTR_STRIKE at terminal.c:4669-4671 |
| Rio | ✓ | v0.0.3 | |
| rxvt-unicode | ✗ | No | Commented out in code with '//case 9: // crossed out' |
| st | ✓ | 0.6 | Implemented as ATTR_STRUCK |
| terminology | ✓ | v0.1.0 | Stored as strike attribute |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | |
| WezTerm | ✓ | Yes | |
| Windows Terminal | ✓ | Yes | SGR 9 sets crossed-out attribute |
| xterm | ✓ | Yes | ECMA-48 3rd edition feature, requires OPT_WIDE_ATTRS |
| xterm.js | ✓ | 4.14.0 | |
| Multiplexers | |||
| cy | ✓ | v0.6.0 | |
| GNU Screen | ✗ | No | SGR 9 not supported (rendlist[9] = 0 at src/ansi.c:1703) |
| tmux | ✓ | 2.4 | |
| tuios | ✓ | v0.0.15 | |
| Zellij | ✓ | v0.12.0 | |
See also
- Underline — SGR 4 — Underlined text
- Overline — SGR 53 — Line above text