1foot-ctlseqs(7)        Miscellaneous Information Manual        foot-ctlseqs(7)
2
3
4

NAME

6       foot-ctlseqs - terminal control sequences supported by foot
7

DESCRIPTION

9       This document describes all the control sequences supported by foot.
10
11       ·   Control characters
12       ·   Sequences beginning with ESC
13       ·   CSI - Control Sequence Introducer
14             - SGR
15             - Indexed and RGB colors (256-color palette and 24-bit colors)
16             - Private modes
17             - Window manipulation
18             - Other
19       ·   OSC - Operating System Command
20       ·   DCS - Device Control String
21
22

Control characters

24       ┌─────────┬──────┬─────────────────────┐
25Sequence Name Description         
26       ├─────────┼──────┼─────────────────────┤
27       │\a       │ BEL  │ Depends on what     │
28       │         │      │ bell in foot.ini(5)
29       │         │      │ is set to.          │
30       ├─────────┼──────┼─────────────────────┤
31       │\b       │ BS   │ Backspace; move the │
32       │         │      │ cursor left one     │
33       │         │      │ step. Wrap if bw is │
34       │         │      │ enabled.            │
35       ├─────────┼──────┼─────────────────────┤
36       │\t       │ HT   │ Horizontal tab;     │
37       │         │      │ move the cursor to  │
38       │         │      │ the next tab stop.  │
39       ├─────────┼──────┼─────────────────────┤
40       │\n       │ LF   │ Line feed; move the │
41       │         │      │ cursor down one     │
42       │         │      │ step, or scroll     │
43       │         │      │ content up if at    │
44       │         │      │ the bottom line.    │
45       ├─────────┼──────┼─────────────────────┤
46       │\v       │ VT   │ Vertical tab; iden‐ │
47       │         │      │ tical to LF.        │
48       ├─────────┼──────┼─────────────────────┤
49       │\f       │ FF   │ Form feed; identi‐  │
50       │         │      │ cal to LF.          │
51       ├─────────┼──────┼─────────────────────┤
52       │\r       │ CR   │ Carriage ret; move  │
53       │         │      │ the cursor to the   │
54       │         │      │ leftmost column.    │
55       ├─────────┼──────┼─────────────────────┤
56       │\x0E     │ SS0  │ Shift out; select   │
57       │         │      │ the G1 character    │
58       │         │      │ set.                │
59       ├─────────┼──────┼─────────────────────┤
60       │\x0F     │ SS1  │ Shift in; select    │
61       │         │      │ the G0 character    │
62       │         │      │ set.                │
63       └─────────┴──────┴─────────────────────┘
64

Sequences beginning with ESC

66       Note: this table excludes sequences where ESC is part of a 7-bit equiv‐
67       alent to 8-bit C1 controls.
68
69       ┌─────────┬─────────┬────────┬──────────────────┐
70Sequence Name    Origin Description      
71       ├─────────┼─────────┼────────┼──────────────────┤
72       │\E 7     │ DECSC   │ VT100  │ Save cursor      │
73       │         │         │        │ position.        │
74       ├─────────┼─────────┼────────┼──────────────────┤
75       │\E 8     │ DECRC   │ VT100  │ Restore cursor   │
76       │         │         │        │ position.        │
77       ├─────────┼─────────┼────────┼──────────────────┤
78       │\E c     │ RIS     │ VT100  │ Reset terminal   │
79       │         │         │        │ to initial       │
80       │         │         │        │ state.           │
81       ├─────────┼─────────┼────────┼──────────────────┤
82       │\E D     │ IND     │ VT100  │ Line feed; move  │
83       │         │         │        │ the cursor down  │
84       │         │         │        │ one step, or     │
85       │         │         │        │ scroll content   │
86       │         │         │        │ up if at the     │
87       │         │         │        │ bottom margin.   │
88       ├─────────┼─────────┼────────┼──────────────────┤
89       │\E E     │ NEL     │ VT100  │ Next line; move  │
90       │         │         │        │ the cursor down  │
91       │         │         │        │ one step, and to │
92       │         │         │        │ the first col‐   │
93       │         │         │        │ umn. Content is  │
94       │         │         │        │ scrolled up if   │
95       │         │         │        │ at the bottom    │
96       │         │         │        │ line.            │
97       ├─────────┼─────────┼────────┼──────────────────┤
98       │\E H     │ HTS     │ VT100  │ Set one horizon‐ │
99       │         │         │        │ tal tab stop at  │
100       │         │         │        │ the current      │
101       │         │         │        │ position.        │
102       ├─────────┼─────────┼────────┼──────────────────┤
103       │\E M     │ RI      │ VT100  │ Reverse index;   │
104       │         │         │        │ move the cursor  │
105       │         │         │        │ up one step, or  │
106       │         │         │        │ scroll content   │
107       │         │         │        │ down if at the   │
108       │         │         │        │ top margin.      │
109       ├─────────┼─────────┼────────┼──────────────────┤
110       │\E N     │ SS2     │ VT220  │ Single shift G2; │
111       │         │         │        │ select the G2
112       │         │         │        │ character set.   │
113       ├─────────┼─────────┼────────┼──────────────────┤
114       │\E O     │ SS3     │ VT220  │ Single shift G3; │
115       │         │         │        │ select the G3
116       │         │         │        │ character set.   │
117       ├─────────┼─────────┼────────┼──────────────────┤
118       │\E =     │ DECKPAM │ VT100  │ Switch keypad to │
119       │         │         │        │ application
120       │         │         │        │ mode.            │
121       ├─────────┼─────────┼────────┼──────────────────┤
122       │\E >     │ DECKPNM │ VT100  │ Switch keypad to │
123       │         │         │        │ numeric mode.    │
124       ├─────────┼─────────┼────────┼──────────────────┤
125       │\E ( C   │ SCS     │ VT100  │ Designate G0     │
126       │         │         │        │ character set.   │
127       │         │         │        │ Supported values │
128       │         │         │        │ for C are: 0     
129       │         │         │        │ (DEC Special     │
130       │         │         │        │ Character and    │
131       │         │         │        │ Line Drawing     │
132       │         │         │        │ Set), and B      
133       │         │         │        │ (USASCII).       │
134       ├─────────┼─────────┼────────┼──────────────────┤
135       │\E ) C   │ SCS     │ VT100  │ Designate G1     │
136       │         │         │        │ character set.   │
137       │         │         │        │ Same supported   │
138       │         │         │        │ values for C as  │
139       │         │         │        │ in G0.           │
140       ├─────────┼─────────┼────────┼──────────────────┤
141       │\E * C   │ SCS     │ VT220  │ Designate G2     │
142       │         │         │        │ character set.   │
143       │         │         │        │ Same supported   │
144       │         │         │        │ values for C as  │
145       │         │         │        │ in G0.           │
146       ├─────────┼─────────┼────────┼──────────────────┤
147       │\E + C   │ SCS     │ VT220  │ Designate G3     │
148       │         │         │        │ character set.   │
149       │         │         │        │ Same supported   │
150       │         │         │        │ values for C as  │
151       │         │         │        │ in G0.           │
152       └─────────┴─────────┴────────┴──────────────────┘
153

CSI

155       All sequences begin with \E[, sometimes abbreviated CSI. Spaces are
156       used in the sequence strings to make them easier to read, but are not
157       actually part of the string. I.e. \E[ 1 m is really \E[1m.
158
159   SGR
160       All SGR sequences are on the form \E[ <N> m, where N is a decimal num‐
161       ber - the parameter. Multiple parameters can be combined in a single
162       CSI sequence by separating them with semicolons: \E[ 1;2;3 m.
163
164       ┌─────────┬────────────────────────────┐
165Sequence Description                
166       ├─────────┼────────────────────────────┤
167       │0        │ Reset all attributes       │
168       ├─────────┼────────────────────────────┤
169       │1        │ Bold                       │
170       ├─────────┼────────────────────────────┤
171       │2        │ Dim                        │
172       ├─────────┼────────────────────────────┤
173       │3        │ Italic                     │
174       ├─────────┼────────────────────────────┤
175       │4        │ Underline                  │
176       ├─────────┼────────────────────────────┤
177       │5        │ Blink                      │
178       ├─────────┼────────────────────────────┤
179       │7        │ Reverse video; swap fore‐  │
180       │         │ ground and background col‐ │
181       │         │ ors                        │
182       ├─────────┼────────────────────────────┤
183       │8        │ Conceal; text is not visi‐ │
184       │         │ ble, but is copiable       │
185       ├─────────┼────────────────────────────┤
186       │9        │ Crossed-out/strike         │
187       ├─────────┼────────────────────────────┤
188       │22       │ Disable bold and dim       
189       ├─────────┼────────────────────────────┤
190       │23       │ Disable italic             │
191       ├─────────┼────────────────────────────┤
192       │24       │ Disable underline          │
193       ├─────────┼────────────────────────────┤
194       │25       │ Disable blink              │
195       ├─────────┼────────────────────────────┤
196       │27       │ Disable reverse video      │
197       ├─────────┼────────────────────────────┤
198       │28       │ Disable conceal            │
199       ├─────────┼────────────────────────────┤
200       │29       │ Disable crossed-out        │
201       ├─────────┼────────────────────────────┤
202       │30-37    │ Select foreground color    │
203       │         │ (using regularN in         │
204       │         │ foot.ini(5))               │
205       ├─────────┼────────────────────────────┤
206       │38       │ See "indexed and RGB col‐  │
207       │         │ ors" below                 │
208       ├─────────┼────────────────────────────┤
209       │39       │ Use the default foreground │
210       │         │ color (foreground in       │
211       │         │ foot.ini(5))               │
212       ├─────────┼────────────────────────────┤
213       │40-47    │ Select background color    │
214       │         │ (using regularN in         │
215       │         │ foot.ini(5))               │
216       ├─────────┼────────────────────────────┤
217       │48       │ See "indexed and RGB col‐  │
218       │         │ ors" below                 │
219       ├─────────┼────────────────────────────┤
220       │49       │ Use the default background │
221       │         │ color (background in       │
222       │         │ foot.ini(5))               │
223       ├─────────┼────────────────────────────┤
224       │90-97    │ Select foreground color    │
225       │         │ (using brightN in          │
226       │         │ foot.ini(5))               │
227       ├─────────┼────────────────────────────┤
228       │100-107  │ Select background color    │
229       │         │ (using brightN in          │
230       │         │ foot.ini(5))               │
231       └─────────┴────────────────────────────┘
232
233   Indexed and RGB colors (256-color palette and 24-bit colors)
234       Foot supports both the new sub-parameter based variants, and the older
235       parameter based variants for setting foreground and background colors.
236
237       Indexed colors:
238
239       ·   \E[ 38:5:<idx> m
240       ·   \E[ 38;5;<idx> m
241
242
243       RGB colors:
244
245       ·   \E[ 38:2:<cs>:<r>:<g>:<b> m
246       ·   \E[ 38:2:<r>:<g>:<b> m
247       ·   \E[ 38;2;<r>;<g>;<b> m
248
249
250       The first variant is the "correct" one (and foot also recognizes, but
251       ignores, the optional tolerance parameters).
252
253       The second one is allowed since many programs "forget" the color space
254       ID, cs.
255
256       The sub-parameter based variants are preferred, and what foot's ter‐
257       minfo uses.
258
259   Private Modes
260       There are several Boolean-like "modes" that affect certain aspects of
261       the terminal's behavior. These modes can be manipulated with the fol‐
262       lowing 4 escape sequences:
263
264       ┌───────────┬───────────┬─────────────────────┐
265Sequence   Name      Description         
266       ├───────────┼───────────┼─────────────────────┤
267       │\E[ ? Pm h │ DECSET    │ Enable private mode │
268       ├───────────┼───────────┼─────────────────────┤
269       │\E[ ? Pm l │ DECRST    │ Disable private     │
270       │           │           │ mode                │
271       ├───────────┼───────────┼─────────────────────┤
272       │\E[ ? Pm s │ XTSAVE    │ Save private mode   │
273       ├───────────┼───────────┼─────────────────────┤
274       │\E[ ? Pm r │ XTRESTORE │ Restore private     │
275       │           │           │ mode                │
276       └───────────┴───────────┴─────────────────────┘
277
278       The Pm parameter in the above sequences denotes a numerical ID that
279       corresponds to one of the following modes:
280
281       ┌──────────┬──────────┬─────────────────────┐
282Parameter Origin   Description         
283       ├──────────┼──────────┼─────────────────────┤
284       │1         │ VT100    │ Cursor keys mode    │
285       │          │          │ (DECCKM)            │
286       ├──────────┼──────────┼─────────────────────┤
287       │5         │ VT100    │ Reverse video (DEC‐ │
288       │          │          │ SCNM)               │
289       ├──────────┼──────────┼─────────────────────┤
290       │6         │ VT100    │ Origin mode (DECOM) │
291       ├──────────┼──────────┼─────────────────────┤
292       │7         │ VT100    │ Auto-wrap mode      │
293       │          │          │ (DECAWM)            │
294       ├──────────┼──────────┼─────────────────────┤
295       │12        │ AT&T 610 │ Cursor blink        │
296       ├──────────┼──────────┼─────────────────────┤
297       │25        │ VT220    │ Cursor visibility   │
298       │          │          │ (DECTCEM)           │
299       ├──────────┼──────────┼─────────────────────┤
300       │45        │ xterm    │ Reverse-wraparound  │
301       │          │          │ mode                │
302       ├──────────┼──────────┼─────────────────────┤
303       │47        │ xterm    │ Same as 1047 (see   │
304       │          │          │ below)              │
305       ├──────────┼──────────┼─────────────────────┤
306       │1000      │ xterm    │ Send mouse x/y on   │
307       │          │          │ button              │
308       │          │          │ press/release       │
309       ├──────────┼──────────┼─────────────────────┤
310       │1001      │ xterm    │ Use hilite mouse    │
311       │          │          │ tracking            │
312       ├──────────┼──────────┼─────────────────────┤
313       │1002      │ xterm    │ Use cell motion     │
314       │          │          │ mouse tracking      │
315       ├──────────┼──────────┼─────────────────────┤
316       │1003      │ xterm    │ Use all motion      │
317       │          │          │ mouse tracking      │
318       ├──────────┼──────────┼─────────────────────┤
319       │1004      │ xterm    │ Send FocusIn/Focu‐  │
320       │          │          │ sOut events         │
321       ├──────────┼──────────┼─────────────────────┤
322       │1006      │ xterm    │ SGR mouse mode      │
323       ├──────────┼──────────┼─────────────────────┤
324       │1007      │ xterm    │ Alternate scroll    │
325       │          │          │ mode                │
326       ├──────────┼──────────┼─────────────────────┤
327       │1015      │ urxvt    │ urxvt mouse mode    │
328       ├──────────┼──────────┼─────────────────────┤
329       │1034      │ xterm    │ 8-bit Meta mode     │
330       ├──────────┼──────────┼─────────────────────┤
331       │1035      │ xterm    │ Num Lock modifier   │
332       │          │          │ (see xterm numLock  │
333       │          │          │ option)             │
334       ├──────────┼──────────┼─────────────────────┤
335       │1036      │ xterm    │ Send ESC when Meta  │
336       │          │          │ modifies a key (see │
337       │          │          │ xterm metaSend‐     │
338       │          │          │ sEscape option)     │
339       ├──────────┼──────────┼─────────────────────┤
340       │1042      │ xterm    │ Perform action for  │
341       │          │          │ BEL character (see  │
342       │          │          │ bell in             │
343       │          │          │ foot.ini(5))        │
344       ├──────────┼──────────┼─────────────────────┤
345       │1047      │ xterm    │ Use alternate       │
346       │          │          │ screen buffer       │
347       ├──────────┼──────────┼─────────────────────┤
348       │1048      │ xterm    │ Save/restore cursor │
349       │          │          │ (DECSET=save,       │
350       │          │          │ DECRST=restore)     │
351       ├──────────┼──────────┼─────────────────────┤
352       │1049      │ xterm    │ Equivalent to 1048  │
353       │          │          │ and 1047 combined   │
354       ├──────────┼──────────┼─────────────────────┤
355       │1070      │ xterm    │ Use private color   │
356       │          │          │ registers for each  │
357       │          │          │ sixel               │
358       ├──────────┼──────────┼─────────────────────┤
359       │2004      │ xterm    │ Wrap pasted text    │
360       │          │          │ with start/end      │
361       │          │          │ delimiters (brack‐  │
362       │          │          │ eted paste mode)    │
363       ├──────────┼──────────┼─────────────────────┤
364       │8452      │ xterm    │ Position cursor to  │
365       │          │          │ the right of six‐   │
366       │          │          │ els, instead of on  │
367       │          │          │ the next line       │
368       ├──────────┼──────────┼─────────────────────┤
369       │737769    │ foot     │ Input Method Editor │
370       │          │          │ (IME) mode          │
371       └──────────┴──────────┴─────────────────────┘
372
373   Window manipulation
374       Foot implements a sub-set of XTerm's (originally dtterm's) window
375       manipulation sequences. The generic format is:
376
377       \E[ Ps ; Ps ; Ps t
378
379       ┌────────────┬─────────────┬─────────────────────┐
380Parameter 1 Parameter 2 Description         
381       ├────────────┼─────────────┼─────────────────────┤
382       │11          │ -           │ Report if window is │
383       │            │             │ iconified. Foot     │
384       │            │             │ always reports 1 -  │
385       │            │             │ not iconified.      │
386       ├────────────┼─────────────┼─────────────────────┤
387       │13          │ -           │ Report window posi‐ │
388       │            │             │ tion. Foot always   │
389       │            │             │ reports (0,0), due  │
390       │            │             │ to Wayland limita‐  │
391       │            │             │ tions.              │
392       ├────────────┼─────────────┼─────────────────────┤
393       │13          │ 2           │ Report text area    │
394       │            │             │ position. Foot      │
395       │            │             │ always reports      │
396       │            │             │ (0,0) due to Way‐   │
397       │            │             │ land limitations.   │
398       ├────────────┼─────────────┼─────────────────────┤
399       │14          │ -           │ Report text area    │
400       │            │             │ size, in pixels.    │
401       │            │             │ Foot reports the    │
402       │            │             │ grid size, exclud‐  │
403       │            │             │ ing the margins.    │
404       ├────────────┼─────────────┼─────────────────────┤
405       │14          │ 2           │ Report window size, │
406       │            │             │ in pixels. Foot     │
407       │            │             │ reports the grid    │
408       │            │             │ size plus the mar‐  │
409       │            │             │ gins.               │
410       ├────────────┼─────────────┼─────────────────────┤
411       │15          │ -           │ Report the screen   │
412       │            │             │ size, in pixels.    │
413       ├────────────┼─────────────┼─────────────────────┤
414       │16          │ -           │ Report the cell     │
415       │            │             │ size, in pixels.    │
416       ├────────────┼─────────────┼─────────────────────┤
417       │18          │ -           │ Report text area    │
418       │            │             │ size, in charac‐    │
419       │            │             │ ters.               │
420       ├────────────┼─────────────┼─────────────────────┤
421       │19          │ -           │ Report screen size, │
422       │            │             │ in characters.      │
423       ├────────────┼─────────────┼─────────────────────┤
424       │22          │ -           │ Push window         │
425       │            │             │ title+icon. Foot    │
426       │            │             │ does not support    │
427       │            │             │ pushing the icon.   │
428       ├────────────┼─────────────┼─────────────────────┤
429       │22          │ 2           │ Push window title.  │
430       ├────────────┼─────────────┼─────────────────────┤
431       │23          │ -           │ Pop window          │
432       │            │             │ title+icon. Foot    │
433       │            │             │ does not support    │
434       │            │             │ popping the icon.   │
435       ├────────────┼─────────────┼─────────────────────┤
436       │23          │ 2           │ Pop window title.   │
437       └────────────┴─────────────┴─────────────────────┘
438
439   Other
440       ┌────────────────┬──────────────┬────────────┬──────────────────┐
441Parameter       Name         Origin     Description      
442       ├────────────────┼──────────────┼────────────┼──────────────────┤
443       │\E[ Ps c        │ DA           │ VT100      │ Send primary     │
444       │                │              │            │ device           │
445       │                │              │            │ attributes. Foot │
446       │                │              │            │ responds with    │
447       │                │              │            │ "I'm a VT220     │
448       │                │              │            │ with sixel and   │
449       │                │              │            │ ANSI color sup‐  │
450       │                │              │            │ port".           │
451       ├────────────────┼──────────────┼────────────┼──────────────────┤
452       │\E[ Ps A        │ CUU          │ VT100      │ Cursor up - move │
453       │                │              │            │ cursor up Ps
454       │                │              │            │ times.           │
455       ├────────────────┼──────────────┼────────────┼──────────────────┤
456       │\E[ Ps B        │ CUD          │ VT100      │ Cursor down -    │
457       │                │              │            │ move cursor down │
458       │                │              │            │ Ps times.        │
459       ├────────────────┼──────────────┼────────────┼──────────────────┤
460       │\E[ Ps C        │ CUF          │ VT100      │ Cursor forward - │
461       │                │              │            │ move cursor to   │
462       │                │              │            │ the right Ps
463       │                │              │            │ times.           │
464       ├────────────────┼──────────────┼────────────┼──────────────────┤
465       │\E[ Ps D        │ CUB          │ VT100      │ Cursor backward  │
466       │                │              │            │ - move cursor to │
467       │                │              │            │ the left Ps
468       │                │              │            │ times.           │
469       ├────────────────┼──────────────┼────────────┼──────────────────┤
470       │\E[ Ps g        │ TBC          │ VT100      │ Tab clear. Ps=0  │
471       │                │              │            │ -> clear current │
472       │                │              │            │ column. Ps=3 ->  │
473       │                │              │            │ clear all.       │
474       ├────────────────┼──────────────┼────────────┼──────────────────┤
475       │\E[ Ps ; Ps f   │ HVP          │ VT100      │ Horizontal and   │
476       │                │              │            │ vertical posi‐   │
477       │                │              │            │ tion - move cur‐ │
478       │                │              │            │ sor to row ;     │
479       │                │              │            │ column.          │
480       ├────────────────┼──────────────┼────────────┼──────────────────┤
481       │\E[ Ps ; Ps H   │ CUP          │ VT100      │ Cursor position  │
482       │                │              │            │ - move cursor to │
483       │                │              │            │ row ; column.    │
484       ├────────────────┼──────────────┼────────────┼──────────────────┤
485       │\E[ Ps J        │ ED           │ VT100      │ Erase in dis‐    │
486       │                │              │            │ play. Ps=0 ->    │
487       │                │              │            │ below cursor.    │
488       │                │              │            │ Ps=1 -> above    │
489       ├────────────────┼──────────────┼────────────┼──────────────────┤
490       │\E[ Ps K        │ EL           │ VT100      │ Erase in line.   │
491       │                │              │            │ Ps=0 -> right of │
492       │                │              │            │ cursor. Ps=1 ->  │
493       │                │              │            │ left of cursor.  │
494       │                │              │            │ Ps=2 -> all.     │
495       ├────────────────┼──────────────┼────────────┼──────────────────┤
496       │\E[ Pm h        │ SM           │ VT100      │ Set mode. Pm=4   │
497       │                │              │            │ -> enable IRM    │
498       │                │              │            │ (insert mode).   │
499       │                │              │            │ All other values │
500       │                │              │            │ of Pm are unsup‐ │
501       │                │              │            │ ported.          │
502       ├────────────────┼──────────────┼────────────┼──────────────────┤
503       │\E[ Pm l        │ RM           │ VT100      │ Reset mode. Pm=4 │
504       │                │              │            │ -> disable IRM   │
505       │                │              │            │ (insert mode).   │
506       │                │              │            │ All other values │
507       │                │              │            │ of Pm are unsup‐ │
508       │                │              │            │ ported.          │
509       ├────────────────┼──────────────┼────────────┼──────────────────┤
510       │\E[ Ps n        │ DSR          │ VT100      │ Device status    │
511       │                │              │            │ report. Ps=5 ->  │
512       │                │              │            │ device status.   │
513       │                │              │            │ Ps=6 -> cursor   │
514       │                │              │            │ position.        │
515       ├────────────────┼──────────────┼────────────┼──────────────────┤
516       │\E[ Ps L        │ IL           │ VT220      │ Insert Ps lines. │
517       ├────────────────┼──────────────┼────────────┼──────────────────┤
518       │\E[ Ps M        │ DL           │ VT220      │ Delete Ps lines. │
519       ├────────────────┼──────────────┼────────────┼──────────────────┤
520       │\E[ Ps P        │ DCH          │ VT220      │ Delete Ps char‐  │
521       │                │              │            │ acters.          │
522       ├────────────────┼──────────────┼────────────┼──────────────────┤
523       │\E[ Ps @        │ ICH          │ VT220      │ Insert Ps blank  │
524       │                │              │            │ characters.      │
525       ├────────────────┼──────────────┼────────────┼──────────────────┤
526       │\E[ Ps X        │ ECH          │ VT220      │ Erase Ps charac‐ │
527       │                │              │            │ ters.            │
528       ├────────────────┼──────────────┼────────────┼──────────────────┤
529       │\E[ > c         │ DA2          │ VT220      │ Send secondary   │
530       │                │              │            │ device           │
531       │                │              │            │ attributes. Foot │
532       │                │              │            │ responds with    │
533       │                │              │            │ "I'm a VT220 and │
534       │                │              │            │ here's my ver‐   │
535       │                │              │            │ sion number".    │
536       ├────────────────┼──────────────┼────────────┼──────────────────┤
537       │\E[ ! p         │ DECSTR       │ VT220      │ Soft terminal    │
538       │                │              │            │ reset.           │
539       ├────────────────┼──────────────┼────────────┼──────────────────┤
540       │\E[ ? Ps $ p    │ DECRQM       │ VT320      │ Request DEC pri‐ │
541       │                │              │            │ vate mode.       │
542       ├────────────────┼──────────────┼────────────┼──────────────────┤
543       │\E[ Ps T        │ SD           │ VT420      │ Scroll down Ps
544       │                │              │            │ lines.           │
545       ├────────────────┼──────────────┼────────────┼──────────────────┤
546       │\E[ s           │ SCOSC        │ SCO, VT510 │ Save cursor      │
547       │                │              │            │ position.        │
548       ├────────────────┼──────────────┼────────────┼──────────────────┤
549       │\E[ u           │ SCORC        │ SCO, VT510 │ Restore cursor   │
550       │                │              │            │ position.        │
551       ├────────────────┼──────────────┼────────────┼──────────────────┤
552       │\E[ Ps SP q     │ DECSCUSR     │ VT510      │ Set cursor       │
553       │                │              │            │ style. In foot,  │
554       │                │              │            │ Ps=0 means "use  │
555       │                │              │            │ style from       │
556       │                │              │            │ foot.ini".       │
557       ├────────────────┼──────────────┼────────────┼──────────────────┤
558       │\E[ = Ps c      │ DA3          │ VT510      │ send tertiary    │
559       │                │              │            │ device           │
560       │                │              │            │ attributes. Foot │
561       │                │              │            │ responds with    │
562       │                │              │            │ "FOOT", in hexa‐ │
563       │                │              │            │ decimal.         │
564       ├────────────────┼──────────────┼────────────┼──────────────────┤
565       │\E[ Pm d        │ VPA          │ ECMA-48    │ Line position    │
566       │                │              │            │ absolute - move  │
567       │                │              │            │ cursor to line   │
568       │                │              │            │ Pm.              │
569       ├────────────────┼──────────────┼────────────┼──────────────────┤
570       │\E[ Pm e        │ VPR          │ ECMA-48    │ Line position    │
571       │                │              │            │ relative - move  │
572       │                │              │            │ cursor down Pm
573       │                │              │            │ lines.           │
574       ├────────────────┼──────────────┼────────────┼──────────────────┤
575       │\E[ Pm a        │ HPR          │ ECMA-48    │ Character posi‐  │
576       │                │              │            │ tion relative -  │
577       │                │              │            │ move cursor to   │
578       │                │              │            │ the right Pm
579       │                │              │            │ times.           │
580       ├────────────────┼──────────────┼────────────┼──────────────────┤
581       │\E[ Ps E        │ CNL          │ ECMA-48    │ Cursor next line │
582       │                │              │            │ - move the cur‐  │
583       │                │              │            │ sor down Ps
584       │                │              │            │ times.           │
585       ├────────────────┼──────────────┼────────────┼──────────────────┤
586       │\E[ Ps F        │ CPL          │ ECMA-48    │ Cursor preceding │
587       │                │              │            │ line  - move the │
588       │                │              │            │ cursor up Ps
589       │                │              │            │ times.           │
590       ├────────────────┼──────────────┼────────────┼──────────────────┤
591       │\E[ Pm `        │ HPA          │ ECMA-48    │ Character posi‐  │
592       │                │              │            │ tion absolute -  │
593       │                │              │            │ move cursor to   │
594       │                │              │            │ column Pm.       │
595       ├────────────────┼──────────────┼────────────┼──────────────────┤
596       │\E[ Ps G        │ CHA          │ ECMA-48    │ Cursor character │
597       │                │              │            │ absolute - move  │
598       │                │              │            │ cursor to column │
599       │                │              │            │ Ps. cursor. Ps=2 │
600       │                │              │            │ -> all. Ps=3 ->  │
601       │                │              │            │ saved lines.     │
602       ├────────────────┼──────────────┼────────────┼──────────────────┤
603       │\E[ Ps S        │ SU           │ ECMA-48    │ Scroll up Ps
604       │                │              │            │ lines.           │
605       ├────────────────┼──────────────┼────────────┼──────────────────┤
606       │\E[ Ps I        │ CHT          │ ECMA-48    │ Cursor forward   │
607       │                │              │            │ tabulation Ps
608       │                │              │            │ tab stops.       │
609       ├────────────────┼──────────────┼────────────┼──────────────────┤
610       │\E[ Ps Z        │ CBT          │ ECMA-48    │ Cursor backward  │
611       │                │              │            │ tabulation Ps
612       │                │              │            │ tab stops.       │
613       ├────────────────┼──────────────┼────────────┼──────────────────┤
614       │\E[ Ps b        │ REP          │ ECMA-48    │ Repeat the pre‐  │
615       │                │              │            │ ceding printable │
616       │                │              │            │ character Ps
617       │                │              │            │ times.           │
618       ├────────────────┼──────────────┼────────────┼──────────────────┤
619       │\E[ ? Pi ; Pa ; │ XTSMGRAPHICS │ xterm      │ Set or request   │
620Pv S            │              │            │ sixel            │
621       │                │              │            │ attributes.      │
622       └────────────────┴──────────────┴────────────┴──────────────────┘
623

OSC

625       All OSC sequences begin with \E], sometimes abbreviated OSC.
626
627       ┌─────────────────────┬────────────┬───────────────────────────┐
628Sequence             Origin     Description               
629       ├─────────────────────┼────────────┼───────────────────────────┤
630       │\E] 0 ; Pt \E\       │ xterm      │ Set window icon and       │
631       │                     │            │ title to Pt (foot         │
632       │                     │            │ does not support          │
633       │                     │            │ setting the icon)         │
634       ├─────────────────────┼────────────┼───────────────────────────┤
635       │\E] 2 ; Pt \E\       │ xterm      │ Set window title to       │
636       │                     │            │ Pt
637       ├─────────────────────┼────────────┼───────────────────────────┤
638       │\E] 4 ; c ; spec     │ xterm      │ Change color number       │
639       │\E\                  │            │ c to spec, where          │
640       │                     │            │ spec is a color in        │
641       │                     │            │ XParseColor format.       │
642       │                     │            │ foot only supports        │
643       │                     │            │ RGB colors; either        │
644       │                     │            │ rgb:<red>/<green>/<blue>, │
645       │                     │            │ or the legacy for‐        │
646       │                     │            │ mat (#rgb).               │
647       ├─────────────────────┼────────────┼───────────────────────────┤
648       │\E] 7 ; Uri \E\      │ iTerm2     │ Update the terminal's     │
649       │                     │            │ current working direc‐    │
650       │                     │            │ tory. Newly spawned ter‐  │
651       │                     │            │ minals will launch in     │
652       │                     │            │ this directory. Uri must  │
653       │                     │            │ be on the format          │
654       │                     │            │ file://<hostname>/<path>. │
655       │                     │            │ hostname must refer to    │
656       │                     │            │ your local host.          │
657       ├─────────────────────┼────────────┼───────────────────────────┤
658       │\E] 8 ; id=ID ; Uri  │ VTE+iTerm2 │ Hyperlink (a.k.a HTML-    │
659       │\E\                  │            │ like anchors). id is      │
660       │                     │            │ optional; if assigned,    │
661       │                     │            │ all URIs with the same ID 
662       │                     │            │ will be treated as a sin‐ │
663       │                     │            │ gle hyperlink. An empty   │
664       │                     │            │ URI closes the hyperlink. │
665       ├─────────────────────┼────────────┼───────────────────────────┤
666       │\E] 10 ; spec \E\    │ xterm      │ Change the default fore‐  │
667       │                     │            │ ground color to spec, a   │
668       │                     │            │ color in XParseColor for‐ │
669       │                     │            │ mat.                      │
670       ├─────────────────────┼────────────┼───────────────────────────┤
671       │\E] 11 ; spec \E\    │ xterm      │ Change the default back‐  │
672       │                     │            │ ground color to spec, a   │
673       │                     │            │ color in XParseColor for‐ │
674       │                     │            │ mat.                      │
675       ├─────────────────────┼────────────┼───────────────────────────┤
676       │\E] 12 ; spec \E\    │ xterm      │ Change cursor color to    │
677       │                     │            │ spec, a color in XParseC‐ 
678       │                     │            │ olor format.              │
679       ├─────────────────────┼────────────┼───────────────────────────┤
680       │\E] 52 ; Pc ; ? \E\  │ xterm      │ Send clipboard data. Pc
681       │                     │            │ can be either c, s or p.  │
682       │                     │            │ c uses the clipboard as   │
683       │                     │            │ source, and s and p uses  │
684       │                     │            │ the primary selection.    │
685       │                     │            │ The response is OSC 52 ;  
686       │                     │            │ Pc ; <base64-encoded      
687       │                     │            │ data>, where Pc indicates │
688       │                     │            │ the source used.          │
689       ├─────────────────────┼────────────┼───────────────────────────┤
690       │\E] 52 ; Pc ; Pd     │ xterm      │ Copy Pd (base64 encoded   │
691       │\E\                  │            │ text) to the clipboard.   │
692       │                     │            │ Pc indicates the target:  │
693       │                     │            │ c targets the clipboard   │
694       │                     │            │ and s and p the primary   │
695       │                     │            │ selection.                │
696       ├─────────────────────┼────────────┼───────────────────────────┤
697       │\E] 104 [; c] \E\    │ xterm      │ Reset color number c, or  │
698       │                     │            │ all colors (excluding the │
699       │                     │            │ default foreground/back‐  │
700       │                     │            │ ground colors) if c is    │
701       │                     │            │ omitted.                  │
702       ├─────────────────────┼────────────┼───────────────────────────┤
703       │\E] 110 \E\          │ xterm      │ Reset default foreground  │
704       │                     │            │ color                     │
705       ├─────────────────────┼────────────┼───────────────────────────┤
706       │\E] 111 \E\          │ xterm      │ Reset default background  │
707       │                     │            │ color                     │
708       ├─────────────────────┼────────────┼───────────────────────────┤
709       │\E] 112 \E\          │ xterm      │ Reset cursor color        │
710       ├─────────────────────┼────────────┼───────────────────────────┤
711       │\E] 555 \E\          │ foot       │ Flash the entire terminal │
712       │                     │            │ (foot extension)          │
713       ├─────────────────────┼────────────┼───────────────────────────┤
714       │\E]                  │ urxvt      │ Desktop notification,     │
715       │777;notify;title;msg │            │ uses notify in            │
716       │\E\                  │            │ foot.ini(5).              │
717       └─────────────────────┴────────────┴───────────────────────────┘
718

DCS

720       All DCS sequences begin with \EP (sometimes abbreviated DCS), and are
721       terminated by \E\ (ST).
722
723       ┌───────────────────────┬────────────────────────────┐
724Sequence               Description                
725       ├───────────────────────┼────────────────────────────┤
726       │\EP q <sixel data> \E\ │ Emit a sixel image at the  │
727       │                       │ current cursor position    │
728       ├───────────────────────┼────────────────────────────┤
729       │\EP = 1 s \E\          │ Begin application synchro‐ │
730       │                       │ nized updates              │
731       ├───────────────────────┼────────────────────────────┤
732       │\EP = 2 s \E\          │ End application synchro‐   │
733       │                       │ nized updates              │
734       └───────────────────────┴────────────────────────────┘
735

FOOTNOTE

737       Foot does not support 8-bit control characters ("CC1").
738
739
740
741                                  2021-03-28                   foot-ctlseqs(7)
Impressum