Skip to content

ECMA-48 Standard

Features defined in the ECMA-48 standard (also known as ISO/IEC 6429 and ANSI X3.64). ECMA-48 defines the CSI (Control Sequence Introducer) grammar that all modern escape sequences use, including SGR (Select Graphic Rendition) for text styling, cursor movement (CUP, CUU, CUD, CUF, CUB), erase operations (EL, ED), and scroll control (SU, SD). First published in 1976 (5th edition 1991), the standard itself is frozen — but terminals continue to extend the SGR parameter space with vendor extensions (e.g., Kitty's underline variants SGR 4:3–4:5) that use ECMA-48's sub-parameter syntax without being part of the standard. The 1976 first edition defined just the basics; by the 5th edition in 1991, it had grown to cover 8-bit controls, mode switching, and the sub-parameter syntax that modern extensions rely on. ECMA has not revised it since — making it one of the longest-frozen standards still in active daily use.

73 features in this standard · Specification ↗

ECMA-48's core contribution is the CSI grammar: ESC [ followed by numeric parameters separated by ;, terminated by a letter that identifies the function. For example, ESC [1;31m activates bold red text (SGR 1 = bold, SGR 31 = red foreground). This grammar is extensible by design — parameters can include sub-parameters separated by :, which is how modern extensions like Kitty's underline styles (SGR 4:3 for curly underline) fit within the standard's syntax without violating it.

The standard defines three fundamental feature groups that every terminal must support: cursor control (CUP for absolute positioning, CUU/CUD/CUF/CUB for relative movement), erase operations (ED to clear regions of the screen, EL to clear parts of a line), and text styling via SGR (bold, italic, underline, blink, inverse, strikethrough, and 8/16 named colors). SGR 0 resets all attributes — a sequence every CLI tool emits to avoid style leakage.

For developers, ECMA-48 compliance is the absolute minimum bar. If a terminal doesn't handle basic CSI sequences correctly, nothing works — not shells, not editors, not TUI frameworks. The standard is freely available as a PDF from ECMA International, and at 113 pages it remains one of the most concise foundational specs in computing.

Analysis2026-04-06

ECMA-48 Standard defines 73 features in the terminfo.dev matrix. Average adoption across terminals: 94%. Lowest: vt100.js at 68% (50/73).

Terminal Applications

FeatureiTerm2GhosttyVS CodeWarpCursorTerminal.app
Reset all (SGR 0)
Bold (SGR 1)
Faint/dim (SGR 2)
Italic (SGR 3)
Underline (SGR 4)
Blink (SGR 5)
Inverse video (SGR 7)
Hidden/invisible (SGR 8)
Strikethrough (SGR 9)
Double underline (SGR 21)
Reset bold/dim (SGR 22)
Reset italic (SGR 23)
Reset underline (SGR 24)
Reset inverse (SGR 27)
Standard fg colors (SGR 30-37)
Default fg color (SGR 39)
Standard bg colors (SGR 40-47)
Default bg color (SGR 49)
Overline (SGR 53)
Underline color, indexed (SGR 58;5)
Underline color, truecolor (SGR 58;2)
Reset underline color (SGR 59)
Backspace (BS)
Basic text rendering
Carriage return
CBT backward tab (CSI Z)
CHT forward tab (CSI I)
CPL cursor preceding line (CSI F)
CUD stops at bottom
CUP at screen boundaries
Cursor back (CUB)
Cursor down (CUD)
Cursor forward (CUF)
Cursor home
Cursor horizontal absolute (CHA)
Cursor next line (CNL)
Cursor position (CUP)
Cursor position report (DSR 6)
Cursor up (CUU)
CUU stops at top
Delete characters (DCH)
Delete lines (DL)
Device status report (DSR 5)
ED at scroll region boundary
EL erases with bg color
Erase above (ED 1)
Erase below (ED 0)
Erase character (ECH)
Erase line (EL 2)
Erase screen (ED 2)
Erase to BOL (EL 1)
Erase to EOL (EL 0)
Full reset (RIS)
HPA horizontal position absolute (CSI `)
HTS set tab stop (ESC H)
Index (IND)
Insert characters (ICH)
Insert lines (IL)
Insert/replace mode (IRM)
Line feed
Next line (NEL)
Overwrite at cursor
Primary device attributes (DA1)
Repeat character (REP)
Reverse index (RI)
Scroll down (SD)
Scroll up (SU)
SGR reset clears attributes
Tab stops
Tab Stops (HT)
TBC clear tab stop (CSI g)
Text wraps at width
VPA vertical position absolute (CSI d)

Headless Backends

Parser correctness tested via Termless. A means the parser accepts the sequence, not that it renders correctly.

Featurevtermxterm.jsKittyAlacrittyWezTermvt100.js
Reset all (SGR 0)
Bold (SGR 1)
Faint/dim (SGR 2)
Italic (SGR 3)
Underline (SGR 4)
Blink (SGR 5)~~~
Inverse video (SGR 7)
Hidden/invisible (SGR 8)~~~~
Strikethrough (SGR 9)
Double underline (SGR 21)~
Reset bold/dim (SGR 22)
Reset italic (SGR 23)
Reset underline (SGR 24)
Reset inverse (SGR 27)
Standard fg colors (SGR 30-37)~~
Default fg color (SGR 39)
Standard bg colors (SGR 40-47)~
Default bg color (SGR 49)
Overline (SGR 53)
Underline color, indexed (SGR 58;5)~~~
Underline color, truecolor (SGR 58;2)~~~
Reset underline color (SGR 59)
Backspace (BS)
Basic text rendering
Carriage return
CBT backward tab (CSI Z)
CHT forward tab (CSI I)
CPL cursor preceding line (CSI F)
CUD stops at bottom
CUP at screen boundaries
Cursor back (CUB)
Cursor down (CUD)
Cursor forward (CUF)
Cursor home
Cursor horizontal absolute (CHA)
Cursor next line (CNL)
Cursor position (CUP)
Cursor position report (DSR 6)~~~~
Cursor up (CUU)
CUU stops at top
Delete characters (DCH)
Delete lines (DL)
Device status report (DSR 5)~~~~
ED at scroll region boundary
EL erases with bg color
Erase above (ED 1)
Erase below (ED 0)
Erase character (ECH)
Erase line (EL 2)
Erase screen (ED 2)
Erase to BOL (EL 1)
Erase to EOL (EL 0)
Full reset (RIS)
HPA horizontal position absolute (CSI `)
HTS set tab stop (ESC H)
Index (IND)
Insert characters (ICH)
Insert lines (IL)
Insert/replace mode (IRM)~
Line feed
Next line (NEL)
Overwrite at cursor
Primary device attributes (DA1)~~~~
Repeat character (REP)
Reverse index (RI)
Scroll down (SD)
Scroll up (SU)~
SGR reset clears attributes
Tab stops
Tab Stops (HT)
TBC clear tab stop (CSI g)
Text wraps at width
VPA vertical position absolute (CSI d)