^[control-codes live in libghostty-vt

The Rest of ECMA-48

ECMA-48 defines 162 control functions. Every one that a terminal has a use for has its own page on this site. The other 80 are below, grouped by what they were for: data communications, printing and typesetting, forms, and right-to-left text, the jobs ECMA-48 was written to serve besides driving a screen. Each links to its definition in the standard.

None of them is defined by DEC STD 070 or the VT510 manual, and libghostty-vt implements none of them. It ignores them, as DEC STD 070 says a terminal should ignore any function it does not implement (§3.5.1.3, p. 3-20), and so does a default xterm, as the cases below show. Three that a default xterm does act on have pages of their own: SL and SR, which it implements, and SIMD, which it takes as Scroll Down. COVERAGE.md in the repository lists all 162 functions together.

Transmission control

These come from data communications, where a terminal and a computer exchanged blocks of text over a line and acknowledged them. They mark the start and end of headings, texts, blocks and transmissions, and carry the acknowledgements and idle fill between them. A terminal emulator’s connection to its program does its own framing, so none of them has anything to do.

§Functionp.
8.3.1ACK, Acknowledge33
8.3.33DLE, Data Link Escape39
8.3.42EM, End Of Medium42
8.3.45EOT, End Of Transmission43
8.3.49ETB, End Of Transmission Block43
8.3.50ETX, End Of Text43
8.3.84NAK, Negative Acknowledge50
8.3.127SOH, Start Of Heading65
8.3.146STX, Start Of Text71
8.3.150SYN, Synchronous Idle72

Device control and separators

DC2 and DC4 were for switching on and off an auxiliary device on the line; DC1 and DC3, their siblings, became XON and XOFF. The four information separators divide data into files, groups, records and units, for data that is not text to be shown.

§Functionp.
8.3.29DC2, Device Control Two38
8.3.31DC4, Device Control Four39
8.3.69IS1, Information Separator One (US, Unit Separator)48
8.3.70IS2, Information Separator Two (RS, Record Separator)48
8.3.71IS3, Information Separator Three (GS, Group Separator)48
8.3.72IS4, Information Separator Four (FS, File Separator)48

Code extension and private use

Ways of escaping into another coding system, or of introducing one character with a private meaning, and two controls reserved for private use. SCI’s 7-bit form, ESC Z, is the same as DEC’s DECID, which libghostty-vt answers as a Device Attributes request.

§Functionp.
8.3.11CMD, Coding Method Delimiter34
8.3.100PU1, Private Use One54
8.3.101PU2, Private Use Two54
8.3.109SCI, Single Character Introducer58

Input and messages

Controls for a device’s manual input, interrupting the other end, signalling a waiting message or a function key, and cancelling the character before.

§Functionp.
8.3.8CCH, Cancel Character34
8.3.34DMI, Disable Manual Input39
8.3.43EMI, Enable Manual Input42
8.3.52FNK, Function Key44
8.3.68INT, Interrupt48
8.3.83MW, Message Waiting50
8.3.145STS, Set Transmit State71

Areas and fields

For forms: dividing the screen into qualified areas and selected areas with their own rules, and erasing or editing within them. Guarded areas, the one part of this that terminals took up, have their own page under SPA.

§Functionp.
8.3.25DAQ, Define Area Qualification37
8.3.37EA, Erase In Area40
8.3.40EF, Erase In Field41
8.3.47ESA, End Of Selected Area43
8.3.115SEE, Select Editing Extent60
8.3.138SSA, Start Of Selected Area69

Page and line layout

For printers and typesetting: the size of the page and its text area, the home and limit positions of lines and pages, line spacing and partial line feeds, where lines may break, and how lines are justified and aligned.

§Functionp.
8.3.4BPH, Break Permitted Here33
8.3.36DTA, Dimension Text Area40
8.3.73JFY, Justify48
8.3.85NBH, No Break Here50
8.3.91PFS, Page Format Selection52
8.3.92PLD, Partial Line Forward52
8.3.93PLU, Partial Line Backward53
8.3.102QUAD, Quad55
8.3.116SEF, Sheet Eject And Feed60
8.3.122SLH, Set Line Home64
8.3.123SLL, Set Line Limit64
8.3.124SLS, Set Line Spacing64
8.3.131SPH, Set Page Home67
8.3.132SPI, Spacing Increment67
8.3.133SPL, Set Page Limit68
8.3.134SPQR, Select Print Quality And Rapidity68
8.3.139SSU, Select Size Unit69
8.3.149SVS, Select Line Spacing71

Character presentation

The size, spacing, font and orientation of characters, combining two characters into one, and alternative presentations of the same character. A character-cell terminal has one fixed cell size and one font, so there is nothing for these to change.

§Functionp.
8.3.53FNT, Font Selection44
8.3.54GCC, Graphic Character Combination44
8.3.55GSM, Graphic Size Modification45
8.3.56GSS, Graphic Size Selection45
8.3.65IDCS, Identify Device Control String47
8.3.66IGS, Identify Graphic Subrepertoire47
8.3.90PEC, Presentation Expand Or Contract51
8.3.107SACS, Set Additional Character Separation56
8.3.108SAPV, Select Alternative Presentation Variants57
8.3.110SCO, Select Character Orientation58
8.3.112SCS, Set Character Spacing59
8.3.118SHS, Select Character Spacing63
8.3.136SRCS, Set Reduced Character Separation68
8.3.140SSW, Set Space Width70
8.3.157TSS, Thin Space Specification73

Tabulation for typesetting

Line tabulation stops, and tab stops that align text on its leading edge, its trailing edge, its centre or a chosen character. Terminals keep only the plain character tab stops that HT, CHT, HTS, TBC and CTC use.

§Functionp.
8.3.23CVT, Cursor Line Tabulation37
8.3.61HTJ, Character Tabulation With Justification46
8.3.144STAB, Selective Tabulation71
8.3.151TAC, Tabulation Aligned Centred72
8.3.152TALE, Tabulation Aligned Leading Edge72
8.3.153TATE, Tabulation Aligned Trailing Edge72
8.3.155TCC, Tabulation Centred On Character73
8.3.156TSR, Tabulation Stop Remove73
8.3.162VTS, Line Tabulation Set74

Bidirectional and directed text

Text that runs right to left, or vertically, and strings whose direction is reversed or directed. SIMD, the last of this group, has its own page.

§Functionp.
8.3.99PTX, Parallel Texts53
8.3.111SCP, Select Character Path58
8.3.114SDS, Start Directed String59
8.3.130SPD, Select Presentation Directions66
8.3.137SRS, Start Reversed String69

Validation

CAT-1: Transmission controls are ignored

A
\x01\x02\x03\x04 # SOH STX ETX EOT
\x06\x10\x15\x16 # ACK DLE NAK SYN
\x17\x19          # ETB EM
\x12\x14\x1c\x1f # DC2 DC4 IS4 IS1
B
|AB______|
cursor 1,3

CAT-2: So are the independent functions

A
\e`\ea\eb\ed      # DMI INT EMI CMD
B
|AB______|

CAT-3: And the unused C1 controls

A
\eB\eC\eF\eG\eI   # BPH NBH SSA ESA HTJ
\eJ\eK\eL\eQ\eR   # VTS PLD PLU PU1 PU2
\eS\eT\eU\e[0[   # STS CCH MW SRS
B
|AB______|

CAT-4: The control sequences without an intermediate

A
\e[Y\e[O\e[N\e[o   # CVT EA EF DAQ
\e[Q\e[0[\e[\\\e[0]  # SEE SRS PTX SDS
B
|AB______|
cursor 1,3

CAT-5: And those with a space

A
\e[\sB\e[\sC\e[\sD\e[\sE\e[\sF\e[\sG\e[\sH  # GSM GSS FNT TSS JFY SPI QUAD
\e[\sI\e[\sJ\e[\sK\e[\sL\e[\sM\e[\sO      # SSU PFS SHS SVS IGS IDCS
\e[\sS\e[\sT\e[\sU\e[\sV\e[\sW\e[\sX\e[\sY  # SPD DTA SLH SLL FNK SPQR SEF
\e[\sZ\e[\s[\e[\s\\\e[\s]\e[\s^\e[\s_    # PEC SSW SACS SAPV STAB GCC
\e[\s`\e[\sa\e[\sb\e[\sc\e[\sd          # TATE TALE TAC TCC TSR
\e[\se\e[\sf\e[\sg\e[\sh\e[\si\e[\sj\e[\sk  # SCO SRCS SCS SLS SPH SPL SCP
B
|AB______|
cursor 1,3

A default xterm drops every one of these: its parse tables send them to the ground state without acting on them (csi_table, csi_sp_table), and so does libghostty-vt. The one escape sequence above that xterm can act on is ESC F, which moves the cursor to the lower left corner only when the hpLowerleftBugCompat resource is set for old HP-UX programs, and it is off by default (CASE_HP_BUGGY_LL).