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