^[control-codes live in libghostty-vt

ANSI modes

The 22 modes ECMA-48 numbers, set with CSI Pm h and reset with CSI Pm l (SM and RM), each named by a number with no ? in front. ECMA-48 calls the first state of each the reset state and recommends it as the default.

Most of them are for block-mode terminals, which edit a screen locally and send it to the host, or for devices that handle bidirectional text, and DEC’s terminals took up only four: KAM, IRM, SRM and LNM. xterm and libghostty-vt take the same four and ignore the rest, but answer differently when DECRQM asks about them: xterm reports most of them as permanently reset, as the VT510 does, and libghostty-vt as not recognized.

The modes with a ?, which DEC and xterm defined, are the private modes.

1 GATMGuarded Area Transfer Mode CSI 1 h …
2 KAMKeyboard Action Mode CSI 2 h …
3 CRMControl Representation Mode CSI 3 h …
4 IRMInsertion Replacement Mode CSI 4 h …
5 SRTMStatus Report Transfer Mode CSI 5 h …
6 ERMErasure Mode CSI 6 h …
7 VEMLine Editing Mode CSI 7 h …
8 BDSMBi-directional Support Mode CSI 8 h …
9 DCSMDevice Component Select Mode CSI 9 h …
10 HEMCharacter Editing Mode CSI 10 h …
11 PUMPositioning Unit Mode CSI 11 h …
12 SRMSend/Receive Mode CSI 12 h …
13 FEAMFormat Effector Action Mode CSI 13 h …
14 FETMFormat Effector Transfer Mode CSI 14 h …
15 MATMMultiple Area Transfer Mode CSI 15 h …
16 TTMTransfer Termination Mode CSI 16 h …
17 SATMSelected Area Transfer Mode CSI 17 h …
18 TSMTabulation Stop Mode CSI 18 h …
19 EBMEditing Boundary Mode CSI 19 h …
20 LNMLine Feed/New Line Mode CSI 20 h …
21 GRCMGraphic Rendition Combination Mode CSI 21 h …
22 ZDMZero Default Mode CSI 22 h …
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.