2021-01-09 13:05:19 +01:00
|
|
|
foot-ctlseqs(5)
|
|
|
|
|
|
|
|
|
|
# DESCRIPTION
|
|
|
|
|
|
|
|
|
|
This document describes all the control sequences supported by foot.
|
|
|
|
|
|
|
|
|
|
- CC0 - 7-bit control sequences
|
2021-01-09 18:04:42 +01:00
|
|
|
- CC1 - 8-bit control sequences (*not supported*)
|
2021-02-14 12:44:43 +01:00
|
|
|
- Sequences beginning with ESC
|
2021-01-09 16:05:42 +01:00
|
|
|
- CSI - Control Sequence Introducer
|
|
|
|
|
- OSC - Operating System Command
|
|
|
|
|
- DCS - Device Control String
|
2021-01-09 13:05:19 +01:00
|
|
|
|
|
|
|
|
# CC0 - 7-bit control sequences
|
|
|
|
|
|
|
|
|
|
[[ *Sequence*
|
|
|
|
|
:[ *Name*
|
|
|
|
|
:[ *Description*
|
|
|
|
|
| *\\a*
|
|
|
|
|
: BEL
|
2021-01-09 18:10:54 +01:00
|
|
|
: Depends on what *bell* in *foot.ini*(5) is set to.
|
2021-01-09 13:05:19 +01:00
|
|
|
| *\\b*
|
|
|
|
|
: BS
|
2021-01-09 16:05:42 +01:00
|
|
|
: Backspace; move the cursor left one step. Wrap if _bw_ is enabled.
|
2021-01-09 13:05:19 +01:00
|
|
|
| *\\t*
|
|
|
|
|
: HT
|
2021-01-09 16:05:42 +01:00
|
|
|
: Horizontal tab; move the cursor to the next tab stop.
|
2021-01-09 13:05:19 +01:00
|
|
|
| *\\n*
|
|
|
|
|
: LF
|
2021-01-09 16:05:42 +01:00
|
|
|
: Line feed; move the cursor down one step, or scroll content up if
|
2021-01-09 13:05:19 +01:00
|
|
|
at the bottom line.
|
|
|
|
|
| *\\v*
|
|
|
|
|
: VT
|
|
|
|
|
: Vertical tab; identical to _LF_.
|
|
|
|
|
| *\\f*
|
|
|
|
|
: FF
|
|
|
|
|
: Form feed; identical to _LF_.
|
|
|
|
|
| *\\r*
|
|
|
|
|
: CR
|
2021-01-09 18:11:19 +01:00
|
|
|
: Carriage ret; move the cursor to the leftmost column.
|
2021-01-09 13:05:19 +01:00
|
|
|
| *\\x0E*
|
|
|
|
|
: SS0
|
2021-01-09 16:05:42 +01:00
|
|
|
: Shift out; select the _G1_ character set.
|
2021-01-09 13:05:19 +01:00
|
|
|
| *\\x0F*
|
|
|
|
|
: SS1
|
2021-01-09 16:05:42 +01:00
|
|
|
: Shift in; select the _G0_ character set.
|
2021-01-09 13:05:19 +01:00
|
|
|
|
2021-01-09 16:05:42 +01:00
|
|
|
# CC1 - 8-bit control sequences
|
|
|
|
|
|
|
|
|
|
Foot does not support any CC1 control sequences.
|
|
|
|
|
|
2021-02-14 12:44:43 +01:00
|
|
|
# Sequences beginning with ESC
|
|
|
|
|
|
|
|
|
|
Note: this table excludes sequences where ESC is part of a 7-bit
|
|
|
|
|
equivalent to 8-bit C1 controls.
|
|
|
|
|
|
|
|
|
|
[[ *Sequence*
|
|
|
|
|
:[ *Name*
|
|
|
|
|
:[ *Origin*
|
|
|
|
|
:[ *Description*
|
|
|
|
|
| \\E 7
|
|
|
|
|
: DECSC
|
|
|
|
|
: VT100
|
|
|
|
|
: Save cursor position.
|
|
|
|
|
| \\E 8
|
|
|
|
|
: DECRC
|
|
|
|
|
: VT100
|
|
|
|
|
: Restore cursor position.
|
|
|
|
|
| \\E c
|
|
|
|
|
: RIS
|
|
|
|
|
: VT100
|
|
|
|
|
: Reset terminal to initial state.
|
|
|
|
|
| \\E D
|
|
|
|
|
: IND
|
|
|
|
|
: VT100
|
|
|
|
|
: Line feed; move the cursor down one step, or scroll content up if
|
|
|
|
|
at the bottom margin.
|
|
|
|
|
| \\E E
|
|
|
|
|
: NEL
|
|
|
|
|
: VT100
|
|
|
|
|
: Next line; move the cursor down one step, and to the first
|
|
|
|
|
column. Content is scrolled up if at the bottom line.
|
|
|
|
|
| \\E H
|
|
|
|
|
: HTS
|
|
|
|
|
: VT100
|
|
|
|
|
: Set one horizontal tab stop at the current position.
|
|
|
|
|
| \\E M
|
|
|
|
|
: RI
|
|
|
|
|
: VT100
|
|
|
|
|
: Reverse index; move the cursor up one step, or scroll content down
|
|
|
|
|
if at the top margin.
|
|
|
|
|
| \\E N
|
|
|
|
|
: SS2
|
|
|
|
|
: VT220
|
|
|
|
|
: Single shift G2; select the _G2_ character set.
|
|
|
|
|
| \\E O
|
|
|
|
|
: SS3
|
|
|
|
|
: VT220
|
|
|
|
|
: Single shift G3; select the _G3_ character set.
|
|
|
|
|
| \\E =
|
|
|
|
|
: DECKPAM
|
|
|
|
|
: VT100
|
|
|
|
|
: Switch keypad to _application_ mode.
|
|
|
|
|
| \\E >
|
|
|
|
|
: DECKPNM
|
|
|
|
|
: VT100
|
|
|
|
|
: Switch keypad to _numeric_ mode.
|
|
|
|
|
| \\E ( _C_
|
|
|
|
|
: SCS
|
|
|
|
|
: VT100
|
|
|
|
|
: Designate G0 character set. Supported values for _C_ are: *0* (_DEC
|
|
|
|
|
Special Character and Line Drawing Set_), and *B* (_USASCII_).
|
|
|
|
|
| \\E ) _C_
|
|
|
|
|
: SCS
|
|
|
|
|
: VT100
|
|
|
|
|
: Designate G1 character set. Same supported values for _C_ as in _G0_.
|
|
|
|
|
| \\E \* _C_
|
|
|
|
|
: SCS
|
|
|
|
|
: VT220
|
|
|
|
|
: Designate G2 character set. Same supported values for _C_ as in _G0_.
|
|
|
|
|
| \\E + _C_
|
|
|
|
|
: SCS
|
|
|
|
|
: VT220
|
|
|
|
|
: Designate G3 character set. Same supported values for _C_ as in _G0_.
|
|
|
|
|
|
2021-01-09 16:05:42 +01:00
|
|
|
# CSI
|
|
|
|
|
|
2021-02-14 10:27:20 +01:00
|
|
|
All sequences begin with *\\E[*, sometimes abbreviated _CSI_. Spaces
|
2021-01-09 18:11:31 +01:00
|
|
|
are used in the sequence strings to make them easier to read, but are
|
2021-02-14 10:27:20 +01:00
|
|
|
not actually part of the string. I.e. *\\E[ 1 m* is really *\\E1m*.
|
2021-01-09 16:05:42 +01:00
|
|
|
|
|
|
|
|
## SGR
|
|
|
|
|
|
2021-02-14 10:27:20 +01:00
|
|
|
All SGR sequences are on the form *\\E[ <N> m*, where _N_ is a decimal
|
2021-01-09 16:05:42 +01:00
|
|
|
number - the _parameter_. Multiple parameters can be combined in a
|
2021-02-14 10:27:20 +01:00
|
|
|
single CSI sequence by separating them with semicolons: *\\E[ 1;2;3
|
|
|
|
|
m*.
|
2021-01-09 16:05:42 +01:00
|
|
|
|
|
|
|
|
[[ *Sequence*
|
|
|
|
|
:[ *Description*
|
|
|
|
|
| 0
|
2021-01-09 18:29:12 +01:00
|
|
|
: Reset all attributes
|
2021-01-09 16:05:42 +01:00
|
|
|
| 1
|
|
|
|
|
: Bold
|
|
|
|
|
| 2
|
|
|
|
|
: Dim
|
|
|
|
|
| 3
|
|
|
|
|
: Italic
|
|
|
|
|
| 4
|
|
|
|
|
: Underline
|
|
|
|
|
| 5
|
|
|
|
|
: Blink
|
|
|
|
|
| 7
|
|
|
|
|
: Reverse video; swap foreground and background colors
|
|
|
|
|
| 8
|
2021-01-09 18:12:29 +01:00
|
|
|
: Conceal; text is not visible, but is copiable
|
2021-01-09 16:05:42 +01:00
|
|
|
| 9
|
|
|
|
|
: Crossed-out/strike
|
|
|
|
|
| 22
|
|
|
|
|
: Disable *bold* and *dim*
|
|
|
|
|
| 23
|
|
|
|
|
: Disable italic
|
|
|
|
|
| 24
|
|
|
|
|
: Disable underline
|
|
|
|
|
| 25
|
|
|
|
|
: Disable blink
|
|
|
|
|
| 27
|
|
|
|
|
: Disable reverse video
|
|
|
|
|
| 28
|
|
|
|
|
: Disable conceal
|
|
|
|
|
| 29
|
|
|
|
|
: Disable crossed-out
|
|
|
|
|
| 30-37
|
|
|
|
|
: Select foreground color (using *regularN* in *foot.ini*(5))
|
|
|
|
|
| 38
|
2021-01-09 18:29:12 +01:00
|
|
|
: See "indexed and RGB colors" below
|
2021-01-09 16:05:42 +01:00
|
|
|
| 39
|
|
|
|
|
: Use the default foreground color (*foreground* in *foot.ini*(5))
|
|
|
|
|
| 40-47
|
|
|
|
|
: Select background color (using *regularN* in *foot.ini*(5))
|
|
|
|
|
| 48
|
2021-01-09 18:29:12 +01:00
|
|
|
: See "indexed and RGB colors" below
|
2021-01-09 16:05:42 +01:00
|
|
|
| 49
|
|
|
|
|
: Use the default background color (*background* in *foot.ini*(5))
|
|
|
|
|
| 90-97
|
|
|
|
|
: Select foreground color (using *brightN* in *foot.ini*(5))
|
|
|
|
|
| 100-107
|
|
|
|
|
: Select background color (using *brightN* in *foot.ini*(5))
|
|
|
|
|
|
|
|
|
|
## Indexed and RGB colors (256-color palette and 24-bit colors)
|
|
|
|
|
|
|
|
|
|
Foot supports both the new sub-parameter based variants, and the older
|
|
|
|
|
parameter based variants for setting foreground and background colors.
|
|
|
|
|
|
|
|
|
|
Indexed colors:
|
|
|
|
|
|
2021-02-14 10:27:20 +01:00
|
|
|
- *\\E[ 38:5:<idx> m*
|
|
|
|
|
- *\\E[ 38;5;<idx> m*
|
2021-01-09 16:05:42 +01:00
|
|
|
|
|
|
|
|
RGB colors:
|
|
|
|
|
|
2021-02-14 10:27:20 +01:00
|
|
|
- *\\E[ 38:2:<cs>:<r>:<g>:<b> m*
|
|
|
|
|
- *\\E[ 38:2:<r>:<g>:<b> m*
|
|
|
|
|
- *\\E[ 38;2;<r>;<g>;<b> m*
|
2021-01-09 16:05:42 +01:00
|
|
|
|
|
|
|
|
The first variant is the "correct" one (and foot also recognizes, but
|
|
|
|
|
ignores, the optional _tolerance_ parameters).
|
|
|
|
|
|
|
|
|
|
The second one is allowed since many programs "forget" the color space
|
|
|
|
|
ID, _cs_.
|
|
|
|
|
|
|
|
|
|
The sub-parameter based variants are preferred, and what foot's
|
|
|
|
|
terminfo uses.
|
|
|
|
|
|
2021-02-09 08:15:23 +00:00
|
|
|
## Private Modes
|
2021-01-09 16:05:42 +01:00
|
|
|
|
2021-02-09 08:15:23 +00:00
|
|
|
There are several Boolean-like "modes" that affect certain aspects
|
|
|
|
|
of the terminal's behavior. These modes can be manipulated with the
|
|
|
|
|
following 4 escape sequences:
|
2021-01-09 16:05:42 +01:00
|
|
|
|
2021-02-09 08:15:23 +00:00
|
|
|
[[ *Sequence*
|
|
|
|
|
:[ *Name*
|
|
|
|
|
:[ *Description*
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E[ ? _Pm_ *h*
|
2021-02-09 08:15:23 +00:00
|
|
|
: DECSET
|
|
|
|
|
: Enable private mode
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E[ ? _Pm_ *l*
|
2021-02-09 08:15:23 +00:00
|
|
|
: DECRST
|
|
|
|
|
: Disable private mode
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E[ ? _Pm_ *s*
|
2021-02-09 08:15:23 +00:00
|
|
|
: XTSAVE
|
|
|
|
|
: Save private mode
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E[ ? _Pm_ *r*
|
2021-02-09 08:15:23 +00:00
|
|
|
: XTRESTORE
|
|
|
|
|
: Restore private mode
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The _Pm_ parameter in the above sequences denotes a numerical ID
|
|
|
|
|
that corresponds to one of the following modes:
|
|
|
|
|
|
|
|
|
|
[[ *Parameter*
|
|
|
|
|
:[ *Origin*
|
|
|
|
|
:[ *Description*
|
|
|
|
|
| 1
|
|
|
|
|
: VT100
|
|
|
|
|
: Cursor keys mode (DECCKM)
|
|
|
|
|
| 5
|
|
|
|
|
: VT100
|
|
|
|
|
: Reverse video (DECSCNM)
|
|
|
|
|
| 6
|
|
|
|
|
: VT100
|
|
|
|
|
: Origin mode (DECOM)
|
|
|
|
|
| 7
|
|
|
|
|
: VT100
|
|
|
|
|
: Auto-wrap mode (DECAWM)
|
|
|
|
|
| 12
|
|
|
|
|
: AT&T 610
|
|
|
|
|
: Cursor blink
|
|
|
|
|
| 25
|
|
|
|
|
: VT220
|
|
|
|
|
: Cursor visibility (DECTCEM)
|
|
|
|
|
| 45
|
|
|
|
|
: xterm
|
|
|
|
|
: Reverse-wraparound mode
|
2021-02-09 14:52:25 +00:00
|
|
|
| 47
|
|
|
|
|
: xterm
|
|
|
|
|
: Same as 1047 (see below)
|
2021-02-09 08:15:23 +00:00
|
|
|
| 1000
|
|
|
|
|
: xterm
|
|
|
|
|
: Send mouse x/y on button press/release
|
|
|
|
|
| 1001
|
|
|
|
|
: xterm
|
|
|
|
|
: Use hilite mouse tracking
|
|
|
|
|
| 1002
|
|
|
|
|
: xterm
|
|
|
|
|
: Use cell motion mouse tracking
|
|
|
|
|
| 1003
|
|
|
|
|
: xterm
|
|
|
|
|
: Use all motion mouse tracking
|
|
|
|
|
| 1004
|
|
|
|
|
: xterm
|
|
|
|
|
: Send FocusIn/FocusOut events
|
|
|
|
|
| 1006
|
|
|
|
|
: xterm
|
|
|
|
|
: SGR mouse mode
|
|
|
|
|
| 1007
|
|
|
|
|
: xterm
|
|
|
|
|
: Alternate scroll mode
|
|
|
|
|
| 1015
|
|
|
|
|
: urxvt
|
|
|
|
|
: urxvt mouse mode
|
|
|
|
|
| 1034
|
|
|
|
|
: xterm
|
|
|
|
|
: 8-bit Meta mode
|
|
|
|
|
| 1035
|
|
|
|
|
: xterm
|
|
|
|
|
: Num Lock modifier (see xterm numLock option)
|
|
|
|
|
| 1036
|
|
|
|
|
: xterm
|
|
|
|
|
: Send ESC when Meta modifies a key (see xterm metaSendsEscape option)
|
|
|
|
|
| 1042
|
|
|
|
|
: xterm
|
|
|
|
|
: Perform action for BEL character (see *bell* in *foot.ini*(5))
|
2021-02-09 14:52:25 +00:00
|
|
|
| 1047
|
|
|
|
|
: xterm
|
|
|
|
|
: Use alternate screen buffer
|
|
|
|
|
| 1048
|
|
|
|
|
: xterm
|
|
|
|
|
: Save/restore cursor (DECSET=save, DECRST=restore)
|
2021-02-09 08:15:23 +00:00
|
|
|
| 1049
|
|
|
|
|
: xterm
|
2021-02-09 14:52:25 +00:00
|
|
|
: Equivalent to 1048 and 1047 combined
|
2021-02-09 08:15:23 +00:00
|
|
|
| 2004
|
|
|
|
|
: xterm
|
|
|
|
|
: Wrap pasted text with start/end delimiters (bracketed paste mode)
|
|
|
|
|
| 737769
|
|
|
|
|
: foot
|
|
|
|
|
: Input Method Editor (IME) mode
|
2021-01-09 16:05:42 +01:00
|
|
|
|
|
|
|
|
## Other
|
|
|
|
|
|
|
|
|
|
*TODO*: all other CSI sequences that does not fall into any of the
|
|
|
|
|
above categories.
|
|
|
|
|
|
|
|
|
|
# OSC
|
|
|
|
|
|
2021-02-14 10:27:20 +01:00
|
|
|
All _OSC_ sequences begin with *\\E]*, sometimes abbreviated _OSC_.
|
2021-01-09 16:05:42 +01:00
|
|
|
|
2021-01-09 21:49:20 +01:00
|
|
|
[[ *Sequence*
|
2021-02-14 11:11:19 +01:00
|
|
|
:[ *Origin*
|
2021-01-09 21:49:20 +01:00
|
|
|
:[ *Description*
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 0 ; _Pt_ ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: xterm
|
2021-01-09 21:49:20 +01:00
|
|
|
: Set window icon and title to _Pt_ (foot does not support setting the
|
|
|
|
|
icon)
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 2 ; _Pt_ ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: xterm
|
2021-01-09 21:49:20 +01:00
|
|
|
: Set window title to _Pt_
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 4 ; _c_ ; _spec_ ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: xterm
|
2021-01-09 21:49:20 +01:00
|
|
|
: Change color number _c_ to _spec_, where _spec_ is a color in
|
|
|
|
|
*XParseColor* format. foot only supports RGB colors; either
|
|
|
|
|
*rgb:<red>/<green>/<blue>*, or the legacy format (*#rgb*).
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 7 ; _Uri_ ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: iTerm2
|
2021-01-09 21:49:20 +01:00
|
|
|
: Update the terminal's current working directory. Newly spawned
|
|
|
|
|
terminals will launch in this directory. _Uri_ must be on the format
|
|
|
|
|
*file://<hostname>/<path>*. *hostname* must refer to your local host.
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 10 ; _spec_ ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: xterm
|
2021-01-09 21:49:20 +01:00
|
|
|
: Change the default foreground color to _spec_, a color in
|
|
|
|
|
*XParseColor* format.
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 11 ; _spec_ ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: xterm
|
2021-01-09 21:49:20 +01:00
|
|
|
: Change the default background color to _spec_, a color in
|
|
|
|
|
*XParseColor* format.
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 12 ; _spec_ ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: xterm
|
2021-01-09 21:49:20 +01:00
|
|
|
: Change cursor color to _spec_, a color in *XParseColor* format.
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 52 ; _Pc_ ; ? ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: xterm
|
2021-01-09 21:49:20 +01:00
|
|
|
: Send clipboard data. _Pc_ can be either *c*, *s* or *p*. *c* uses
|
|
|
|
|
the clipboard as source, and *s* and *p* uses the primary
|
|
|
|
|
selection. The response is *OSC 52 ; Pc ; <base64-encoded data>*,
|
|
|
|
|
where _Pc_ indicates the source used.
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 52 ; _Pc_ ; _Pd_ ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: xterm
|
2021-01-09 21:49:20 +01:00
|
|
|
: Copy _Pd_ (base64 encoded text) to the clipboard. _Pc_ indicates the
|
|
|
|
|
target: *c* targets the clipboard and *s* and *p* the primary
|
|
|
|
|
selection.
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 104 [; _c_] ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: xterm
|
2021-01-09 21:49:20 +01:00
|
|
|
: Reset color number _c_, or all colors (excluding the default
|
|
|
|
|
foreground/background colors) if _c_ is omitted.
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 110 ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: xterm
|
2021-01-09 21:49:20 +01:00
|
|
|
: Reset default foreground color
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 111 ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: xterm
|
2021-01-09 21:49:20 +01:00
|
|
|
: Reset default background color
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 112 ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: xterm
|
2021-01-09 21:49:20 +01:00
|
|
|
: Reset cursor color
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\E] 555 ST
|
2021-02-14 11:11:19 +01:00
|
|
|
: foot
|
2021-01-09 21:49:20 +01:00
|
|
|
: Flash the entire terminal (foot extension)
|
2021-02-14 11:11:19 +01:00
|
|
|
| \\E] 777;notify;_title_;_msg_ ST
|
|
|
|
|
: urxvt
|
2021-01-09 21:49:20 +01:00
|
|
|
: Desktop notification, uses *notify* in *foot.ini*(5).
|
|
|
|
|
|
2021-01-09 16:05:42 +01:00
|
|
|
# DCS
|
|
|
|
|
|
2021-01-09 18:11:59 +01:00
|
|
|
All _DCS_ sequences begin with *\\EP* (from here denoted _DCS_), and
|
|
|
|
|
are terminated by *\\E\\* (ST).
|
2021-01-09 18:29:39 +01:00
|
|
|
|
|
|
|
|
[[ *Sequence*
|
|
|
|
|
:[ *Description*
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\EP q <sixel data> ST
|
2021-01-09 18:29:39 +01:00
|
|
|
: Emit a sixel image at the current cursor position
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\EP = 1 s ST
|
2021-01-09 18:29:39 +01:00
|
|
|
: Begin application synchronized updates
|
2021-02-14 10:27:20 +01:00
|
|
|
| \\EP = 2 s ST
|
2021-01-09 18:29:39 +01:00
|
|
|
: End application synchronized updates
|
|
|
|
|
|