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

Description

ECMA-48 calls this 'crossed-out'. Disable with `\x1b[29m`. Supported by most modern emulators (xterm, iTerm2, kitty, alacritty, wezterm, Windows Terminal, gnome-terminal, konsole, Ghostty). Linux console and traditional cmd.exe ignore it. Commonly used to mark deleted lines in diff renderers and crossed-out items in TODO/CLI lists.

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");

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
no
GNU screen
no

Related sequences