Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 1 | INIT |
| 2 | UTF8 0 |
| 3 | WANTPARSER |
| 4 | |
| 5 | !Basic text |
| 6 | PUSH "hello" |
| 7 | text 0x68, 0x65, 0x6c, 0x6c, 0x6f |
| 8 | |
| 9 | !C0 |
| 10 | PUSH "\x03" |
| 11 | control 3 |
| 12 | |
| 13 | PUSH "\x1f" |
| 14 | control 0x1f |
| 15 | |
| 16 | !C1 8bit |
| 17 | PUSH "\x83" |
| 18 | control 0x83 |
| 19 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 20 | PUSH "\x99" |
| 21 | control 0x99 |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 22 | |
| 23 | !C1 7bit |
| 24 | PUSH "\e\x43" |
| 25 | control 0x83 |
| 26 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 27 | PUSH "\e\x59" |
| 28 | control 0x99 |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 29 | |
| 30 | !High bytes |
| 31 | PUSH "\xa0\xcc\xfe" |
| 32 | text 0xa0, 0xcc, 0xfe |
| 33 | |
| 34 | !Mixed |
| 35 | PUSH "1\n2" |
| 36 | text 0x31 |
| 37 | control 10 |
| 38 | text 0x32 |
| 39 | |
| 40 | !Escape |
| 41 | PUSH "\e=" |
| 42 | escape "=" |
| 43 | |
| 44 | !Escape 2-byte |
| 45 | PUSH "\e(X" |
| 46 | escape "(X" |
| 47 | |
| 48 | !Split write Escape |
| 49 | PUSH "\e(" |
| 50 | PUSH "Y" |
| 51 | escape "(Y" |
| 52 | |
| 53 | !Escape cancels Escape, starts another |
| 54 | PUSH "\e(\e)Z" |
| 55 | escape ")Z" |
| 56 | |
| 57 | !CAN cancels Escape, returns to normal mode |
| 58 | PUSH "\e(\x{18}AB" |
| 59 | text 0x41, 0x42 |
| 60 | |
| 61 | !C0 in Escape interrupts and continues |
| 62 | PUSH "\e(\nX" |
| 63 | control 10 |
| 64 | escape "(X" |
| 65 | |
| 66 | !CSI 0 args |
| 67 | PUSH "\e[a" |
| 68 | csi 0x61 * |
| 69 | |
| 70 | !CSI 1 arg |
| 71 | PUSH "\e[9b" |
| 72 | csi 0x62 9 |
| 73 | |
| 74 | !CSI 2 args |
| 75 | PUSH "\e[3;4c" |
| 76 | csi 0x63 3,4 |
| 77 | |
| 78 | !CSI 1 arg 1 sub |
| 79 | PUSH "\e[1:2c" |
| 80 | csi 0x63 1+,2 |
| 81 | |
| 82 | !CSI many digits |
| 83 | PUSH "\e[678d" |
| 84 | csi 0x64 678 |
| 85 | |
| 86 | !CSI leading zero |
| 87 | PUSH "\e[007e" |
| 88 | csi 0x65 7 |
| 89 | |
| 90 | !CSI qmark |
| 91 | PUSH "\e[?2;7f" |
| 92 | csi 0x66 L=3f 2,7 |
| 93 | |
| 94 | !CSI greater |
| 95 | PUSH "\e[>c" |
| 96 | csi 0x63 L=3e * |
| 97 | |
| 98 | !CSI SP |
| 99 | PUSH "\e[12 q" |
| 100 | csi 0x71 12 I=20 |
| 101 | |
| 102 | !Mixed CSI |
| 103 | PUSH "A\e[8mB" |
| 104 | text 0x41 |
| 105 | csi 0x6d 8 |
| 106 | text 0x42 |
| 107 | |
| 108 | !Split write |
| 109 | PUSH "\e" |
| 110 | PUSH "[a" |
| 111 | csi 0x61 * |
| 112 | PUSH "foo\e[" |
| 113 | text 0x66, 0x6f, 0x6f |
| 114 | PUSH "4b" |
| 115 | csi 0x62 4 |
| 116 | PUSH "\e[12;" |
| 117 | PUSH "3c" |
| 118 | csi 0x63 12,3 |
| 119 | |
| 120 | !Escape cancels CSI, starts Escape |
| 121 | PUSH "\e[123\e9" |
| 122 | escape "9" |
| 123 | |
| 124 | !CAN cancels CSI, returns to normal mode |
| 125 | PUSH "\e[12\x{18}AB" |
| 126 | text 0x41, 0x42 |
| 127 | |
| 128 | !C0 in Escape interrupts and continues |
| 129 | PUSH "\e[12\n;3X" |
| 130 | control 10 |
| 131 | csi 0x58 12,3 |
| 132 | |
| 133 | !OSC BEL |
| 134 | PUSH "\e]1;Hello\x07" |
Bram Moolenaar | be593bf | 2020-05-19 21:20:04 +0200 | [diff] [blame] | 135 | osc [1 "Hello"] |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 136 | |
| 137 | !OSC ST (7bit) |
| 138 | PUSH "\e]1;Hello\e\\" |
Bram Moolenaar | be593bf | 2020-05-19 21:20:04 +0200 | [diff] [blame] | 139 | osc [1 "Hello"] |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 140 | |
| 141 | !OSC ST (8bit) |
| 142 | PUSH "\x{9d}1;Hello\x9c" |
Bram Moolenaar | be593bf | 2020-05-19 21:20:04 +0200 | [diff] [blame] | 143 | osc [1 "Hello"] |
| 144 | |
| 145 | !OSC in parts |
| 146 | PUSH "\e]52;abc" |
| 147 | osc [52 "abc" |
| 148 | PUSH "def" |
| 149 | osc "def" |
| 150 | PUSH "ghi\e\\" |
| 151 | osc "ghi"] |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 152 | |
Bram Moolenaar | 83a5253 | 2020-05-20 19:30:19 +0200 | [diff] [blame] | 153 | !OSC BEL without semicolon |
| 154 | PUSH "\e]1234\x07" |
| 155 | osc [1234 ] |
| 156 | |
| 157 | !OSC ST without semicolon |
| 158 | PUSH "\e]1234\e\\" |
| 159 | osc [1234 ] |
| 160 | |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 161 | !Escape cancels OSC, starts Escape |
| 162 | PUSH "\e]Something\e9" |
| 163 | escape "9" |
| 164 | |
| 165 | !CAN cancels OSC, returns to normal mode |
| 166 | PUSH "\e]12\x{18}AB" |
| 167 | text 0x41, 0x42 |
| 168 | |
| 169 | !C0 in OSC interrupts and continues |
| 170 | PUSH "\e]2;\nBye\x07" |
Bram Moolenaar | be593bf | 2020-05-19 21:20:04 +0200 | [diff] [blame] | 171 | osc [2 "" |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 172 | control 10 |
Bram Moolenaar | be593bf | 2020-05-19 21:20:04 +0200 | [diff] [blame] | 173 | osc "Bye"] |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 174 | |
| 175 | !DCS BEL |
| 176 | PUSH "\ePHello\x07" |
Bram Moolenaar | be593bf | 2020-05-19 21:20:04 +0200 | [diff] [blame] | 177 | dcs ["Hello"] |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 178 | |
| 179 | !DCS ST (7bit) |
| 180 | PUSH "\ePHello\e\\" |
Bram Moolenaar | be593bf | 2020-05-19 21:20:04 +0200 | [diff] [blame] | 181 | dcs ["Hello"] |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 182 | |
| 183 | !DCS ST (8bit) |
| 184 | PUSH "\x{90}Hello\x9c" |
Bram Moolenaar | be593bf | 2020-05-19 21:20:04 +0200 | [diff] [blame] | 185 | dcs ["Hello"] |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 186 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 187 | !Split write of 7bit ST |
| 188 | PUSH "\ePABC\e" |
| 189 | dcs ["ABC" |
| 190 | PUSH "\\" |
| 191 | dcs ] |
| 192 | |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 193 | !Escape cancels DCS, starts Escape |
| 194 | PUSH "\ePSomething\e9" |
| 195 | escape "9" |
| 196 | |
| 197 | !CAN cancels DCS, returns to normal mode |
| 198 | PUSH "\eP12\x{18}AB" |
| 199 | text 0x41, 0x42 |
| 200 | |
| 201 | !C0 in OSC interrupts and continues |
| 202 | PUSH "\ePBy\ne\x07" |
Bram Moolenaar | be593bf | 2020-05-19 21:20:04 +0200 | [diff] [blame] | 203 | dcs ["By" |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 204 | control 10 |
Bram Moolenaar | be593bf | 2020-05-19 21:20:04 +0200 | [diff] [blame] | 205 | dcs "e"] |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 206 | |
Bram Moolenaar | 7da3415 | 2021-11-24 19:30:55 +0000 | [diff] [blame] | 207 | !APC BEL |
| 208 | PUSH "\e_Hello\x07" |
| 209 | apc ["Hello"] |
| 210 | |
| 211 | !APC ST (7bit) |
| 212 | PUSH "\e_Hello\e\\" |
| 213 | apc ["Hello"] |
| 214 | |
| 215 | !APC ST (8bit) |
| 216 | PUSH "\x{9f}Hello\x9c" |
| 217 | apc ["Hello"] |
| 218 | |
| 219 | !PM BEL |
| 220 | PUSH "\e^Hello\x07" |
| 221 | pm ["Hello"] |
| 222 | |
| 223 | !PM ST (7bit) |
| 224 | PUSH "\e^Hello\e\\" |
| 225 | pm ["Hello"] |
| 226 | |
| 227 | !PM ST (8bit) |
| 228 | PUSH "\x{9e}Hello\x9c" |
| 229 | pm ["Hello"] |
| 230 | |
| 231 | !SOS BEL |
| 232 | PUSH "\eXHello\x07" |
| 233 | sos ["Hello"] |
| 234 | |
| 235 | !SOS ST (7bit) |
| 236 | PUSH "\eXHello\e\\" |
| 237 | sos ["Hello"] |
| 238 | |
| 239 | !SOS ST (8bit) |
| 240 | PUSH "\x{98}Hello\x9c" |
| 241 | sos ["Hello"] |
| 242 | |
| 243 | !SOS can contain any C0 or C1 code |
| 244 | PUSH "\eXABC\x01DEF\e\\" |
| 245 | sos ["ABC\x01DEF"] |
| 246 | PUSH "\eXABC\x99DEF\e\\" |
| 247 | sos ["ABC\x{99}DEF"] |
| 248 | |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 249 | !NUL ignored |
| 250 | PUSH "\x{00}" |
| 251 | |
| 252 | !NUL ignored within CSI |
| 253 | PUSH "\e[12\x{00}3m" |
| 254 | csi 0x6d 123 |
| 255 | |
| 256 | !DEL ignored |
| 257 | PUSH "\x{7f}" |
| 258 | |
| 259 | !DEL ignored within CSI |
| 260 | PUSH "\e[12\x{7f}3m" |
| 261 | csi 0x6d 123 |
| 262 | |
| 263 | !DEL inside text" |
| 264 | PUSH "AB\x{7f}C" |
| 265 | text 0x41,0x42 |
| 266 | text 0x43 |