Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 1 | Sequences documented in parens are implicit ones from parser.c, which move |
| 2 | between states. |
| 3 | |
| 4 | 1 = VT100 |
| 5 | 2 = VT220 |
| 6 | 3 = VT320 |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 7 | x = xterm |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 8 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 9 | C0 controls |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 10 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 11 | 123 0x00 = NUL |
| 12 | 123x 0x07 = BEL |
| 13 | 123x 0x08 = BS |
| 14 | 123x 0x09 = HT |
| 15 | 123x 0x0A = LF |
| 16 | 123x 0x0B = VT |
| 17 | 123x 0x0C = FF |
| 18 | 123x 0x0D = CR |
| 19 | 123x 0x0E = LS1 |
| 20 | 123x 0x0F = LS0 |
| 21 | (0x18 = CAN) |
| 22 | (0x1A = SUB) |
| 23 | (0x1B = ESC) |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 24 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 25 | 123 0x7f = DEL (ignored) |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 26 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 27 | C1 controls |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 28 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 29 | 123x 0x84 = IND |
| 30 | 123x 0x85 = NEL |
| 31 | 123x 0x88 = HTS |
| 32 | 123x 0x8D = RI |
| 33 | 23x 0x8E = SS2 |
| 34 | 23x 0x8F = SS3 |
| 35 | (0x90 = DCS) |
| 36 | (0x98 = SOS) |
| 37 | (0x9B = CSI) |
| 38 | (0x9C = ST) |
| 39 | (0x9D = OSC) |
| 40 | (0x9E = PM) |
| 41 | (0x9F = APC) |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 42 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 43 | Escape sequences |
| 44 | - excluding sequences that are C1 aliases |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 45 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 46 | 123x ESC ( = SCS, select character set G0 |
| 47 | 123x ESC ) = SCS, select character set G1 |
| 48 | 23x ESC * = SCS, select character set G2 |
| 49 | 23x ESC + = SCS, select character set G3 |
| 50 | 123x ESC 7 = DECSC - save cursor |
| 51 | 123x ESC 8 = DECRC - restore cursor |
| 52 | 123x ESC # 3 = DECDHL, double-height line (top half) |
| 53 | 123x ESC # 4 = DECDHL, double-height line (bottom half) |
| 54 | 123x ESC # 5 = DECSWL, single-width single-height line |
| 55 | 123x ESC # 6 = DECDWL, double-width single-height line |
| 56 | 123x ESC # 8 = DECALN |
| 57 | 123 ESC < = Ignored (used by VT100 to exit VT52 mode) |
| 58 | 123x ESC = = DECKPAM, keypad application mode |
| 59 | 123x ESC > = DECKPNM, keypad numeric mode |
| 60 | 23x ESC Sp F = S7C1T |
| 61 | 23x ESC Sp G = S8C1T |
| 62 | (ESC P = DCS) |
| 63 | (ESC X = SOS) |
| 64 | (ESC [ = CSI) |
| 65 | (ESC \ = ST) |
| 66 | (ESC ] = OSC) |
| 67 | (ESC ^ = PM) |
| 68 | (ESC _ = APC) |
| 69 | 123x ESC c = RIS, reset initial state |
| 70 | 3x ESC n = LS2 |
| 71 | 3x ESC o = LS3 |
| 72 | 3x ESC | = LS3R |
| 73 | 3x ESC } = LS2R |
| 74 | 3x ESC ~ = LS1R |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 75 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 76 | DCSes |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 77 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 78 | 3x DCS $ q ST = DECRQSS |
| 79 | 3x m = Request SGR |
| 80 | x Sp q = Request DECSCUSR |
| 81 | 3x " q = Request DECSCA |
| 82 | 3x r = Request DECSTBM |
| 83 | x s = Request DECSLRM |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 84 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 85 | CSIs |
| 86 | 23x CSI @ = ICH |
| 87 | 123x CSI A = CUU |
| 88 | 123x CSI B = CUD |
| 89 | 123x CSI C = CUF |
| 90 | 123x CSI D = CUB |
| 91 | x CSI E = CNL |
| 92 | x CSI F = CPL |
| 93 | x CSI G = CHA |
| 94 | 123x CSI H = CUP |
| 95 | x CSI I = CHT |
| 96 | 123x CSI J = ED |
| 97 | 23x CSI ? J = DECSED, selective erase in display |
| 98 | 123x CSI K = EL |
| 99 | 23x CSI ? K = DECSEL, selective erase in line |
| 100 | 23x CSI L = IL |
| 101 | 23x CSI M = DL |
| 102 | 23x CSI P = DCH |
| 103 | x CSI S = SU |
| 104 | x CSI T = SD |
| 105 | 23x CSI X = ECH |
| 106 | x CSI Z = CBT |
| 107 | x CSI ` = HPA |
| 108 | x CSI a = HPR |
| 109 | x CSI b = REP |
| 110 | 123x CSI c = DA, device attributes |
| 111 | 123 0 = DA |
| 112 | 23x CSI > c = DECSDA |
| 113 | 23 0 = SDA |
| 114 | x CSI d = VPA |
| 115 | x CSI e = VPR |
| 116 | 123x CSI f = HVP |
| 117 | 123x CSI g = TBC |
| 118 | 123x CSI h = SM, Set mode |
| 119 | 123x CSI ? h = DECSM, DEC set mode |
| 120 | CSI j = HPB |
| 121 | CSI k = VPB |
| 122 | 123x CSI l = RM, Reset mode |
| 123 | 123x CSI ? l = DECRM, DEC reset mode |
| 124 | 123x CSI m = SGR, Set Graphic Rendition |
Bram Moolenaar | 6a12d26 | 2022-10-16 19:26:52 +0100 | [diff] [blame] | 125 | CSI ? m = DECSGR, private Set Graphic Rendition |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 126 | 123x CSI n = DSR, Device Status Report |
| 127 | 23x 5 = operating status |
| 128 | 23x 6 = CPR = cursor position |
| 129 | 23x CSI ? n = DECDSR; behaves as DSR but uses CSI ? instead of CSI to respond |
| 130 | 23x CSI ! p = DECSTR, soft terminal reset |
| 131 | 3x CSI ? $ p = DECRQM, request private mode |
| 132 | x CSI Sp q = DECSCUSR (odd numbers blink, even numbers solid) |
| 133 | 1 or 2 = block |
| 134 | 3 or 4 = underline |
| 135 | 5 or 6 = I-beam to left |
Bram Moolenaar | 501e777 | 2022-10-16 14:35:46 +0100 | [diff] [blame] | 136 | x CSI > q = XTVERSION, request version string |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 137 | 23x CSI " q = DECSCA, select character attributes |
| 138 | 123x CSI r = DECSTBM |
| 139 | x CSI s = DECSLRM |
| 140 | x CSI ' } = DECIC |
| 141 | x CSI ' ~ = DECDC |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 142 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 143 | OSCs |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 144 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 145 | x OSC 0; = Set icon name and title |
| 146 | x OSC 1; = Set icon name |
| 147 | x OSC 2; = Set title |
| 148 | x OSC 52; = Selection management |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 149 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 150 | Standard modes |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 151 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 152 | 23x SM 4 = IRM |
| 153 | 123x SM 20 = NLM, linefeed/newline |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 154 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 155 | DEC modes |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 156 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 157 | 123x DECSM 1 = DECCKM, cursor keys |
| 158 | 123x DECSM 5 = DECSCNM, screen |
| 159 | 123x DECSM 6 = DECOM, origin |
| 160 | 123x DECSM 7 = DECAWM, autowrap |
| 161 | x DECSM 12 = Cursor blink |
| 162 | 23x DECSM 25 = DECTCEM, text cursor enable |
| 163 | x DECSM 69 = DECVSSM, vertical screen split |
| 164 | x DECSM 1000 = Mouse click/release tracking |
| 165 | x DECSM 1002 = Mouse click/release/drag tracking |
| 166 | x DECSM 1003 = Mouse all movements tracking |
| 167 | x DECSM 1004 = Focus in/out reporting |
| 168 | x DECSM 1005 = Mouse protocol extended (UTF-8) - not recommended |
| 169 | x DECSM 1006 = Mouse protocol SGR |
| 170 | x DECSM 1015 = Mouse protocol rxvt |
| 171 | x DECSM 1047 = Altscreen |
| 172 | x DECSM 1048 = Save cursor |
| 173 | x DECSM 1049 = 1047 + 1048 |
| 174 | x DECSM 2004 = Bracketed paste |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 175 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 176 | Graphic Renditions |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 177 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 178 | 123x SGR 0 = Reset |
| 179 | 123x SGR 1 = Bold on |
| 180 | x SGR 3 = Italic on |
| 181 | 123x SGR 4 = Underline single |
| 182 | SGR 4:x = Underline style |
| 183 | 123x SGR 5 = Blink on |
| 184 | 123x SGR 7 = Reverse on |
| 185 | x SGR 8 = Conceal on |
| 186 | x SGR 9 = Strikethrough on |
| 187 | SGR 10-19 = Select font |
| 188 | x SGR 21 = Underline double |
| 189 | 23x SGR 22 = Bold off |
| 190 | x SGR 23 = Italic off |
| 191 | 23x SGR 24 = Underline off |
| 192 | 23x SGR 25 = Blink off |
| 193 | 23x SGR 27 = Reverse off |
| 194 | x SGR 28 = Conceal off |
| 195 | x SGR 29 = Strikethrough off |
| 196 | x SGR 30-37 = Foreground ANSI |
| 197 | x SGR 38 = Foreground alternative palette |
| 198 | x SGR 39 = Foreground default |
| 199 | x SGR 40-47 = Background ANSI |
| 200 | x SGR 48 = Background alternative palette |
| 201 | x SGR 49 = Background default |
Bram Moolenaar | 6a12d26 | 2022-10-16 19:26:52 +0100 | [diff] [blame] | 202 | SGR 73 = Superscript on |
| 203 | SGR 74 = Subscript on |
| 204 | SGR 75 = Superscript/subscript off |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 205 | x SGR 90-97 = Foreground ANSI high-intensity |
| 206 | x SGR 100-107 = Background ANSI high-intensity |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 207 | |
| 208 | The state storage used by ESC 7 and DECSM 1048/1049 is shared. |
| 209 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 210 | Unimplemented sequences: |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 211 | |
| 212 | The following sequences are not recognised by libvterm. |
| 213 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 214 | 123x 0x05 = ENQ |
| 215 | 3 0x11 = DC1 (XON) |
| 216 | 3 0x13 = DC3 (XOFF) |
| 217 | x ESC % @ = Select default character set |
| 218 | x ESC % G = Select UTF-8 character set |
| 219 | x ESC 6 = DECBI, Back Index |
| 220 | 12 ESC Z = DECID, identify terminal |
| 221 | x DCS + Q = XTGETXRES, Request resource values |
| 222 | DCS $ q = [DECRQSS] |
| 223 | 3x " p = Request DECSCL |
| 224 | x t = Request DECSLPP |
| 225 | x $ | = Request DECSCPP |
| 226 | x * | = Request DECSLNS |
| 227 | 3 $ } = Request DECSASD |
| 228 | 3 $ ~ = Request DECSSDT |
| 229 | x DCS + p = XTSETTCAP, set termcap/terminfo data |
| 230 | x DCS + q = XTGETTCAP, request termcap/terminfo |
| 231 | 23 DCS { = DECDLD, down-line-loadable character set |
| 232 | 23x DCS | = DECUDK, user-defined key |
| 233 | x CSI Sp @ = Shift left columns |
| 234 | x CSI Sp A = Shift right columns |
| 235 | x CSI # P = XTPUSHCOLORS, push current dynamic colours to stack |
| 236 | x CSI # Q = XTPOPCOLORS, pop dynamic colours from stack |
| 237 | x CSI # R = XTREPORTCOLORS, report current entry on palette stack |
| 238 | x CSI ? S = XTSMGRAPHICS, set/request graphics attribute |
| 239 | x CSI > T = XTRMTITLE, reset title mode features |
| 240 | 23x CSI i = DEC printer control |
| 241 | x CSI > m = XTMODKEYS, set key modifier options |
| 242 | x CSI > n = (XTMODKEYS), reset key modifier options |
| 243 | x CSI $ p = DECRQM, request ANSI mode |
| 244 | 23x CSI " p = DECSCL, set compatibility level |
| 245 | x CSI > p = XTSMPOINTER, set resource value pointer mode |
| 246 | 1 x CSI q = DECLL, load LEDs |
| 247 | x CSI ? r = XTRESTORE, restore DEC private mode values |
| 248 | x CSI $ r = DECCARA, change attributes in rectangular area |
| 249 | x CSI > s = XTSHIFTESCAPE, set/reset shift-escape options |
| 250 | x CSI ? s = XTSAVE, save DEC private mode values |
| 251 | x CSI t = XTWINOPS, window operations |
| 252 | x CSI > t = XTSMTITLE, set title mode features |
| 253 | x CSI $ t = DECRARA, reset attributes in rectangular area |
| 254 | 3 CSI $ u = DECRQTSR, request terminal state report |
| 255 | 3 1 = terminal state report |
| 256 | 3 CSI & u = DECRQUPSS, request user-preferred supplemental set |
| 257 | x CSI $ v = DECCRA, copy rectangular area |
| 258 | 3x CSI $ w = DECRQPSR, request presentation state report |
| 259 | 3x 1 = cursor information report |
| 260 | 3x 2 = tab stop report |
| 261 | x CSI ' w = DECEFR, enable filter rectangle |
| 262 | 1 x CSI x = DECREQTPARM, request terminal parameters |
| 263 | x CSI * x = DECSACE, select attribute change extent |
| 264 | x CSI $ x = DECFRA, fill rectangular area |
| 265 | 123 CSI y = DECTST, invoke confidence test |
| 266 | x CSI $ z = DECERA, erase rectangular area |
| 267 | x CSI # { = XTPUSHSGR, push video attributes onto stack |
| 268 | x CSI $ { = DECSERA, selective erase in rectangular area |
| 269 | x CSI # | = XTREPORTSGR, report selected graphic rendition |
| 270 | x CSI $ | = DECSCPP, select columns per page |
| 271 | x CSI # } = XTPOPSGR, pop video attributes from stack |
| 272 | 3 CSI $ } = DECSASD, select active status display |
| 273 | 3 CSI $ ~ = DECSSDT, select status line type |
| 274 | 23 SM 2 = KAM, keyboard action |
| 275 | 123 SM 12 = SRM, send/receive |
| 276 | 123 DECSM 2 = DECANM, ANSI/VT52 |
| 277 | 123 DECSM 3 = DECCOLM, 132 column |
| 278 | 123 DECSM 4 = DECSCLM, scrolling |
| 279 | 123 DECSM 8 = DECARM, auto-repeat |
| 280 | 12 DECSM 9 = DECINLM, interlace |
| 281 | 23 DECSM 18 = DECPFF, print form feed |
| 282 | 23 DECSM 19 = DECPEX, print extent |
| 283 | 23 DECSM 42 = DECNRCM, national/multinational character |