blob: 4a4a65bca06cb37cf9a7d7e0280509087ec93305 [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
153!Escape cancels OSC, starts Escape
154PUSH "\e]Something\e9"
155 escape "9"
156
157!CAN cancels OSC, returns to normal mode
158PUSH "\e]12\x{18}AB"
159 text 0x41, 0x42
160
161!C0 in OSC interrupts and continues
162PUSH "\e]2;\nBye\x07"
Bram Moolenaarbe593bf2020-05-19 21:20:04 +0200163 osc [2 ""
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200164 control 10
Bram Moolenaarbe593bf2020-05-19 21:20:04 +0200165 osc "Bye"]
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200166
167!DCS BEL
168PUSH "\ePHello\x07"
Bram Moolenaarbe593bf2020-05-19 21:20:04 +0200169 dcs ["Hello"]
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200170
171!DCS ST (7bit)
172PUSH "\ePHello\e\\"
Bram Moolenaarbe593bf2020-05-19 21:20:04 +0200173 dcs ["Hello"]
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200174
175!DCS ST (8bit)
176PUSH "\x{90}Hello\x9c"
Bram Moolenaarbe593bf2020-05-19 21:20:04 +0200177 dcs ["Hello"]
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200178
179!Escape cancels DCS, starts Escape
180PUSH "\ePSomething\e9"
181 escape "9"
182
183!CAN cancels DCS, returns to normal mode
184PUSH "\eP12\x{18}AB"
185 text 0x41, 0x42
186
187!C0 in OSC interrupts and continues
188PUSH "\ePBy\ne\x07"
Bram Moolenaarbe593bf2020-05-19 21:20:04 +0200189 dcs ["By"
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200190 control 10
Bram Moolenaarbe593bf2020-05-19 21:20:04 +0200191 dcs "e"]
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200192
193!NUL ignored
194PUSH "\x{00}"
195
196!NUL ignored within CSI
197PUSH "\e[12\x{00}3m"
198 csi 0x6d 123
199
200!DEL ignored
201PUSH "\x{7f}"
202
203!DEL ignored within CSI
204PUSH "\e[12\x{7f}3m"
205 csi 0x6d 123
206
207!DEL inside text"
208PUSH "AB\x{7f}C"
209 text 0x41,0x42
210 text 0x43