Skip to content

VT features

jerch edited this page Aug 19, 2019 · 8 revisions

NOTE: WORK IN PROGRESS

Supported VT features by xterm.js

Version: 3.14.0

Table of Contents

General notes

This document lists xterm.js' support of typical VT commands. The commands are grouped by their type:

  • C0: single byte command (7bit control characters, byte range \x00 .. \x1f)
  • C1: single byte command (8bit control characters, byte range \x80 .. \x9f)
  • ESC: sequence starting with ESC (\x1b)
  • CSI - Control Sequence Introducer: sequence starting with ESC [ (7bit) or CSI (\x9b 8bit)
  • DCS - Device Control String: sequence starting with ESC P (7bit) or DCS (\x90 8bit)
  • OSC - Operating System Command: sequence starting with ESC ] (7bit) or OSC (\x9d 8bit)

Application Program Command (APC), Privacy Message (PM) and Start of String (SOS) are not supported, any sequence of these types will be ignored.

Note that the list only contains commands implemented in xterm.js' core codebase. Missing commands are either not supported or unstable/experimental. Furthermore addons can provide additional commands.

To denote the sequences the lists use the same abbreviations as xterm does:

  • Ps: A single (usually optional) numeric parameter, composed of one or more decimal digits.
  • Pm: A multiple numeric parameter composed of any number of single numeric parameters, separated by ; character(s), e.g. Ps ; Ps ; ....
  • Pt: A text parameter composed of printable characters. Note that for most commands with Pt only ASCII printables are specified to work. Additionally xterm.js will let any character >C1 pass as printable.

C0

Mnemonic Name Sequence Short Description Status
BEL Bell \a Ring the bell. more supported
BS Backspace \b Move the cursor one position to the left. supported
SO Shift Out \x0e Switch to an alternative character set. more partly
FF Form Feed \f Treated as LF. supported
SI Shift In \x0f Return to regular character set after Shift Out. supported
LF Line Feed \n Move the cursor one row down, scrolling if needed. supported
CR Carriage Return \r Move the cursor to the beginning of the row. supported
HT Horizontal Tabulation \t Move the cursor to the next character tab stop. supported
VT Vertical Tabulation \v Treated as LF. supported

Bell

The behavior of the bell is further customizable with ITerminalOptions.bellStyle and ITerminalOptions.bellSound.

Shift Out

TODO: document supported native character sets and support limitations ...

C1

Mnemonic Name Sequence Short Description Status
IND Index \x84 Move the cursor one line down scrolling if needed. supported
NEL Next Line \x85 Move the cursor to the beginning of the next row. supported
HTS Horizontal Tabulation Set \x88 Places a tab stop at the current cursor position. supported

CSI

Mnemonic Name Sequence Short Description Status
ECH Erase Character CSI Ps X Erase Ps characters from current cursor position to hte right (default=1). supported
SL Scroll Left CSI Ps SP @ Scroll viewport Ps times to the left. unsupported
HPA Horizontal Position Absolute CSI Ps ` Same as CHA. supported
SCORC Restore Cursor CSI u Restore cursor position, charmap and text attributes. partly
CUU Cursor Up CSI Ps A Move cursor Ps times up (default=1). supported
CUD Cursor Down CSI Ps B Move cursor Ps times down (default=1). supported
CUF Cursor Forward CSI Ps C Move cursor Ps times forward (default=1). supported
CUB Cursor Backward CSI Ps D Move cursor Ps times backward (default=1). supported
CNL Cursor Next Line CSI Ps E Move cursor Ps times down (default=1) and to the first column. supported
CPL Cursor Backward CSI Ps F Move cursor Ps times up (default=1) and to the first column. supported
CHA Cursor Horizontal Absolute CSI Ps G Move cursor to Ps-th column of the active row (default=1). supported
CUP Cursor Position CSI Ps ; Ps H Set cursor to position [Ps, Ps]. supported
CHT Cursor Horizontal Tabulation CSI Ps I Move cursor Ps times tabs forward (default=1). supported
ED Erase In Display CSI Ps J Erase various parts of the viewport. more supported
DECSED Selective Erase In Display CSI ? Ps J Currently the same as ED. partly
EL Erase In Line CSI Ps K Erase various parts of the active row. more supported
DECSEL Selective Erase In Line CSI ? Ps K Currently the same as EL. partly
IL Insert Line CSI Ps L Insert Ps blank lines at active row (default=1). supported
DL Delete Line CSI Ps M Delete Ps lines at active row (default=1). supported
DCH Delete Character CSI Ps P Delete Ps characters in the active row (default=1). supported
SU Scroll Up CSI Ps S Scroll Ps lines up (default=1). supported
SD Scroll Down CSI Ps T Scroll Ps lines down (default=1). supported
SR Scroll Right CSI Ps SP A Scroll viewport Ps times to the right. unsupported
SCOSC Save Cursor CSI s Save cursor position, charmap and text attributes. partly
HPR Horizontal Position Relative CSI Ps a Same as CUF. supported
REP Repeat Preceding Character CSI Ps b Repeat preceding character Ps times (default=1). more supported
DA1 Primary Device Attributes CSI c Send primary device attributes. more supported
DA2 Secondary Device Attributes CSI > c Send primary device attributes. more supported
VPA Vertical Position Absolute CSI Ps d Move cursor to Ps-th row (default=1). supported
VPR Vertical Position Relative CSI Ps e Move cursor Ps times down (default=1). supported
HVP Horizontal and Vertical Position CSI Ps ; Ps f Same as CUP. supported
TBC Tab Clear CSI Ps g Clear tab stops at current position (0) or all (3) (default=0). supported
SM Set Mode CSI Pm h Set various terminal attributes. more partly
DECSET DEC Private Set Mode CSI ? Pm h Set various terminal attributes. more partly
RM Reset Mode CSI Pm l Set various terminal attributes. more partly
DECRST DEC Private Reset Mode CSI ? Pm l Reset various terminal attributes. more partly
SGR Select Graphic Rendition CSI Pm m Reset various text attributes. more partly
DSR Device Status Report CSI Ps n Request cursor position (CPR) with Ps = 6. supported
DECDSR DEC Device Status Report CSI ? Ps n Only CPR is supported (same as DSR). partly
DECSTR Soft Terminal Reset CSI ! p Reset several terminal attributes to initial state. more supported
DECSCUSR Set Cursor Style CSI Ps SP q Set cursor style. more supported
DECSTBM Set Top and Bottom Margin CSI Ps ; Ps r Set top and bottom margins of the viewport [top;bottom] (default = viewport size). more supported
DECIC Insert Columns CSI Ps ' } Insert Ps columns at cursor position. unsupported
DECDC Delete Columns CSI Ps ' ~ Delete Ps columns at cursor position. unsupported

Erase In Display

TODO: document different modes...

Erase In Line

TODO: document different modes...

Repeat Preceding Character

Has no effect if the sequence does not follow a printed character (NOOP for any other sequence in between). TODO: document character limitations due to xterm compliance

Primary Device Attributes

TODO: Describe response...

Secondary Device Attributes

TODO: Describe response...

Set Mode

TODO: Describe all supported attributes.

DEC Private Set Mode

TODO: Describe all supported attributes.

Reset Mode

TODO: Describe all supported attributes.

DEC Private Reset Mode

TODO: Describe all supported attributes.

Select Graphic Rendition

Detailed description goes here...

Soft Terminal Reset

There are two terminal reset sequences - RIS and DECSTR. While RIS performs almost a full terminal bootstrap, DECSTR only resets certain attributes. For most needs DECSTR should be sufficient. Attributes reset to default values:

  • TODO: list attributes here ...

Set Cursor Style

Supported cursor styles (note that most renderers dont implement the blink feature, thus will show the steady variant instead):

  • empty, 0 or 1: steady block
  • 2: blink block
  • 3: steady underline
  • 4: blink underline
  • 5: steady bar
  • 6: blink bar

Set Top and Bottom Margin

TODO: document specialties like dependent cursor commands and scrolling...

DCS

Mnemonic Name Sequence Short Description Status
SIXEL SIXEL Graphics DCS Ps ; Ps ; Ps ; q Pt ST Draw SIXEL image starting at cursor position. unsupported
DECRQSS Request Selection or Setting DCS $ q Pt ST Request several the terminal settings. more partly

Request Selection or Setting

Supported:

  • Graphic Rendition (SGR): DCS $ q m ST (always reporting 0m)
  • Top and Bottom Margins (DECSTBM): DCS $ q m ST
  • Cursor Style (DECSCUSR): DCS $ q SP q ST

ESC

Mnemonic Name Sequence Short Description Status
SC Save Cursor ESC 7 Save cursor position, charmap and text attributes. supported
RC Restore Cursor ESC 8 Restore cursor position, charmap and text attributes. supported
DECALN Screen Alignment Pattern ESC # 8 Fill viewport with a test pattern (E). supported
IND Index ESC D Move the cursor one line down scrolling if needed. supported
NEL Next Line ESC E Move the cursor to the beginning of the next row. supported
HTS Horizontal Tabulation Set ESC H Places a tab stop at the current cursor position. supported
IR Reverse Index ESC M Move the cursor one line up scrolling if needed. supported

OSC

Identifier Sequence Short Description Status
0 OSC 0 ; Pt BEL Set window title and icon name. more partly
1 OSC 1 ; Pt BEL Set icon name. unsupported
2 OSC 2 ; Pt BEL Set window title. more supported

Set Windows Title and Icon Name

Icon name is not supported. For Window Title see below.

Set Windows Title

xterm.js does not manipulate the title directly, instead exposes changes via the event Terminal.onTitleChange.

TODO

  • improve table sorting:
    • sort C0/C1 in byte order
    • sort OSC in numerical order
    • sort CSI/ESC/DCS in final byte order
  • references
Clone this wiki locally