xterm — ANSI escape code support
xterm is the reference VT-compatible terminal emulator from the X Window System, maintained by Thomas E. Dickey since 1996. Almost every "ANSI escape" feature on the open web is documented against xterm-ctlseqs, the de facto union of ECMA-48, the original VT100/220/420 manuals, and several decades of additions xterm introduced first.
If a sequence works in xterm and is published in xterm-ctlseqs, it is portable; if a sequence is in xterm-ctlseqs but disabled by default, every other VT-compatible emulator is free to ship it or not. "xterm-compatible" on a terminal feature list always means "xterm-ctlseqs subset."
Last updated
Feature support
How this terminal scores against the 15 features tracked in the site-wide support matrix. Click any feature name to see the full row across every terminal.
- 8 basic colors (30–37 / 40–47)SGR 30–37 foreground, 40–47 background.yes
- Bright (aixterm) colors (90–97 / 100–107)aixterm SGR extension.yes
- 256-color palette (38;5;n / 48;5;n)xterm 256-color extension.yes
- 24-bit truecolor (38;2;r;g;b)16.7M direct RGB. Set $COLORTERM=truecolor.yes
- Italic (SGR 3)Italic text attribute.yes
- Styled underlines (4:1–4:5)Curly/dotted/dashed underline styles.partial
- Strikethrough (SGR 9)Horizontal line through text.yes
- OSC 8 hyperlinksInline clickable URIs.partial
- Alt screen (?1049h)Full-screen app buffer.yes
- Mouse tracking (SGR ?1006)Mouse click/drag events.yes
- Bracketed paste (?2004)Pasted text wrapped in ESC[200~/ESC[201~.yes
- Focus events (?1004)ESC[I on focus in, ESC[O on focus out.yes
- Sixel graphicsDEC sixel inline raster images.yes
- Kitty graphics protocolPNG/RGB inline images, animations.no
- Synchronized output (?2026)Atomic frame updates to avoid tearing.no
Sequences that work here
Canonical reference pages for the escape sequences this terminal handles cleanly. Each links to a full page with byte forms, citations, and per-language examples.
- SGR 0 — Reset / Normal
\x1b[0mClear all text attributes and colors back to the terminal default.
- SGR 38;2;R;G;B — 24-bit truecolor foreground
\x1b[38;2;R;G;BmPick any of 16,777,216 foreground RGB colors directly.
- ED — Erase in display (\x1b[2J clear screen)
\x1b[NJErase part or all of the screen.
- OSC 0 / 2 — Set window/icon title
\x1b]0;TITLE\x07Change the terminal window's title bar text.
- DECSET 1049 — Alternate screen buffer
\x1b[?1049h (enter) \x1b[?1049l (leave)Switch to a separate screen buffer (like vim/less do on launch).
Quirks & version notes
Per-terminal caveats you'll want to know before relying on a sequence in production.
- OSC 8 hyperlinks require allowHyperlinks resource
- Added in xterm 359 (Dec 2020) but disabled by default. Enable with .Xresources line `XTerm*allowHyperlinks: true` or `xterm -xrm 'XTerm*allowHyperlinks: true'`. Without the flag xterm prints the raw OSC bytes as literal text.
- Truecolor without $COLORTERM
- xterm parses 24-bit SGR 38;2;r;g;b unconditionally — it doesn't gate on the $COLORTERM=truecolor environment variable that many libraries (chalk, colorama) check first. Apps that rely on the env-var heuristic will silently downgrade to 256-color on xterm even though xterm itself accepts the 24-bit bytes.
- Sixel graphics is a compile-time option
- xterm only emits and accepts DEC sixel sequences if built with `./configure --enable-sixel-graphics`. The pre-built `xterm` package on Debian / Ubuntu / Fedora has sixel enabled since 2021, but Homebrew's macOS bottle ships it disabled — feature-detect via the DA1 response (`CSI c` reply contains 4 = sixel) rather than the terminal name.
- Styled underlines need opt-in
- SGR 4:3 (curly) and 4:4 (dotted) underline support has been in xterm since v341 (2018) but only renders if the terminfo entry is `xterm-direct` or higher. Set $TERM=xterm-direct (Debian / Fedora ship the entry) — `xterm-256color` does not advertise the Smulx extended capability.