blob: 0a21b927e6f98e920f15614b77aadfb8c8dda93d [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
20PUSH "\x9f"
21 control 0x9f
22
23!C1 7bit
24PUSH "\e\x43"
25 control 0x83
26
27PUSH "\e\x5f"
28 control 0x9f
29
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
187!Escape cancels DCS, starts Escape
188PUSH "\ePSomething\e9"
189 escape "9"
190
191!CAN cancels DCS, returns to normal mode
192PUSH "\eP12\x{18}AB"
193 text 0x41, 0x42
194
195!C0 in OSC interrupts and continues
196PUSH "\ePBy\ne\x07"
Bram Moolenaarbe593bf2020-05-19 21:20:04 +0200197 dcs ["By"
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200198 control 10
Bram Moolenaarbe593bf2020-05-19 21:20:04 +0200199 dcs "e"]
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200200
201!NUL ignored
202PUSH "\x{00}"
203
204!NUL ignored within CSI
205PUSH "\e[12\x{00}3m"
206 csi 0x6d 123
207
208!DEL ignored
209PUSH "\x{7f}"
210
211!DEL ignored within CSI
212PUSH "\e[12\x{7f}3m"
213 csi 0x6d 123
214
215!DEL inside text"
216PUSH "AB\x{7f}C"
217 text 0x41,0x42
218 text 0x43