ANSI escape codes by family
Every ANSI / VT escape sequence in this site, grouped by the wire-protocol family it belongs to. Pick a family to see every sequence in it on one page.
All sequence families
- SGR escape codes — color and text attributes
24 sequencesSelect Graphic Rendition. The `ESC [ … m` family — every code that paints colour, bold, italic, underline, blink, reverse, strikethrough, or any other text-style attribute onto the terminal. The largest and most-googled corner of the ANSI alphabet.
SGR (color & attributes) - CSI escape codes — cursor, erase, scroll, position
60 sequencesControl Sequence Introducer. The `ESC [` family minus its SGR sub-set — cursor movement (up / down / forward / back / column / absolute position), erase (line / display), scroll, save / restore, and the handful of CSI sequences for window and cursor reporting.
CSI (cursor & erase) - DEC private modes — alt screen, cursor, mouse, focus
17 sequencesDEC private mode set / reset. The `ESC [ ? n h` and `ESC [ ? n l` family — alternate screen buffer, cursor visibility, bracketed paste, focus events, mouse tracking, application keypad, line wrap. Originally DEC VT-series extensions, adopted universally by xterm-family terminals.
DEC private modes - OSC escape codes — window title, hyperlinks, colour palette
20 sequencesOperating System Command. The `ESC ] n ; payload BEL` (or `ESC \` terminated) family — window / icon title, the OSC 8 hyperlink protocol, dynamic colour queries, palette overrides, working-directory reporting. The protocol layer that lets terminals talk back to and configure the emulator itself.
OSC (terminal control) - ESC escape codes — bare two-byte sequences
8 sequencesBare escape sequences. The `ESC X` family where `X` is a single byte in `0x20–0x7e` and there is no CSI / OSC framing — `ESC c` (full reset / RIS), `ESC 7` / `ESC 8` (DECSC / DECRC cursor save and restore), keypad mode toggles, character-set designations. Older than the CSI grammar and predate ECMA-48 in some cases.
ESC (bare escape sequences) - DCS escape codes — device control strings
11 sequencesDevice Control String. The `ESC P … ESC \` envelope — Sixel graphics, ReGIS, terminfo-query protocol (XTGETTCAP), DECRQSS (request selection or setting). High-bandwidth out-of-band data: anything from an inline image to a query for the terminal's current cursor style.
DCS (device control strings) - C0 controls — the single-byte control characters
1 sequenceC0 control codes. The 32 single-byte controls below `0x20` — BEL `0x07`, BS `0x08`, HT `0x09`, LF `0x0a`, CR `0x0d`, ESC `0x1b`, SI / SO, and friends. Not escape sequences per se, but every terminal emulator parses them alongside SGR / CSI and they show up in any ANSI-laden log.
C0 controls (single-byte)