DCS Sixel — Inline raster graphics (ESC P q … ESC \)
Embed pixel images in the terminal stream using the Sixel device-control payload.
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\x1bPq <sixel data> \x1b\\\033Pq … \033\\\eP q … \e\\ESC P q DATA ESC \1b 50 71 ... 1b 5cDescription
Sixel is a DEC-era inline pixel graphics format (DEC VT240/VT340) revived by modern terminals. The frame begins with the Device Control String introducer `\x1bP` (DCS), an optional parameter run, the `q` final byte that selects Sixel mode, then a payload of `?`..`~` printable characters where each byte encodes a 6-pixel-tall vertical slice (hence 'sixel'). The frame ends with the String Terminator — either `\x1b\\` (ST, spec-correct) or `\x07` (BEL, widely accepted). `libsixel`, `chafa`, `viu`, `timg`, `ranger`-style image previews, `kitten icat --transfer-mode=stream` (Sixel fallback for Kitty's native protocol), and `mpv --vo=sixel` all emit this sequence. Terminal support varies: xterm needs `+sb` compile and `-ti vt340`, mintty + foot + wezterm + iTerm2 + Windows Terminal Canary + ghostty work out of the box, kitty + alacritty + macOS Terminal do not (Kitty has its own better protocol).
Spec citation: DEC VT340 Programmer Reference / xterm-ctlseqs (DCS Ps; Ps; Ps q)
Examples
# A 12x6 magenta block via the Sixel raw payload\nprintf '\033Pq#0;2;100;0;100#0~~\033\\'import sys; sys.stdout.write('\x1bPq#0;2;100;0;100#0~~\x1b\\')fmt.Print("\x1bPq#0;2;100;0;100#0~~\x1b\\")process.stdout.write('\x1bPq#0;2;100;0;100#0~~\x1b\\')printf("\x1bPq#0;2;100;0;100#0~~\x1b\\");Terminal support
- xterm
- partial
- Linux console (fbcon)
- no
- macOS Terminal.app
- no
- iTerm2
- yes
- Windows Terminal
- partial
- cmd.exe / ConPTY
- no
- kitty
- no
- alacritty
- no
- WezTerm
- yes
- Ghostty
- yes
- GNOME Terminal
- partial
- Konsole
- yes
- tmux
- no
- GNU screen
- no
| xterm | Linux console (fbcon) | macOS Terminal.app | iTerm2 | Windows Terminal | cmd.exe / ConPTY | kitty | alacritty | WezTerm | Ghostty | GNOME Terminal | Konsole | tmux | GNU screen |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| partial | no | no | yes | partial | no | no | no | yes | yes | partial | yes | no | no |
Related sequences
In the family cookbook
DCS cookbook · 2. Pictures inside the stream — Sixel and Kitty graphics