# The Rest of ECMA-48

> The ECMA-48 control functions that terminals do not use, grouped by what they were for.

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](https://archive.org/details/bitsavers_decstandar0VideoSystemsReferenceManualDec91_74264381/page/n124/mode/1up)),
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](https://control-codes.page/csi/sl/index.html.md), which it
implements, and [SIMD](https://control-codes.page/csi/simd/index.html.md), 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.

| § | Function | p. |
| --- | --- | --- |
| 8.3.1 | [ACK](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n46/mode/1up), Acknowledge | 33 |
| 8.3.33 | [DLE](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n52/mode/1up), Data Link Escape | 39 |
| 8.3.42 | [EM](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n55/mode/1up), End Of Medium | 42 |
| 8.3.45 | [EOT](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n56/mode/1up), End Of Transmission | 43 |
| 8.3.49 | [ETB](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n56/mode/1up), End Of Transmission Block | 43 |
| 8.3.50 | [ETX](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n56/mode/1up), End Of Text | 43 |
| 8.3.84 | [NAK](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n63/mode/1up), Negative Acknowledge | 50 |
| 8.3.127 | [SOH](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n78/mode/1up), Start Of Heading | 65 |
| 8.3.146 | [STX](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n84/mode/1up), Start Of Text | 71 |
| 8.3.150 | [SYN](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n85/mode/1up), Synchronous Idle | 72 |

## 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.

| § | Function | p. |
| --- | --- | --- |
| 8.3.29 | [DC2](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n51/mode/1up), Device Control Two | 38 |
| 8.3.31 | [DC4](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n52/mode/1up), Device Control Four | 39 |
| 8.3.69 | [IS1](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n61/mode/1up), Information Separator One (US, Unit Separator) | 48 |
| 8.3.70 | [IS2](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n61/mode/1up), Information Separator Two (RS, Record Separator) | 48 |
| 8.3.71 | [IS3](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n61/mode/1up), Information Separator Three (GS, Group Separator) | 48 |
| 8.3.72 | [IS4](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n61/mode/1up), 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](https://control-codes.page/csi/da/index.html.md) request.

| § | Function | p. |
| --- | --- | --- |
| 8.3.11 | [CMD](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n47/mode/1up), Coding Method Delimiter | 34 |
| 8.3.100 | [PU1](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n67/mode/1up), Private Use One | 54 |
| 8.3.101 | [PU2](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n67/mode/1up), Private Use Two | 54 |
| 8.3.109 | [SCI](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n71/mode/1up), Single Character Introducer | 58 |

## 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.

| § | Function | p. |
| --- | --- | --- |
| 8.3.8 | [CCH](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n47/mode/1up), Cancel Character | 34 |
| 8.3.34 | [DMI](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n52/mode/1up), Disable Manual Input | 39 |
| 8.3.43 | [EMI](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n55/mode/1up), Enable Manual Input | 42 |
| 8.3.52 | [FNK](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n57/mode/1up), Function Key | 44 |
| 8.3.68 | [INT](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n61/mode/1up), Interrupt | 48 |
| 8.3.83 | [MW](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n63/mode/1up), Message Waiting | 50 |
| 8.3.145 | [STS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n84/mode/1up), Set Transmit State | 71 |

## 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](https://control-codes.page/esc/spa/index.html.md).

| § | Function | p. |
| --- | --- | --- |
| 8.3.25 | [DAQ](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n50/mode/1up), Define Area Qualification | 37 |
| 8.3.37 | [EA](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n53/mode/1up), Erase In Area | 40 |
| 8.3.40 | [EF](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n54/mode/1up), Erase In Field | 41 |
| 8.3.47 | [ESA](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n56/mode/1up), End Of Selected Area | 43 |
| 8.3.115 | [SEE](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n73/mode/1up), Select Editing Extent | 60 |
| 8.3.138 | [SSA](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n82/mode/1up), Start Of Selected Area | 69 |

## 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.

| § | Function | p. |
| --- | --- | --- |
| 8.3.4 | [BPH](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n46/mode/1up), Break Permitted Here | 33 |
| 8.3.36 | [DTA](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n53/mode/1up), Dimension Text Area | 40 |
| 8.3.73 | [JFY](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n61/mode/1up), Justify | 48 |
| 8.3.85 | [NBH](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n63/mode/1up), No Break Here | 50 |
| 8.3.91 | [PFS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n65/mode/1up), Page Format Selection | 52 |
| 8.3.92 | [PLD](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n65/mode/1up), Partial Line Forward | 52 |
| 8.3.93 | [PLU](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n66/mode/1up), Partial Line Backward | 53 |
| 8.3.102 | [QUAD](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n68/mode/1up), Quad | 55 |
| 8.3.116 | [SEF](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n73/mode/1up), Sheet Eject And Feed | 60 |
| 8.3.122 | [SLH](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n77/mode/1up), Set Line Home | 64 |
| 8.3.123 | [SLL](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n77/mode/1up), Set Line Limit | 64 |
| 8.3.124 | [SLS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n77/mode/1up), Set Line Spacing | 64 |
| 8.3.131 | [SPH](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n80/mode/1up), Set Page Home | 67 |
| 8.3.132 | [SPI](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n80/mode/1up), Spacing Increment | 67 |
| 8.3.133 | [SPL](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n81/mode/1up), Set Page Limit | 68 |
| 8.3.134 | [SPQR](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n81/mode/1up), Select Print Quality And Rapidity | 68 |
| 8.3.139 | [SSU](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n82/mode/1up), Select Size Unit | 69 |
| 8.3.149 | [SVS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n84/mode/1up), Select Line Spacing | 71 |

## 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.

| § | Function | p. |
| --- | --- | --- |
| 8.3.53 | [FNT](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n57/mode/1up), Font Selection | 44 |
| 8.3.54 | [GCC](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n57/mode/1up), Graphic Character Combination | 44 |
| 8.3.55 | [GSM](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n58/mode/1up), Graphic Size Modification | 45 |
| 8.3.56 | [GSS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n58/mode/1up), Graphic Size Selection | 45 |
| 8.3.65 | [IDCS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n60/mode/1up), Identify Device Control String | 47 |
| 8.3.66 | [IGS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n60/mode/1up), Identify Graphic Subrepertoire | 47 |
| 8.3.90 | [PEC](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n64/mode/1up), Presentation Expand Or Contract | 51 |
| 8.3.107 | [SACS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n69/mode/1up), Set Additional Character Separation | 56 |
| 8.3.108 | [SAPV](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n70/mode/1up), Select Alternative Presentation Variants | 57 |
| 8.3.110 | [SCO](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n71/mode/1up), Select Character Orientation | 58 |
| 8.3.112 | [SCS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n72/mode/1up), Set Character Spacing | 59 |
| 8.3.118 | [SHS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n76/mode/1up), Select Character Spacing | 63 |
| 8.3.136 | [SRCS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n81/mode/1up), Set Reduced Character Separation | 68 |
| 8.3.140 | [SSW](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n83/mode/1up), Set Space Width | 70 |
| 8.3.157 | [TSS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n86/mode/1up), Thin Space Specification | 73 |

## 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](https://control-codes.page/c0/ht/index.html.md), [CHT](https://control-codes.page/csi/cht/index.html.md), [HTS](https://control-codes.page/esc/hts/index.html.md), [TBC](https://control-codes.page/csi/tbc/index.html.md) and [CTC](https://control-codes.page/csi/ctc/index.html.md) use.

| § | Function | p. |
| --- | --- | --- |
| 8.3.23 | [CVT](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n50/mode/1up), Cursor Line Tabulation | 37 |
| 8.3.61 | [HTJ](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n59/mode/1up), Character Tabulation With Justification | 46 |
| 8.3.144 | [STAB](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n84/mode/1up), Selective Tabulation | 71 |
| 8.3.151 | [TAC](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n85/mode/1up), Tabulation Aligned Centred | 72 |
| 8.3.152 | [TALE](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n85/mode/1up), Tabulation Aligned Leading Edge | 72 |
| 8.3.153 | [TATE](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n85/mode/1up), Tabulation Aligned Trailing Edge | 72 |
| 8.3.155 | [TCC](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n86/mode/1up), Tabulation Centred On Character | 73 |
| 8.3.156 | [TSR](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n86/mode/1up), Tabulation Stop Remove | 73 |
| 8.3.162 | [VTS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n87/mode/1up), Line Tabulation Set | 74 |

## 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](https://control-codes.page/csi/simd/index.html.md).

| § | Function | p. |
| --- | --- | --- |
| 8.3.99 | [PTX](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n66/mode/1up), Parallel Texts | 53 |
| 8.3.111 | [SCP](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n71/mode/1up), Select Character Path | 58 |
| 8.3.114 | [SDS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n72/mode/1up), Start Directed String | 59 |
| 8.3.130 | [SPD](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n79/mode/1up), Select Presentation Directions | 66 |
| 8.3.137 | [SRS](https://archive.org/details/ecma-48-5th-edition-june-1991/page/n82/mode/1up), Start Reversed String | 69 |

## Validation

### CAT-1: Transmission controls are ignored

Input, one step per line:

```text
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
```

Expected screen:

```text
|AB______|
cursor 1,3
```

### CAT-2: So are the independent functions

Input, one step per line:

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

Expected screen:

```text
|AB______|
```

### CAT-3: And the unused C1 controls

Input, one step per line:

```text
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
```

Expected screen:

```text
|AB______|
```

### CAT-4: The control sequences without an intermediate

Input, one step per line:

```text
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
```

Expected screen:

```text
|AB______|
cursor 1,3
```

### CAT-5: And those with a space

Input, one step per line:

```text
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
```

Expected screen:

```text
|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`](https://github.com/ThomasDickey/xterm-snapshots/blob/xterm-411a/VTPrsTbl.c#L577-L618),
[`csi_sp_table`](https://github.com/ThomasDickey/xterm-snapshots/blob/xterm-411a/VTPrsTbl.c#L1859-L1910)),
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`](https://github.com/ThomasDickey/xterm-snapshots/blob/xterm-411a/charproc.c#L3982-L3990)).

---

This is the Markdown version of <https://control-codes.page/catalog/>. On that page every validation case runs live in libghostty-vt, the terminal emulation core of Ghostty, compiled to WebAssembly.

The validation cases are written in the notation described in <https://control-codes.page/notation/index.html.md>.
