Skip to content

xterm.js

A terminal emulator written in TypeScript for the browser. It is the engine behind VS Code's integrated terminal, Hyper, Tabby, ttyd, JupyterLab, Theia, and many web consoles.

Identity

  • TERM, COLORTERM, and TERM_PROGRAM are set by the host that owns the PTY, not by xterm.js. VS Code sets TERM_PROGRAM=vscode and TERM_PROGRAM_VERSION; other hosts vary.
  • DA1: CSI ? 1 ; 2 c ? (configurable by the host through the API).
  • DA2: CSI > 0 ; 276 ; 0 c ?.
  • XTVERSION: ?

Documentation

Addon model

The core handles parsing, the screen model, mouse and keyboard encoding, and basic rendering. Optional behavior lives in addons that a host must load:

  • @xterm/addon-image: Sixel and iTerm2 inline images.
  • @xterm/addon-clipboard: OSC 52.
  • @xterm/addon-unicode11 (and later Unicode versions): character width tables newer than the built-in Unicode 6 table.
  • @xterm/addon-ligatures, @xterm/addon-webgl, @xterm/addon-canvas: rendering only.
  • @xterm/addon-web-links: URL detection in text, distinct from OSC 8.

Two hosts on the same core version therefore differ in graphics, clipboard, and width behavior according to which addons they load.

Notable behavior

  • Supports truecolor, DECSCUSR, all xterm mouse modes, bracketed paste, alternate screen, OSC 8, underline styles, and synchronized output (2026).
  • Does not implement the Kitty keyboard protocol or the Kitty graphics protocol in core.
  • The host decides which keys reach the terminal at all; browser and editor keybindings frequently intercept chords before xterm.js sees them.

Version notes

5.x releases; the package moved from xterm to @xterm/xterm in 5.4. See the release notes for VT additions.

Probe

echo "$TERM_PROGRAM $TERM_PROGRAM_VERSION"
tools/query '\033[>c'

Feature support

Records are maintained independently in tdn/terminals/xtermjs.yaml. Unlisted features are unknown. See the comparison for all features.

FeatureSupportAs ofNotes and evidence
BEL urgency/visual
c0-bel-attention
PartialImported · unverifiedUnversionedPartial

import

14/16 pixel sizes
csi-14-16-t-pixel-sizes
SupportedImported · unverifiedUnversionedYes

import

18 size in cells
csi-18-t-text-size
SupportedImported · unverifiedUnversionedYes

import

22/23 title stack
csi-22-23-t-title-stack
SupportedImported · unverifiedUnversionedYes

import

ED 3 (scrollback)
csi-3-j-erase-scrollback
SupportedImported · unverifiedUnversionedYes

import

DECRQM
csi-decrqm
SupportedImported · unverifiedUnversionedYes

import

DECSLRM / ?69
csi-decslrm
UnsupportedImported · unverifiedUnversionedNo ([xterm.js supported terminal sequences](https://xtermjs.org/docs/api/vtfeatures/) lists DECSLRM as unsupported.)

import

DECSTBM
csi-decstbm
SupportedImported · unverifiedUnversionedYes

import

DECSTR
csi-decstr
SupportedImported · unverifiedUnversionedYes

import

ED/EL/ECH/ICH/DCH/IL/DL
csi-editing-operations
SupportedImported · unverifiedUnversionedYes

import

REP
csi-rep
SupportedImported · unverifiedUnversionedYes

import

SU/SD
csi-su-sd-scroll
SupportedImported · unverifiedUnversionedYes

import

Kitty keyboard protocol
csi-u-kitty-keyboard
UnknownImported · unverifiedUnversioned?; Open feature request ([xtermjs/xterm.js issue tracker](https://github.com/xtermjs/xterm.js/issues).)

import

DECRQSS
dcs-decrqss
SupportedImported · unverifiedUnversionedYes; [vtfeatures](https://xtermjs.org/docs/api/vtfeatures/): `m`, `r`, `SP q`

import

Sixel
dcs-sixel
SupportedImported · unverifiedUnversionedYes, addon ([@xterm/addon-image](https://github.com/jerch/xterm-addon-image).) | Also recorded: Yes, addon ([@xterm/addon-image](https://github.com/jerch/xterm-addon-image).); `@xterm/addon-image`

import import

XTGETTCAP
dcs-xtgettcap
UnknownImported · unverifiedUnversioned?; not in vtfeatures

import

1000 mouse
dec-mode-1000-mouse
SupportedImported · unverifiedUnversionedYes

import

1002 button motion
dec-mode-1002-button-motion
SupportedImported · unverifiedUnversionedYes

import

1003 all motion
dec-mode-1003-all-motion
SupportedImported · unverifiedUnversionedYes

import

1004 focus
dec-mode-1004-focus
SupportedImported · unverifiedUnversionedYes ([xterm.js supported sequences](https://xtermjs.org/docs/api/vtfeatures/).)

import

1006 sgr mouse
dec-mode-1006-sgr-mouse
SupportedImported · unverifiedUnversionedYes

import

1007 alternate scroll
dec-mode-1007-alternate-scroll
SupportedImported · unverifiedUnversionedYes

import

1015 urxvt mouse
dec-mode-1015-urxvt-mouse
SupportedImported · unverifiedUnversionedYes

import

1049 alternate screen
dec-mode-1049-alternate-screen
SupportedImported · unverifiedUnversionedYes

import

2004 bracketed paste
dec-mode-2004-bracketed-paste
SupportedImported · unverifiedUnversionedYes | Also recorded: Yes; ([xterm.js supported sequences](https://xtermjs.org/docs/api/vtfeatures/).)

import import

2026 synchronized output
dec-mode-2026-synchronized-output
SupportedImported · unverifiedUnversionedYes

import

Grapheme cluster mode (2027)
dec-mode-2027-grapheme-clusters
UnknownImported · unverifiedUnversioned?; Per-code-point storage

import

?45 reverse wrap
dec-mode-45-reverse-wrap
SupportedImported · unverifiedUnversionedYes

import

win32-input-mode
dec-mode-9001-win32-input
UnknownImported · unverifiedUnversioned?; Not a Unix protocol; not documented by any of them

import

DECSCA/DECSED/DECSEL
dec-selective-erase
PartialImported · unverifiedUnversionedPartial

import

DEC Special Graphics
esc-dec-special-graphics
SupportedImported · unverifiedUnversionedYes ([xterm.js](https://xtermjs.org/), `src/common/data/Charsets.ts`.)

import

OSC 0/2 set
osc-0-2-title
SupportedImported · unverifiedUnversionedYes

import

OSC 10/11 query
osc-10-11-default-colors-query
SupportedImported · unverifiedUnversionedYes

import

OSC 10/11 set
osc-10-11-default-colors-set
SupportedImported · unverifiedUnversionedYes

import

104/110/111 reset
osc-104-110-111-color-reset
SupportedImported · unverifiedUnversionedYes

import

OSC 12 cursor
osc-12-cursor-color
SupportedImported · unverifiedUnversionedYes

import

iTerm2
osc-1337-inline-images
SupportedImported · unverifiedUnversionedYes, addon ([@xterm/addon-image](https://github.com/jerch/xterm-addon-image).) | Also recorded: Yes, addon ([@xterm/addon-image](https://github.com/jerch/xterm-addon-image).); `@xterm/addon-image`; also used by the VS Code terminal

import import

OSC 4 query
osc-4-palette-query
SupportedImported · unverifiedUnversionedYes

import

OSC 4 set
osc-4-palette-set
SupportedImported · unverifiedUnversionedYes

import

OSC 52 read
osc-52-read
PartialImported · unverifiedUnversionedPartial; Requires `@xterm/addon-clipboard`; the addon's provider decides

import

OSC 52 write
osc-52-write
PartialImported · unverifiedUnversionedPartial; Requires `@xterm/addon-clipboard`; the addon's provider decides

import

OSC 8 hyperlinks
osc-8-hyperlinks
SupportedImported · unverifiedUnversionedYes (5.0)

import

256 colors
sgr-256-colors
SupportedImported · unverifiedUnversionedYes

import

Italic 3
sgr-3-italic
SupportedImported · unverifiedUnversionedYes

import

Colon form 38:2
sgr-38-2-colon-form
SupportedImported · unverifiedUnversionedYes

import

Truecolor 38;2
sgr-38-2-truecolor
SupportedImported · unverifiedUnversionedYes

import

Underline styles 4:n
sgr-4-underline-styles
SupportedImported · unverifiedUnversionedYes

import

Blink 5
sgr-5-blink
SupportedImported · unverifiedUnversionedYes

import

Overline 53
sgr-53-overline
SupportedImported · unverifiedUnversionedYes

import

Underline color 58
sgr-58-underline-color
SupportedImported · unverifiedUnversionedYes

import

Strikethrough 9
sgr-9-strikethrough
SupportedImported · unverifiedUnversionedYes

import

bce
terminfo-bce
SupportedImported · unverifiedUnversionedYes

import

Bold-is-bright option
text-bold-is-bright
PartialImported · unverifiedUnversionedPartial

import

Synthesized box drawing
text-box-drawing
SupportedImported · unverifiedUnversionedYes

import

Color emoji rendering
text-color-emoji
SupportedImported · unverifiedUnversionedYes

import

Italic face
text-italic-face
SupportedImported · unverifiedUnversionedYes

import

Ligatures / shaping
text-shaping
PartialImported · unverifiedUnversionedPartial (canvas renderer)

import

Bundled Unicode tables
text-unicode-tables
SupportedImported · unverifiedUnversionedYes

import