Skip to main content
ansicode

SGR 9 — Strikethrough

Render following text with a horizontal line through it.

Byte forms

Every common string-literal form so you can paste-and-search either direction.

\\x1b[\x1b[9m
\\033[\033[9m
\\e[\e[9m
ESC [ESC [ 9 m
hex1b 5b 39 6d

Live preview

Rendered in your browser via the same tokeniser the decoder uses — no terminal needed.

Strikethrough

Description

ECMA-48 §8.3.117 names SGR 9 "crossed-out". The byte sequence is \x1b[9m. The terminal draws a horizontal line through the middle of every subsequent character cell; the underlying text remains unmodified — selectable, copyable, screen-reader-visible — only the rendering is altered. Naming is inconsistent across documentation: ECMA-48 says "crossed-out", terminfo uses smxx / rmxx (the s-m-x-x mnemonic for "start mode x crossed-out"), and most user-facing tools say "strikethrough" or "strike". The matching close is SGR 29 (\x1b[29m), which removes the line without disturbing fg / bg / bold / italic / underline state.

Strikethrough is the post-2010 SGR attribute with the broadest support across the major GUI emulators in the matrix above — xterm, iTerm2, kitty, alacritty, wezterm, gnome-terminal, Konsole, Ghostty, Apple Terminal.app (since macOS 10.7 Lion, 2011), and Windows Terminal all render it. The exceptions are predictable: Linux console / fbcon ignores SGR 9 (no glyph-overlay renderer in framebuffer mode), legacy Windows cmd.exe pre-ConPTY drops it. The notable multiplexer gotcha is GNU screen: BOTH screen 4.x AND screen 5.0 strip SGR 9 along with OSC 8 hyperlinks and styled underlines (the screen-strips-modern-sgr quirk documented in lib/terminals.ts) — they never reach the outer terminal. tmux forwards SGR 9 if the outer terminfo claims the smxx / rmxx caps; most modern terminfo entries do, but the older screen-256color entry does not, so a tmux session that has set default-terminal "screen-256color" silently drops strikethrough — the fix is set -g default-terminal "tmux-256color" or xterm-256color.

Disable with SGR 29 (\x1b[29m). The classic application is rendering deleted lines in diff viewers and crossed-out items in TODO / CLI checklists — git diff itself does not emit strikethrough (it relies on red + leading -) but custom diff renderers like delta and difftastic optionally use it for the "removed" side. Per color-only-signal, avoid using strikethrough as the sole signal for "deleted" content: terminals that strip the attribute (Linux console, GNU screen, legacy cmd.exe) will leave the text visually identical to live content. Pair it with an explicit prefix ([del], ~~, leading -) so the meaning still arrives even when the line is dropped. Related: sgr-underline (SGR 4 — the adjacent line-decoration attribute), sgr-italic (SGR 3 — commonly mixed with strikethrough for "superseded / old" content), sgr-reset (SGR 0 — full reset).

Spec citation: ECMA-48 §8.3.117 (SGR parameter 9)

Examples

bash
printf '\033[9mdeleted line\033[29m\n'
python
print('\x1b[9mdeleted\x1b[0m')
go
fmt.Print("\x1b[9mdeleted\x1b[0m")
javascript
console.log('\x1b[9mdeleted\x1b[0m')
c
printf("\x1b[9mdeleted\x1b[0m\n");

Used in

Real-world tools that emit this sequence — anchors the bytes to commands you've already used.

  • taskwarrior, todo.txt CLIscompleted tasks render with a line through the text
  • bat (markdown rendering)`~~text~~` GFM strikethrough renders as SGR 9 when output is a terminal
  • glow (markdown viewer)renders GFM strikethrough in the TUI
  • delta — strikethrough on removed words in --color-words
  • tldr clients on deprecated example lines

Frequently asked

Short answers to the questions developers actually search for this sequence.

Is \x1b[9m (strikethrough) widely supported in 2026?
Yes on every modern GUI emulator — xterm, iTerm2, kitty, alacritty, wezterm, ghostty, Windows Terminal, gnome-terminal, konsole, and macOS Terminal.app all render it. The notable holdouts are Linux console / fbcon (no glyph-overlay renderer in framebuffer mode) and legacy Windows cmd.exe pre-ConPTY. GNU screen still strips SGR 9 as of 5.0 — see the screen-strips-modern-sgr pitfall. For multiplexers, prefer tmux with default-terminal "tmux-256color" over screen if your output relies on strikethrough.

Terminal support

xterm
yes
Linux console (fbcon)
no
macOS Terminal.app
yes
iTerm2
yes
Windows Terminal
yes
cmd.exe / ConPTY
no
kitty
yes
alacritty
yes
WezTerm
yes
Ghostty
yes
GNOME Terminal
yes
Konsole
yes
tmux
partial
GNU screen
no

Related sequences