From 38e2700f743f860981630d52431f23fa0af8e1a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 9 Jan 2021 13:05:19 +0100 Subject: [PATCH 01/30] doc: ctlseqs: document CC0 control sequences --- doc/foot-ctlseqs.5.scd | 45 ++++++++++++++++++++++++++++++++++++++++++ doc/meson.build | 3 ++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 doc/foot-ctlseqs.5.scd diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd new file mode 100644 index 00000000..c6add65e --- /dev/null +++ b/doc/foot-ctlseqs.5.scd @@ -0,0 +1,45 @@ +foot-ctlseqs(5) + +# DESCRIPTION + +This document describes all the control sequences supported by foot. + +- CC0 - 7-bit control sequences +- CSI +- OSC +- DCS + +# CC0 - 7-bit control sequences + +[[ *Sequence* +:[ *Name* +:[ *Description* +| *\\a* +: BEL +: Depends on what *bell* in *foot.ini*(5) +| *\\b* +: BS +: Backspace; moves the cursor left one step. Wraps is _bw_ is enabled. +| *\\t* +: HT +: Horizontal tab; moves the cursor to the next tab stop. +| *\\n* +: LF +: Line feed; moves the cursor down one step, or scrolls content up if + at the bottom line. +| *\\v* +: VT +: Vertical tab; identical to _LF_. +| *\\f* +: FF +: Form feed; identical to _LF_. +| *\\r* +: CR +: Carriage ret; moves the cursor to the left most column. +| *\\x0E* +: SS0 +: Shift out; selects the _G1_ character set. +| *\\x0F* +: SS1 +: Shift in; selects the _G0_ character set. + diff --git a/doc/meson.build b/doc/meson.build index 1f017db4..4d5c7118 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -5,7 +5,8 @@ scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true) foreach man_src : [{'name': 'foot', 'section' : 1}, {'name': 'foot.ini', 'section': 5}, - {'name': 'footclient', 'section': 1}] + {'name': 'footclient', 'section': 1}, + {'name': 'foot-ctlseqs', 'section': 5}] name = man_src['name'] section = man_src['section'] out = '@0@.@1@'.format(name, section) From 6594c398234c5138f0624bf549a7fd93973c781e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 9 Jan 2021 16:05:42 +0100 Subject: [PATCH 02/30] doc: ctlseqs: document SGRs, add TODOs --- doc/foot-ctlseqs.5.scd | 132 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 123 insertions(+), 9 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index c6add65e..ac88a2c5 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -5,9 +5,10 @@ foot-ctlseqs(5) This document describes all the control sequences supported by foot. - CC0 - 7-bit control sequences -- CSI -- OSC -- DCS +- CC1 - 8 bit control sequences (*not supported*) +- CSI - Control Sequence Introducer +- OSC - Operating System Command +- DCS - Device Control String # CC0 - 7-bit control sequences @@ -19,13 +20,13 @@ This document describes all the control sequences supported by foot. : Depends on what *bell* in *foot.ini*(5) | *\\b* : BS -: Backspace; moves the cursor left one step. Wraps is _bw_ is enabled. +: Backspace; move the cursor left one step. Wrap if _bw_ is enabled. | *\\t* : HT -: Horizontal tab; moves the cursor to the next tab stop. +: Horizontal tab; move the cursor to the next tab stop. | *\\n* : LF -: Line feed; moves the cursor down one step, or scrolls content up if +: Line feed; move the cursor down one step, or scroll content up if at the bottom line. | *\\v* : VT @@ -35,11 +36,124 @@ This document describes all the control sequences supported by foot. : Form feed; identical to _LF_. | *\\r* : CR -: Carriage ret; moves the cursor to the left most column. +: Carriage ret; move the cursor to the left most column. | *\\x0E* : SS0 -: Shift out; selects the _G1_ character set. +: Shift out; select the _G1_ character set. | *\\x0F* : SS1 -: Shift in; selects the _G0_ character set. +: Shift in; select the _G0_ character set. +# CC1 - 8-bit control sequences + +Foot does not support any CC1 control sequences. + +# CSI + +All sequences begin with *\E[*, denoted _CSI_ in the tables +below. Spaces are used in the sequence strings to make them easier to +read, but are not actually part of the string. I.e. *CSI 1 m* is +really *\E1m*. + +## SGR + +All SGR sequences are on the form *CSI m*, where _N_ is a decimal +number - the _parameter_. Multiple parameters can be combined in a +single CSI sequence by separating them with semicolons: *CSI 1;2;3 m* + +[[ *Sequence* +:[ *Description* +| 0 +: Reset all attributes. +| 1 +: Bold +| 2 +: Dim +| 3 +: Italic +| 4 +: Underline +| 5 +: Blink +| 7 +: Reverse video; swap foreground and background colors +| 8 +: Conceal; text is not visible, but is copyable +| 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 +: See indexed and RGB colors below +| 39 +: Use the default foreground color (*foreground* in *foot.ini*(5)) +| 40-47 +: Select background color (using *regularN* in *foot.ini*(5)) +| 48 +: See indexed and RGB colors below +| 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: + +- *CSI 38:5: m* +- *CSI 38;5; m* + +RGB colors: + +- *CSI 38:2:::: m* +- *CSI 38:2::: m* +- *CSI 38;2;;; m* + +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. + + +## DECSET/DECRST + +*TODO* + +## Other + +*TODO*: all other CSI sequences that does not fall into any of the +above categories. + +# OSC + +*TODO* +All _OSC_ sequences begin with *\E]*. + +# DCS + +*TODO* +All _DCS_ sequences begin with *\EP*, and are terminated by *\E\\* +(ST). From 634116e63726fc66cc1515f3420f1d3c8d86d996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 9 Jan 2021 18:03:16 +0100 Subject: [PATCH 03/30] doc: ctlseqs: escape backslashes --- doc/foot-ctlseqs.5.scd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index ac88a2c5..b42c4d50 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -50,10 +50,10 @@ Foot does not support any CC1 control sequences. # CSI -All sequences begin with *\E[*, denoted _CSI_ in the tables +All sequences begin with *\\E[*, denoted _CSI_ in the tables below. Spaces are used in the sequence strings to make them easier to read, but are not actually part of the string. I.e. *CSI 1 m* is -really *\E1m*. +really *\\E1m*. ## SGR @@ -150,10 +150,10 @@ above categories. # OSC *TODO* -All _OSC_ sequences begin with *\E]*. +All _OSC_ sequences begin with *\\E]*. # DCS *TODO* -All _DCS_ sequences begin with *\EP*, and are terminated by *\E\\* +All _DCS_ sequences begin with *\\EP*, and are terminated by *\\E\\* (ST). From 51900a5efb0c86f2ede38ee6dda11afc68e83c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 9 Jan 2021 18:04:42 +0100 Subject: [PATCH 04/30] =?UTF-8?q?doc:=20ctlseqs:=20be=20consistent;=20use?= =?UTF-8?q?=20dash=20between=20=E2=80=988=E2=80=99=20and=20=E2=80=98bit?= =?UTF-8?q?=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/foot-ctlseqs.5.scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index b42c4d50..cdd184ec 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -5,7 +5,7 @@ foot-ctlseqs(5) This document describes all the control sequences supported by foot. - CC0 - 7-bit control sequences -- CC1 - 8 bit control sequences (*not supported*) +- CC1 - 8-bit control sequences (*not supported*) - CSI - Control Sequence Introducer - OSC - Operating System Command - DCS - Device Control String From 59bee8016f6da8ae6c4d2d7ef4b52bd55d6e4bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 9 Jan 2021 18:10:54 +0100 Subject: [PATCH 05/30] doc: ctlseqs: fix weird sounding sentence --- doc/foot-ctlseqs.5.scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index cdd184ec..8956a57a 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -17,7 +17,7 @@ This document describes all the control sequences supported by foot. :[ *Description* | *\\a* : BEL -: Depends on what *bell* in *foot.ini*(5) +: Depends on what *bell* in *foot.ini*(5) is set to. | *\\b* : BS : Backspace; move the cursor left one step. Wrap if _bw_ is enabled. From 325bbf5e852f6bab1baa720bb97a148c2853dae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 9 Jan 2021 18:11:19 +0100 Subject: [PATCH 06/30] doc: ctlseqs: left most -> leftmost --- doc/foot-ctlseqs.5.scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 8956a57a..c1d10aa6 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -36,7 +36,7 @@ This document describes all the control sequences supported by foot. : Form feed; identical to _LF_. | *\\r* : CR -: Carriage ret; move the cursor to the left most column. +: Carriage ret; move the cursor to the leftmost column. | *\\x0E* : SS0 : Shift out; select the _G1_ character set. From 42cf196420bab141b58d0ca2b0fca77e6ca0ea02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 9 Jan 2021 18:11:31 +0100 Subject: [PATCH 07/30] =?UTF-8?q?doc:=20ctlseqs:=20we=20use=20=E2=80=98CSI?= =?UTF-8?q?=E2=80=99=20not=20so=20much=20in=20the=20tables=20as=20in=20tex?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/foot-ctlseqs.5.scd | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index c1d10aa6..06d8519e 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -50,10 +50,9 @@ Foot does not support any CC1 control sequences. # CSI -All sequences begin with *\\E[*, denoted _CSI_ in the tables -below. Spaces are used in the sequence strings to make them easier to -read, but are not actually part of the string. I.e. *CSI 1 m* is -really *\\E1m*. +All sequences begin with *\\E[*, from here on denoted _CSI_. Spaces +are used in the sequence strings to make them easier to read, but are +not actually part of the string. I.e. *CSI 1 m* is really *\\E1m*. ## SGR From e2f20071a57e289873b77f5c75ef6e89f5b48f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 9 Jan 2021 18:11:59 +0100 Subject: [PATCH 08/30] =?UTF-8?q?doc:=20ctlseqs:=20we=E2=80=99ll=20be=20us?= =?UTF-8?q?ing=20=E2=80=98OCS=E2=80=99=20instead=20of=20\E]=20and=20?= =?UTF-8?q?=E2=80=98DCS=E2=80=99=20instead=20of=20\EP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/foot-ctlseqs.5.scd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 06d8519e..258a3df0 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -149,10 +149,10 @@ above categories. # OSC *TODO* -All _OSC_ sequences begin with *\\E]*. +All _OSC_ sequences begin with *\\E]*, from here on denoted _OSC_. # DCS *TODO* -All _DCS_ sequences begin with *\\EP*, and are terminated by *\\E\\* -(ST). +All _DCS_ sequences begin with *\\EP* (from here denoted _DCS_), and +are terminated by *\\E\\* (ST). From be49c3c0a62379361dcc31a908acedf9dbf9f567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 9 Jan 2021 18:12:29 +0100 Subject: [PATCH 09/30] doc: ctlseqs: copyable -> copiable --- doc/foot-ctlseqs.5.scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 258a3df0..0fdcd402 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -77,7 +77,7 @@ single CSI sequence by separating them with semicolons: *CSI 1;2;3 m* | 7 : Reverse video; swap foreground and background colors | 8 -: Conceal; text is not visible, but is copyable +: Conceal; text is not visible, but is copiable | 9 : Crossed-out/strike | 22 From 33b4fcad9f5e80d487bf15bdbec3da65c0b45cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 9 Jan 2021 18:29:12 +0100 Subject: [PATCH 10/30] doc: ctlseqs: minor readability tweaks --- doc/foot-ctlseqs.5.scd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 0fdcd402..df9dc7dc 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -63,7 +63,7 @@ single CSI sequence by separating them with semicolons: *CSI 1;2;3 m* [[ *Sequence* :[ *Description* | 0 -: Reset all attributes. +: Reset all attributes | 1 : Bold | 2 @@ -97,13 +97,13 @@ single CSI sequence by separating them with semicolons: *CSI 1;2;3 m* | 30-37 : Select foreground color (using *regularN* in *foot.ini*(5)) | 38 -: See indexed and RGB colors below +: See "indexed and RGB colors" below | 39 : Use the default foreground color (*foreground* in *foot.ini*(5)) | 40-47 : Select background color (using *regularN* in *foot.ini*(5)) | 48 -: See indexed and RGB colors below +: See "indexed and RGB colors" below | 49 : Use the default background color (*background* in *foot.ini*(5)) | 90-97 From 7d16fb1bbdacd8f59bcb513b1a55b44c94f0d071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 9 Jan 2021 18:29:39 +0100 Subject: [PATCH 11/30] doc: ctlseqs: document supported DCS escapes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Eklöf --- doc/foot-ctlseqs.5.scd | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index df9dc7dc..775bde19 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -153,6 +153,15 @@ All _OSC_ sequences begin with *\\E]*, from here on denoted _OSC_. # DCS -*TODO* All _DCS_ sequences begin with *\\EP* (from here denoted _DCS_), and are terminated by *\\E\\* (ST). + +[[ *Sequence* +:[ *Description* +| DCS q ST +: Emit a sixel image at the current cursor position +| DCS = 1 s ST +: Begin application synchronized updates +| DCS = 2 s ST +: End application synchronized updates + From 26d9f5a3947e2f2c1fa38b2813386f42ac1c4d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 9 Jan 2021 21:49:20 +0100 Subject: [PATCH 12/30] doc: ctlseqs: document OSC sequences --- doc/foot-ctlseqs.5.scd | 47 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 775bde19..2446f8e5 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -148,9 +148,54 @@ above categories. # OSC -*TODO* All _OSC_ sequences begin with *\\E]*, from here on denoted _OSC_. +[[ *Sequence* +:[ *Description* +| OSC 0 ; _Pt_ ST +: Set window icon and title to _Pt_ (foot does not support setting the + icon) +| OSC 2 ; _Pt_ ST +: Set window title to _Pt_ +| OSC 4 ; _c_ ; _spec_ ST +: Change color number _c_ to _spec_, where _spec_ is a color in + *XParseColor* format. foot only supports RGB colors; either + *rgb://*, or the legacy format (*#rgb*). +| OSC 7 ; _Uri_ ST +: Update the terminal's current working directory. Newly spawned + terminals will launch in this directory. _Uri_ must be on the format + *file:///*. *hostname* must refer to your local host. +| OSC 10 ; _spec_ ST +: Change the default foreground color to _spec_, a color in + *XParseColor* format. +| OSC 11 ; _spec_ ST +: Change the default background color to _spec_, a color in + *XParseColor* format. +| OSC 12 ; _spec_ ST +: Change cursor color to _spec_, a color in *XParseColor* format. +| OSC 52 ; _Pc_ ; ? ST +: 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 ; *, + where _Pc_ indicates the source used. +| OSC 52 ; _Pc_ ; _Pd_ ST +: Copy _Pd_ (base64 encoded text) to the clipboard. _Pc_ indicates the + target: *c* targets the clipboard and *s* and *p* the primary + selection. +| OSC 104 [; _c_] ST +: Reset color number _c_, or all colors (excluding the default + foreground/background colors) if _c_ is omitted. +| OSC 110 ST +: Reset default foreground color +| OSC 111 ST +: Reset default background color +| OSC 112 ST +: Reset cursor color +| OSC 555 ST +: Flash the entire terminal (foot extension) +| OSC 777 ; notify ; _summary_ ; _message_ ST +: Desktop notification, uses *notify* in *foot.ini*(5). + # DCS All _DCS_ sequences begin with *\\EP* (from here denoted _DCS_), and From de64ef84104eaf8a82d4f97252c161491c379713 Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Tue, 9 Feb 2021 08:15:23 +0000 Subject: [PATCH 13/30] doc: ctlseqs: document DECSET/DECRST and supported "private modes" --- doc/foot-ctlseqs.5.scd | 95 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 2 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 2446f8e5..5d9bdab5 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -136,10 +136,101 @@ ID, _cs_. The sub-parameter based variants are preferred, and what foot's terminfo uses. +## Private Modes -## DECSET/DECRST +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: -*TODO* +[[ *Sequence* +:[ *Name* +:[ *Description* +| CSI ? _Pm_ *h* +: DECSET +: Enable private mode +| CSI ? _Pm_ *l* +: DECRST +: Disable private mode +| CSI ? _Pm_ *s* +: XTSAVE +: Save private mode +| CSI ? _Pm_ *r* +: 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 +| 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)) +| 1049 +: xterm +: Save cursor (like DECSC) and switch to alternate screen buffer +| 2004 +: xterm +: Wrap pasted text with start/end delimiters (bracketed paste mode) +| 737769 +: foot +: Input Method Editor (IME) mode ## Other From 56ab820d3f51fcd6dd441339d50e447735d7df93 Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Tue, 9 Feb 2021 14:52:25 +0000 Subject: [PATCH 14/30] doc: ctlseqs: document private modes 47, 1047 and 1048 --- doc/foot-ctlseqs.5.scd | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 5d9bdab5..aa552347 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -186,6 +186,9 @@ that corresponds to one of the following modes: | 45 : xterm : Reverse-wraparound mode +| 47 +: xterm +: Same as 1047 (see below) | 1000 : xterm : Send mouse x/y on button press/release @@ -222,9 +225,15 @@ that corresponds to one of the following modes: | 1042 : xterm : Perform action for BEL character (see *bell* in *foot.ini*(5)) +| 1047 +: xterm +: Use alternate screen buffer +| 1048 +: xterm +: Save/restore cursor (DECSET=save, DECRST=restore) | 1049 : xterm -: Save cursor (like DECSC) and switch to alternate screen buffer +: Equivalent to 1048 and 1047 combined | 2004 : xterm : Wrap pasted text with start/end delimiters (bracketed paste mode) From d74e62d65f9c0bfe80b4c3d01f4e9e225239e50b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 14 Feb 2021 10:27:20 +0100 Subject: [PATCH 15/30] doc: ctlseqs: always write out the actual sequence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That is, don’t abbreviate ‘\E[‘ with ‘CSI’, or ‘\E]’ with ‘OSC’. --- doc/foot-ctlseqs.5.scd | 65 +++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index aa552347..b4b8c611 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -50,15 +50,16 @@ Foot does not support any CC1 control sequences. # CSI -All sequences begin with *\\E[*, from here on denoted _CSI_. Spaces +All sequences begin with *\\E[*, sometimes abbreviated _CSI_. Spaces are used in the sequence strings to make them easier to read, but are -not actually part of the string. I.e. *CSI 1 m* is really *\\E1m*. +not actually part of the string. I.e. *\\E[ 1 m* is really *\\E1m*. ## SGR -All SGR sequences are on the form *CSI m*, where _N_ is a decimal +All SGR sequences are on the form *\\E[ m*, where _N_ is a decimal number - the _parameter_. Multiple parameters can be combined in a -single CSI sequence by separating them with semicolons: *CSI 1;2;3 m* +single CSI sequence by separating them with semicolons: *\\E[ 1;2;3 +m*. [[ *Sequence* :[ *Description* @@ -118,14 +119,14 @@ parameter based variants for setting foreground and background colors. Indexed colors: -- *CSI 38:5: m* -- *CSI 38;5; m* +- *\\E[ 38:5: m* +- *\\E[ 38;5; m* RGB colors: -- *CSI 38:2:::: m* -- *CSI 38:2::: m* -- *CSI 38;2;;; m* +- *\\E[ 38:2:::: m* +- *\\E[ 38:2::: m* +- *\\E[ 38;2;;; m* The first variant is the "correct" one (and foot also recognizes, but ignores, the optional _tolerance_ parameters). @@ -145,16 +146,16 @@ following 4 escape sequences: [[ *Sequence* :[ *Name* :[ *Description* -| CSI ? _Pm_ *h* +| \\E[ ? _Pm_ *h* : DECSET : Enable private mode -| CSI ? _Pm_ *l* +| \\E[ ? _Pm_ *l* : DECRST : Disable private mode -| CSI ? _Pm_ *s* +| \\E[ ? _Pm_ *s* : XTSAVE : Save private mode -| CSI ? _Pm_ *r* +| \\E[ ? _Pm_ *r* : XTRESTORE : Restore private mode @@ -248,52 +249,52 @@ above categories. # OSC -All _OSC_ sequences begin with *\\E]*, from here on denoted _OSC_. +All _OSC_ sequences begin with *\\E]*, sometimes abbreviated _OSC_. [[ *Sequence* :[ *Description* -| OSC 0 ; _Pt_ ST +| \\E] 0 ; _Pt_ ST : Set window icon and title to _Pt_ (foot does not support setting the icon) -| OSC 2 ; _Pt_ ST +| \\E] 2 ; _Pt_ ST : Set window title to _Pt_ -| OSC 4 ; _c_ ; _spec_ ST +| \\E] 4 ; _c_ ; _spec_ ST : Change color number _c_ to _spec_, where _spec_ is a color in *XParseColor* format. foot only supports RGB colors; either *rgb://*, or the legacy format (*#rgb*). -| OSC 7 ; _Uri_ ST +| \\E] 7 ; _Uri_ ST : Update the terminal's current working directory. Newly spawned terminals will launch in this directory. _Uri_ must be on the format *file:///*. *hostname* must refer to your local host. -| OSC 10 ; _spec_ ST +| \\E] 10 ; _spec_ ST : Change the default foreground color to _spec_, a color in *XParseColor* format. -| OSC 11 ; _spec_ ST +| \\E] 11 ; _spec_ ST : Change the default background color to _spec_, a color in *XParseColor* format. -| OSC 12 ; _spec_ ST +| \\E] 12 ; _spec_ ST : Change cursor color to _spec_, a color in *XParseColor* format. -| OSC 52 ; _Pc_ ; ? ST +| \\E] 52 ; _Pc_ ; ? ST : 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 ; *, where _Pc_ indicates the source used. -| OSC 52 ; _Pc_ ; _Pd_ ST +| \\E] 52 ; _Pc_ ; _Pd_ ST : Copy _Pd_ (base64 encoded text) to the clipboard. _Pc_ indicates the target: *c* targets the clipboard and *s* and *p* the primary selection. -| OSC 104 [; _c_] ST +| \\E] 104 [; _c_] ST : Reset color number _c_, or all colors (excluding the default foreground/background colors) if _c_ is omitted. -| OSC 110 ST +| \\E] 110 ST : Reset default foreground color -| OSC 111 ST +| \\E] 111 ST : Reset default background color -| OSC 112 ST +| \\E] 112 ST : Reset cursor color -| OSC 555 ST +| \\E] 555 ST : Flash the entire terminal (foot extension) -| OSC 777 ; notify ; _summary_ ; _message_ ST +| \\E] 777 ; notify ; _summary_ ; _message_ ST : Desktop notification, uses *notify* in *foot.ini*(5). # DCS @@ -303,10 +304,10 @@ are terminated by *\\E\\* (ST). [[ *Sequence* :[ *Description* -| DCS q ST +| \\EP q ST : Emit a sixel image at the current cursor position -| DCS = 1 s ST +| \\EP = 1 s ST : Begin application synchronized updates -| DCS = 2 s ST +| \\EP = 2 s ST : End application synchronized updates From 5539a7a02c457f2c8765492a2768772e50165154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 14 Feb 2021 11:11:19 +0100 Subject: [PATCH 16/30] =?UTF-8?q?doc:=20ctlseq:=20add=20=E2=80=98origin?= =?UTF-8?q?=E2=80=99=20column=20to=20OSC=20escape=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/foot-ctlseqs.5.scd | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index b4b8c611..207107c6 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -252,49 +252,65 @@ above categories. All _OSC_ sequences begin with *\\E]*, sometimes abbreviated _OSC_. [[ *Sequence* +:[ *Origin* :[ *Description* | \\E] 0 ; _Pt_ ST +: xterm : Set window icon and title to _Pt_ (foot does not support setting the icon) | \\E] 2 ; _Pt_ ST +: xterm : Set window title to _Pt_ | \\E] 4 ; _c_ ; _spec_ ST +: xterm : Change color number _c_ to _spec_, where _spec_ is a color in *XParseColor* format. foot only supports RGB colors; either *rgb://*, or the legacy format (*#rgb*). | \\E] 7 ; _Uri_ ST +: iTerm2 : Update the terminal's current working directory. Newly spawned terminals will launch in this directory. _Uri_ must be on the format *file:///*. *hostname* must refer to your local host. | \\E] 10 ; _spec_ ST +: xterm : Change the default foreground color to _spec_, a color in *XParseColor* format. | \\E] 11 ; _spec_ ST +: xterm : Change the default background color to _spec_, a color in *XParseColor* format. | \\E] 12 ; _spec_ ST +: xterm : Change cursor color to _spec_, a color in *XParseColor* format. | \\E] 52 ; _Pc_ ; ? ST +: xterm : 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 ; *, where _Pc_ indicates the source used. | \\E] 52 ; _Pc_ ; _Pd_ ST +: xterm : Copy _Pd_ (base64 encoded text) to the clipboard. _Pc_ indicates the target: *c* targets the clipboard and *s* and *p* the primary selection. | \\E] 104 [; _c_] ST +: xterm : Reset color number _c_, or all colors (excluding the default foreground/background colors) if _c_ is omitted. | \\E] 110 ST +: xterm : Reset default foreground color | \\E] 111 ST +: xterm : Reset default background color | \\E] 112 ST +: xterm : Reset cursor color | \\E] 555 ST +: foot : Flash the entire terminal (foot extension) -| \\E] 777 ; notify ; _summary_ ; _message_ ST +| \\E] 777;notify;_title_;_msg_ ST +: urxvt : Desktop notification, uses *notify* in *foot.ini*(5). # DCS From a6e496ebca90e3d43d9162c9557b029232d35339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 14 Feb 2021 12:44:43 +0100 Subject: [PATCH 17/30] doc: ctlseq: add ESC prefixed sequences --- doc/foot-ctlseqs.5.scd | 75 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 207107c6..7c220604 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -6,6 +6,7 @@ This document describes all the control sequences supported by foot. - CC0 - 7-bit control sequences - CC1 - 8-bit control sequences (*not supported*) +- Sequences beginning with ESC - CSI - Control Sequence Introducer - OSC - Operating System Command - DCS - Device Control String @@ -48,6 +49,80 @@ This document describes all the control sequences supported by foot. Foot does not support any CC1 control sequences. +# 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_. + # CSI All sequences begin with *\\E[*, sometimes abbreviated _CSI_. Spaces From 3c69a9c7e16c8ebadfab16016c4ffa61c9756bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 16 Feb 2021 11:21:41 +0100 Subject: [PATCH 18/30] doc: ctlseq: add most of the remaining CSIs --- doc/foot-ctlseqs.5.scd | 167 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 165 insertions(+), 2 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 7c220604..cf494511 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -319,8 +319,171 @@ that corresponds to one of the following modes: ## Other -*TODO*: all other CSI sequences that does not fall into any of the -above categories. +[[ *Parameter* +:[ *Name* +:[ *Origin* +:[ *Description* +| \\E[ _Ps_ b +: REP +: ECMA-48 +: Repeat the preceding printable character _Ps_ times. +| \\E[ _Ps_ c +: DA +: VT100 +: Send primary device attributes. Foot responds with "I'm a VT220 with + sixel and ANSI color support". +| \\E[ _Pm_ d +: VPA +: ECMA-48 +: Line position absolute - move cursor to line _Pm_. +| \\E[ _Ps_ A +: CUU +: VT100 +: Cursor up - move cursor up _Ps_ times. +| \\E[ _Pm_ e +: VPR +: ECMA-48 +: Line position relative - move cursor down _Pm_ lines. +| \\E[ _Ps_ B +: CUD +: VT100 +: Cursor down - move cursor down _Ps_ times. +| \\E[ _Pm_ a +: HPR +: ECMA-48 +: Character position relative - move cursor to the right _Pm_ times. +| \\E[ _Ps_ C +: CUF +: VT100 +: Cursor forward - move cursor to the right _Ps_ times. +| \\E[ _Ps_ D +: CUB +: VT100 +: Cursor backward - move cursor to the left _Ps_ times. +| \\E[ _Ps_ E +: CNL +: ECMA-48 +: Cursor next line - move the cursor down _Ps_ times. +| \\E[ _Ps_ F +: CPL +: ECMA-48 +: Cursor preceding line - move the cursor up _Ps_ times. +| \\E[ _Ps_ g +: TBC +: VT100 +: Tab clear. _Ps_=0 -> clear current column. _Ps_=3 -> clear all. +| \\E[ _Pm_ ` +: HPA +: ECMA-48 +: Character position absolute - move cursor to column _Pm_. +| \\E[ _Ps_ G +: CHA +: ECMA-48 +: Cursor character absolute - move cursor to column _Ps_. +| \\E[ _Ps_ ; _Ps_ f +: HVP +: VT100 +: Horizontal and vertical position - move cursor to _row_ ; _column_. +| \\E[ _Ps_ ; _Ps_ H +: CUP +: VT100 +: Cursor position - move cursor to _row_ ; _column_. +| \\E[ _Ps_ J +: ED +: VT100 +: Erase in display. _Ps_=0 -> below cursor. _Ps_=1 -> above + cursor. _Ps_=2 -> all. _Ps_=3 -> saved lines. +| \\E[ _Ps_ K +: EL +: VT100 +: Erase in line. _Ps_=0 -> right of cursor. _Ps_=1 -> left of + cursor. _Ps_=2 -> all. +| \\E[ _Ps_ L +: IL +: VT220 +: Insert _Ps_ lines. +| \\E[ _Ps_ M +: DL +: VT220 +: Delete _Ps_ lines. +| \\E[ _Ps_ P +: DCH +: VT220 +: Delete _Ps_ characters. +| \\E[ _Ps_ @ +: ICH +: VT220 +: Insert _Ps_ blank characters. +| \\E[ _Ps_ S +: SU +: ECMA-48 +: Scroll up _Ps_ lines. +| \\E[ _Ps_ T +: SD +: VT420 +: Scroll down _Ps_ lines. +| \\E[ _Ps_ X +: ECH +: VT220 +: Erase _Ps_ characters. +| \\E[ _Ps_ I +: CHT +: ECMA-48 +: Cursor forward tabulation _Ps_ tab stops. +| \\E[ _Ps_ Z +: CBT +: ECMA-48 +: Cursor backward tabulation _Ps_ tab stops. +| \\E[ _Pm_ h +: SM +: VT100 +: Set mode. _Pm_=4 -> enable IRM (insert mode). All other values of + _Pm_ are unsupported. +| \\E[ _Pm_ l +: RM +: VT100 +: Reset mode. _Pm_=4 -> disable IRM (insert mode). All other values of + _Pm_ are unsupported. +| \\E[ s +: SCOSC +: SCO, VT510 +: Save cursor position. +| \\E[ u +: SCORC +: SCO, VT510 +: Restore cursor position. +| \\E[ _Ps_ n +: DSR +: VT100 +: Device status report. _Ps_=5 -> device status. _Ps_=6 -> cursor + position. +| \\E[ > c +: DA2 +: VT220 +: Send secondary device attributes. Foot responds with "I'm a VT220 + and here's my version number". +| \\E[ _Ps_ SP q +: DECSCUSR +: VT510 +: Set cursor style. In foot, _Ps_=0 means "use style from foot.ini". +| \\E[ ! p +: DECSTR +: VT220 +: Soft terminal reset. +| \\E[ = _Ps_ c +: DA3 +: VT510 +: send tertiary device attributes. Foot responds with "FOOT", in + hexadecimal. +| \\E[ ? _Ps_ $ p +: DECRQM +: VT320 +: Request DEC private mode. + +TODO + +\\E[ ? S sixels (separate table?) (xterm?) +\\E[ t window operations - use a custom table for this # OSC From 0a33ce3e783465cec35a5b595d6579b1ae459742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 16 Feb 2021 14:15:46 +0100 Subject: [PATCH 19/30] =?UTF-8?q?doc:=20ctlseq:=20sort=20=E2=80=9Cmisc?= =?UTF-8?q?=E2=80=9D=20CSI=20sequences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/foot-ctlseqs.5.scd | 155 +++++++++++++++++++++-------------------- 1 file changed, 78 insertions(+), 77 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index cf494511..fe884e3a 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -323,35 +323,19 @@ that corresponds to one of the following modes: :[ *Name* :[ *Origin* :[ *Description* -| \\E[ _Ps_ b -: REP -: ECMA-48 -: Repeat the preceding printable character _Ps_ times. | \\E[ _Ps_ c : DA : VT100 : Send primary device attributes. Foot responds with "I'm a VT220 with sixel and ANSI color support". -| \\E[ _Pm_ d -: VPA -: ECMA-48 -: Line position absolute - move cursor to line _Pm_. | \\E[ _Ps_ A : CUU : VT100 : Cursor up - move cursor up _Ps_ times. -| \\E[ _Pm_ e -: VPR -: ECMA-48 -: Line position relative - move cursor down _Pm_ lines. | \\E[ _Ps_ B : CUD : VT100 : Cursor down - move cursor down _Ps_ times. -| \\E[ _Pm_ a -: HPR -: ECMA-48 -: Character position relative - move cursor to the right _Pm_ times. | \\E[ _Ps_ C : CUF : VT100 @@ -360,26 +344,10 @@ that corresponds to one of the following modes: : CUB : VT100 : Cursor backward - move cursor to the left _Ps_ times. -| \\E[ _Ps_ E -: CNL -: ECMA-48 -: Cursor next line - move the cursor down _Ps_ times. -| \\E[ _Ps_ F -: CPL -: ECMA-48 -: Cursor preceding line - move the cursor up _Ps_ times. | \\E[ _Ps_ g : TBC : VT100 : Tab clear. _Ps_=0 -> clear current column. _Ps_=3 -> clear all. -| \\E[ _Pm_ ` -: HPA -: ECMA-48 -: Character position absolute - move cursor to column _Pm_. -| \\E[ _Ps_ G -: CHA -: ECMA-48 -: Cursor character absolute - move cursor to column _Ps_. | \\E[ _Ps_ ; _Ps_ f : HVP : VT100 @@ -392,12 +360,26 @@ that corresponds to one of the following modes: : ED : VT100 : Erase in display. _Ps_=0 -> below cursor. _Ps_=1 -> above - cursor. _Ps_=2 -> all. _Ps_=3 -> saved lines. | \\E[ _Ps_ K : EL : VT100 : Erase in line. _Ps_=0 -> right of cursor. _Ps_=1 -> left of cursor. _Ps_=2 -> all. +| \\E[ _Pm_ h +: SM +: VT100 +: Set mode. _Pm_=4 -> enable IRM (insert mode). All other values of + _Pm_ are unsupported. +| \\E[ _Pm_ l +: RM +: VT100 +: Reset mode. _Pm_=4 -> disable IRM (insert mode). All other values of + _Pm_ are unsupported. +| \\E[ _Ps_ n +: DSR +: VT100 +: Device status report. _Ps_=5 -> device status. _Ps_=6 -> cursor + position. | \\E[ _Ps_ L : IL : VT220 @@ -414,36 +396,27 @@ that corresponds to one of the following modes: : ICH : VT220 : Insert _Ps_ blank characters. -| \\E[ _Ps_ S -: SU -: ECMA-48 -: Scroll up _Ps_ lines. -| \\E[ _Ps_ T -: SD -: VT420 -: Scroll down _Ps_ lines. | \\E[ _Ps_ X : ECH : VT220 : Erase _Ps_ characters. -| \\E[ _Ps_ I -: CHT -: ECMA-48 -: Cursor forward tabulation _Ps_ tab stops. -| \\E[ _Ps_ Z -: CBT -: ECMA-48 -: Cursor backward tabulation _Ps_ tab stops. -| \\E[ _Pm_ h -: SM -: VT100 -: Set mode. _Pm_=4 -> enable IRM (insert mode). All other values of - _Pm_ are unsupported. -| \\E[ _Pm_ l -: RM -: VT100 -: Reset mode. _Pm_=4 -> disable IRM (insert mode). All other values of - _Pm_ are unsupported. +| \\E[ > c +: DA2 +: VT220 +: Send secondary device attributes. Foot responds with "I'm a VT220 + and here's my version number". +| \\E[ ! p +: DECSTR +: VT220 +: Soft terminal reset. +| \\E[ ? _Ps_ $ p +: DECRQM +: VT320 +: Request DEC private mode. +| \\E[ _Ps_ T +: SD +: VT420 +: Scroll down _Ps_ lines. | \\E[ s : SCOSC : SCO, VT510 @@ -452,33 +425,61 @@ that corresponds to one of the following modes: : SCORC : SCO, VT510 : Restore cursor position. -| \\E[ _Ps_ n -: DSR -: VT100 -: Device status report. _Ps_=5 -> device status. _Ps_=6 -> cursor - position. -| \\E[ > c -: DA2 -: VT220 -: Send secondary device attributes. Foot responds with "I'm a VT220 - and here's my version number". | \\E[ _Ps_ SP q : DECSCUSR : VT510 : Set cursor style. In foot, _Ps_=0 means "use style from foot.ini". -| \\E[ ! p -: DECSTR -: VT220 -: Soft terminal reset. | \\E[ = _Ps_ c : DA3 : VT510 : send tertiary device attributes. Foot responds with "FOOT", in hexadecimal. -| \\E[ ? _Ps_ $ p -: DECRQM -: VT320 -: Request DEC private mode. +| \\E[ _Pm_ d +: VPA +: ECMA-48 +: Line position absolute - move cursor to line _Pm_. +| \\E[ _Pm_ e +: VPR +: ECMA-48 +: Line position relative - move cursor down _Pm_ lines. +| \\E[ _Pm_ a +: HPR +: ECMA-48 +: Character position relative - move cursor to the right _Pm_ times. +| \\E[ _Ps_ E +: CNL +: ECMA-48 +: Cursor next line - move the cursor down _Ps_ times. +| \\E[ _Ps_ F +: CPL +: ECMA-48 +: Cursor preceding line - move the cursor up _Ps_ times. +| \\E[ _Pm_ ` +: HPA +: ECMA-48 +: Character position absolute - move cursor to column _Pm_. +| \\E[ _Ps_ G +: CHA +: ECMA-48 +: Cursor character absolute - move cursor to column _Ps_. + cursor. _Ps_=2 -> all. _Ps_=3 -> saved lines. +| \\E[ _Ps_ S +: SU +: ECMA-48 +: Scroll up _Ps_ lines. +| \\E[ _Ps_ I +: CHT +: ECMA-48 +: Cursor forward tabulation _Ps_ tab stops. +| \\E[ _Ps_ Z +: CBT +: ECMA-48 +: Cursor backward tabulation _Ps_ tab stops. +| \\E[ _Ps_ b +: REP +: ECMA-48 +: Repeat the preceding printable character _Ps_ times. + TODO From 36f8cf0043f844606e049db9a05552cc59252d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 16 Feb 2021 14:22:03 +0100 Subject: [PATCH 20/30] =?UTF-8?q?doc:=20ctlseq:=20don=E2=80=99t=20highligh?= =?UTF-8?q?t=20literal=20characters,=20only=20parameters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/foot-ctlseqs.5.scd | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index fe884e3a..c140a03c 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -16,32 +16,32 @@ This document describes all the control sequences supported by foot. [[ *Sequence* :[ *Name* :[ *Description* -| *\\a* +| \\a : BEL : Depends on what *bell* in *foot.ini*(5) is set to. -| *\\b* +| \\b : BS : Backspace; move the cursor left one step. Wrap if _bw_ is enabled. -| *\\t* +| \\t : HT : Horizontal tab; move the cursor to the next tab stop. -| *\\n* +| \\n : LF : Line feed; move the cursor down one step, or scroll content up if at the bottom line. -| *\\v* +| \\v : VT : Vertical tab; identical to _LF_. -| *\\f* +| \\f : FF : Form feed; identical to _LF_. -| *\\r* +| \\r : CR : Carriage ret; move the cursor to the leftmost column. -| *\\x0E* +| \\x0E : SS0 : Shift out; select the _G1_ character set. -| *\\x0F* +| \\x0F : SS1 : Shift in; select the _G0_ character set. @@ -221,16 +221,16 @@ following 4 escape sequences: [[ *Sequence* :[ *Name* :[ *Description* -| \\E[ ? _Pm_ *h* +| \\E[ ? _Pm_ h : DECSET : Enable private mode -| \\E[ ? _Pm_ *l* +| \\E[ ? _Pm_ l : DECRST : Disable private mode -| \\E[ ? _Pm_ *s* +| \\E[ ? _Pm_ s : XTSAVE : Save private mode -| \\E[ ? _Pm_ *r* +| \\E[ ? _Pm_ r : XTRESTORE : Restore private mode From 54d1421782ad848065057760e974203ed7b233e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 16 Feb 2021 14:39:45 +0100 Subject: [PATCH 21/30] doc: ctlseq: document window manipulation sequences (CSI Ps;Ps;Ps t) --- doc/foot-ctlseqs.5.scd | 55 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index c140a03c..893b4a65 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -317,6 +317,60 @@ that corresponds to one of the following modes: : foot : Input Method Editor (IME) mode +## Window manipulation + +Foot implements a sub-set of XTerm's (originally dtterm's) window +manipulation sequences. The generic format is: + +*\\E[ *_Ps_* ; *_Ps_* ; *_Ps_* t* + +[[ *Parameter 1* +:[ *Parameter 2* +:[ *Description* +| 11 +: - +: Report if window is iconified. Foot always reports *1* - not iconified. +| 13 +: - +: Report window position. Foot always reports (0,0), due to Wayland + limitations. +| 13 +: 2 +: Report text area position. Foot always reports (0,0) due to Wayland + limitations. +| 14 +: - +: Report text area size, in pixels. Foot reports the grid size, + excluding the margins. +| 14 +: 2 +: Report window size, in pixels. Foot reports the grid size plus the + margins. +| 15 +: - +: Report the screen size, in pixels. +| 16 +: - +: Report the cell size, in pixels. +| 18 +: - +: Report text area size, in characters. +| 19 +: - +: Report screen size, in characters. +| 22 +: - +: Push window title+icon. Foot does not support pushing the icon. +| 22 +: 2 +: Push window title. +| 23 +: - +: Pop window title+icon. Foot does not support popping the icon. +| 23 +: 2 +: Pop window title. + ## Other [[ *Parameter* @@ -484,7 +538,6 @@ that corresponds to one of the following modes: TODO \\E[ ? S sixels (separate table?) (xterm?) -\\E[ t window operations - use a custom table for this # OSC From 451b3c53de06f245b0fbd41df75e4a26e0b9aabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 16 Feb 2021 14:43:50 +0100 Subject: [PATCH 22/30] doc: ctlseq: add XTSMGRAPHICS --- doc/foot-ctlseqs.5.scd | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 893b4a65..25a486fd 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -533,11 +533,10 @@ manipulation sequences. The generic format is: : REP : ECMA-48 : Repeat the preceding printable character _Ps_ times. - - -TODO - -\\E[ ? S sixels (separate table?) (xterm?) +| \\E[ ? _Pi_ ; _Pa_ ; _Pv_ S +: XTSMGRAPHICS +: xterm +: Set or request sixel attributes. # OSC From 34363b6d249ebc7363a52a9b04be73af1b18ef40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 16 Feb 2021 14:47:15 +0100 Subject: [PATCH 23/30] doc: ctlseq: add CSI sub headers to index --- doc/foot-ctlseqs.5.scd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 25a486fd..fba01167 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -8,6 +8,11 @@ This document describes all the control sequences supported by foot. - CC1 - 8-bit control sequences (*not supported*) - Sequences beginning with ESC - CSI - Control Sequence Introducer + - SGR + - Indexed and RGB colors (256-color palette and 24-bit colors) + - Private modes + - Window manipulation + - Other - OSC - Operating System Command - DCS - Device Control String From 6e0eb904b71892ae99ef82a1f698c183918255ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 21 Feb 2021 12:05:47 +0100 Subject: [PATCH 24/30] =?UTF-8?q?doc:=20ctlseq:=20=E2=80=9C7-bit=20control?= =?UTF-8?q?=20sequences=E2=80=9D=20->=20=E2=80=9C7-bit=20control=20*charac?= =?UTF-8?q?ters*=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/foot-ctlseqs.5.scd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index fba01167..5a28d448 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -4,7 +4,7 @@ foot-ctlseqs(5) This document describes all the control sequences supported by foot. -- CC0 - 7-bit control sequences +- CC0 - 7-bit control characters - CC1 - 8-bit control sequences (*not supported*) - Sequences beginning with ESC - CSI - Control Sequence Introducer @@ -16,7 +16,7 @@ This document describes all the control sequences supported by foot. - OSC - Operating System Command - DCS - Device Control String -# CC0 - 7-bit control sequences +# CC0 - 7-bit control characters [[ *Sequence* :[ *Name* From 76721aaef348ad67b837774c7639636b122f1c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 21 Feb 2021 12:08:31 +0100 Subject: [PATCH 25/30] =?UTF-8?q?doc:=20ctlseq:=20turn=20=E2=80=9CCC1=20-?= =?UTF-8?q?=208-bit=20control=20sequences=E2=80=9D=20into=20a=20footnote?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 8-bit control characters are virtually never used. Many terminals do not support them. As such, there is no need to draw attention to the fact that foot does not implement them. * Rename the “CC0 - 7-bit control characters” section to “Control characters”. --- doc/foot-ctlseqs.5.scd | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 5a28d448..63609e93 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -4,8 +4,7 @@ foot-ctlseqs(5) This document describes all the control sequences supported by foot. -- CC0 - 7-bit control characters -- CC1 - 8-bit control sequences (*not supported*) +- Control characters - Sequences beginning with ESC - CSI - Control Sequence Introducer - SGR @@ -16,7 +15,7 @@ This document describes all the control sequences supported by foot. - OSC - Operating System Command - DCS - Device Control String -# CC0 - 7-bit control characters +# Control characters [[ *Sequence* :[ *Name* @@ -50,10 +49,6 @@ This document describes all the control sequences supported by foot. : SS1 : Shift in; select the _G0_ character set. -# CC1 - 8-bit control sequences - -Foot does not support any CC1 control sequences. - # Sequences beginning with ESC Note: this table excludes sequences where ESC is part of a 7-bit @@ -623,3 +618,6 @@ are terminated by *\\E\\* (ST). | \\EP = 2 s ST : End application synchronized updates +# FOOTNOTE + +Foot does not support 8-bit control characters ("CC1"). From db9bd8c1ae2614c61bb94a858b2362f765753464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 21 Feb 2021 12:10:20 +0100 Subject: [PATCH 26/30] doc: ctlseq: remove excessive highlighting --- doc/foot-ctlseqs.5.scd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 63609e93..c4ab2c15 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -108,8 +108,8 @@ equivalent to 8-bit C1 controls. | \\E ( _C_ : SCS : VT100 -: Designate G0 character set. Supported values for _C_ are: *0* (_DEC - Special Character and Line Drawing Set_), and *B* (_USASCII_). +: Designate G0 character set. Supported values for _C_ are: *0* (DEC + Special Character and Line Drawing Set), and *B* (USASCII). | \\E ) _C_ : SCS : VT100 From 022646f8eb3fe599ca6ea5fa3d627201dc603900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 21 Feb 2021 12:10:56 +0100 Subject: [PATCH 27/30] =?UTF-8?q?doc:=20ctlseq:=20add=20missing=20?= =?UTF-8?q?=E2=80=98[=E2=80=99=20in=20example=20escape=20sequence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/foot-ctlseqs.5.scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index c4ab2c15..346a615d 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -127,7 +127,7 @@ equivalent to 8-bit C1 controls. All sequences begin with *\\E[*, sometimes abbreviated _CSI_. Spaces are used in the sequence strings to make them easier to read, but are -not actually part of the string. I.e. *\\E[ 1 m* is really *\\E1m*. +not actually part of the string. I.e. *\\E[ 1 m* is really *\\E[1m*. ## SGR From 2c0f391e3befd520d1d892e80500a6ccf1cfe25a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 21 Feb 2021 20:56:02 +0100 Subject: [PATCH 28/30] doc: ctlseq: add OSC-8 --- doc/foot-ctlseqs.5.scd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 346a615d..09cefe6b 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -562,6 +562,11 @@ All _OSC_ sequences begin with *\\E]*, sometimes abbreviated _OSC_. : Update the terminal's current working directory. Newly spawned terminals will launch in this directory. _Uri_ must be on the format *file:///*. *hostname* must refer to your local host. +| \\E] 8 ; _id_=*ID* ; _Uri_ ST +: VTE+iTerm2 +: Hyperlink (a.k.a HTML-like anchors). _id_ is optional; if assigned, + all URIs with the same *ID* will be treated as a single + hyperlink. An empty URI closes the hyperlink. | \\E] 10 ; _spec_ ST : xterm : Change the default foreground color to _spec_, a color in From 8a3537b940fadba2700f0f640631c1b00cd7f0c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 21 Feb 2021 21:25:48 +0100 Subject: [PATCH 29/30] doc: ctlseq: re-phrase when DCS is used instead of \EP --- doc/foot-ctlseqs.5.scd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 09cefe6b..5ba4571e 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -611,8 +611,8 @@ All _OSC_ sequences begin with *\\E]*, sometimes abbreviated _OSC_. # DCS -All _DCS_ sequences begin with *\\EP* (from here denoted _DCS_), and -are terminated by *\\E\\* (ST). +All _DCS_ sequences begin with *\\EP* (sometimes abbreviated _DCS_), +and are terminated by *\\E\\* (ST). [[ *Sequence* :[ *Description* From f08b05e7964b1685886b5c1e774f1e6b5f762eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 22 Feb 2021 09:26:15 +0100 Subject: [PATCH 30/30] =?UTF-8?q?doc:=20ctlseq:=20replace=20=E2=80=98ST?= =?UTF-8?q?=E2=80=99=20with=20the=20actual=20characters,=20=E2=80=98\E\?= =?UTF-8?q?=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/foot-ctlseqs.5.scd | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/doc/foot-ctlseqs.5.scd b/doc/foot-ctlseqs.5.scd index 5ba4571e..49187eb2 100644 --- a/doc/foot-ctlseqs.5.scd +++ b/doc/foot-ctlseqs.5.scd @@ -545,67 +545,67 @@ All _OSC_ sequences begin with *\\E]*, sometimes abbreviated _OSC_. [[ *Sequence* :[ *Origin* :[ *Description* -| \\E] 0 ; _Pt_ ST +| \\E] 0 ; _Pt_ \\E\\ : xterm : Set window icon and title to _Pt_ (foot does not support setting the icon) -| \\E] 2 ; _Pt_ ST +| \\E] 2 ; _Pt_ \\E\\ : xterm : Set window title to _Pt_ -| \\E] 4 ; _c_ ; _spec_ ST +| \\E] 4 ; _c_ ; _spec_ \\E\\ : xterm : Change color number _c_ to _spec_, where _spec_ is a color in *XParseColor* format. foot only supports RGB colors; either *rgb://*, or the legacy format (*#rgb*). -| \\E] 7 ; _Uri_ ST +| \\E] 7 ; _Uri_ \\E\\ : iTerm2 : Update the terminal's current working directory. Newly spawned terminals will launch in this directory. _Uri_ must be on the format *file:///*. *hostname* must refer to your local host. -| \\E] 8 ; _id_=*ID* ; _Uri_ ST +| \\E] 8 ; _id_=*ID* ; _Uri_ \\E\\ : VTE+iTerm2 : Hyperlink (a.k.a HTML-like anchors). _id_ is optional; if assigned, all URIs with the same *ID* will be treated as a single hyperlink. An empty URI closes the hyperlink. -| \\E] 10 ; _spec_ ST +| \\E] 10 ; _spec_ \\E\\ : xterm : Change the default foreground color to _spec_, a color in *XParseColor* format. -| \\E] 11 ; _spec_ ST +| \\E] 11 ; _spec_ \\E\\ : xterm : Change the default background color to _spec_, a color in *XParseColor* format. -| \\E] 12 ; _spec_ ST +| \\E] 12 ; _spec_ \\E\\ : xterm : Change cursor color to _spec_, a color in *XParseColor* format. -| \\E] 52 ; _Pc_ ; ? ST +| \\E] 52 ; _Pc_ ; ? \\E\\ : xterm : 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 ; *, where _Pc_ indicates the source used. -| \\E] 52 ; _Pc_ ; _Pd_ ST +| \\E] 52 ; _Pc_ ; _Pd_ \\E\\ : xterm : Copy _Pd_ (base64 encoded text) to the clipboard. _Pc_ indicates the target: *c* targets the clipboard and *s* and *p* the primary selection. -| \\E] 104 [; _c_] ST +| \\E] 104 [; _c_] \\E\\ : xterm : Reset color number _c_, or all colors (excluding the default foreground/background colors) if _c_ is omitted. -| \\E] 110 ST +| \\E] 110 \\E\\ : xterm : Reset default foreground color -| \\E] 111 ST +| \\E] 111 \\E\\ : xterm : Reset default background color -| \\E] 112 ST +| \\E] 112 \\E\\ : xterm : Reset cursor color -| \\E] 555 ST +| \\E] 555 \\E\\ : foot : Flash the entire terminal (foot extension) -| \\E] 777;notify;_title_;_msg_ ST +| \\E] 777;notify;_title_;_msg_ \\E\\ : urxvt : Desktop notification, uses *notify* in *foot.ini*(5). @@ -616,11 +616,11 @@ and are terminated by *\\E\\* (ST). [[ *Sequence* :[ *Description* -| \\EP q ST +| \\EP q \\E\\ : Emit a sixel image at the current cursor position -| \\EP = 1 s ST +| \\EP = 1 s \\E\\ : Begin application synchronized updates -| \\EP = 2 s ST +| \\EP = 2 s \\E\\ : End application synchronized updates # FOOTNOTE