foot-ctlseqs(7)
π NAME π
foot-ctlseqs β terminal control sequences supported by foot
No cap, this is the whole cheat sheet for every control sequence foot supports. Bestie, it's giving terminal lore and you're gonna eat it up. π
β¨ DESCRIPTION β¨
This document describes all the control sequences supported by foot. Here's the master list of what's inside, so you know the vibe:
- Control characters
- 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
π Control characters π
Okay so these are the tiny single-byte gremlins. Here's every one foot knows about:
\a(BEL) β Depends on whatbellinfoot.ini(5)is set to.\b(BS) β Backspace; move the cursor left one step. Wrap ifbwis enabled.\t(HT) β Horizontal tab; move the cursor to the next tab stop.\n(LF) β Line feed; move the cursor down one step, or scroll content up if at the bottom line.\v(VT) β Vertical tab; identical toLF.\f(FF) β Form feed; identical toLF.\r(CR) β Carriage ret; move the cursor to the leftmost column.\x0E(SO) β Shift out; select the G1 character set.\x0F(SI) β Shift in; select the G0 character set.
πΈ Sequences beginning with ESC πΈ
Note: this table excludes sequences where ESC is part of a 7-bit equivalent to 8-bit C1 controls.
Here's the ESC fam, with their names, origin, and what they do:
\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 select of G2 character set (affects next character only).\E O(SS3,VT220) β Single shift select of G3 character set (affects next character only).\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 forCare:0(DEC Special Character and Line Drawing Set), andB(USASCII).\E ) C(SCS,VT100) β Designate G1 character set. Same supported values forCas in G0.\E * C(SCS,VT220) β Designate G2 character set. Same supported values forCas in G0.\E + C(SCS,VT220) β Designate G3 character set. Same supported values forCas in G0.
π CSI π
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 \E[1m).
That's the whole vibe: spaces are just there for readability, bestie.
β¨ SGR β¨
All SGR sequences are in the form \E[ N m, where N is a decimal number - the parameter. Multiple parameters can be combined in a single CSI sequence by separating them with semicolons: \E[ 1;2;3 m.
And N is literally the parameter, so don't @ me. π
okay bestie, this parameter table is literally the terminalβs whole styling menu, and youβre gonna want to bookmark it. π Every number is a whole vibe:
0β Reset all attributes1β Bold2β Dim3β Italic4β Underline, including styled underlines5β Blink7β Reverse video; swap foreground and background colors8β Conceal; text is not visible, but is copiable9β Crossed-out/strike21β Double underline22β Disable bold and dim23β Disable italic24β Disable underline25β Disable blink27β Disable reverse video28β Disable conceal29β Disable crossed-out30-37β Select foreground color (usingregularNinfoot.ini(5))38β Select foreground color, see "indexed and RGB colors" below39β Use the default foreground color (foreground infoot.ini(5))40-47β Select background color (usingregularNinfoot.ini(5))48β Select background color, see "indexed and RGB colors" below49β Use the default background color (background infoot.ini(5))58β Select underline color, see "indexed and RGB colors" below59β Use the default underline color90-97β Select foreground color (usingbrightNinfoot.ini(5))100-107β Select background color (usingbrightNinfoot.ini(5))
and thatβs every single parameter, no skipping, no cap. π«Ά
π¨ 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. Obsessed with options, honestly. π
Indexed colors:
\E[ 38 : 5 : idx m\E[ 38 ; 5 ; idx m
RGB colors:
\E[ 38 : 2 : cs : r : g : b m\E[ 38 : 2 : r : g : b m\E[ 38 ; 2 ; r ; g ; b m
The first variant is the "correct" one (and foot also recognizes, but ignores, the optional tolerance parameters) β icon behavior, honestly. β¨
The second one is allowed since many programs "forget" the color space ID, cs. Lowkey relatable. π
The sub-parameter based variants are preferred, and are what footβs terminfo(5) entry uses. Periodt. π
π Private Modes π
There are several Boolean-like "modes" that affect certain aspects of the terminalβs behavior. You manipulate these modes with the following 4 escape sequences:
π Private modes: the ? girlies
Okay so these four are the private-mode besties β that ? in the middle? That's literally what makes them private modes, and it is not optional, okay. Here's the whole squad:
\E[ ? Pm hβDECSETβ turns a private mode on. Enable private mode, slay.\E[ ? Pm lβDECRSTβ turns a private mode off. Disable private mode, bye bestie.\E[ ? Pm sβXTSAVEβ saves the current state of a private mode. So you can be like "remember this for me" πΎ\E[ ? Pm rβXTRESTOREβ restores a private mode to whatever you saved withXTSAVE. The comeback era β¨
The Pm parameter in all four of the above is a numerical ID β like, an actual number β and each ID corresponds to one of the modes in the list coming up next:
okay so here's the parameter table bestie, get comfy because there's like a lot of them and every single one matters π
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) β yes this is the one that makes your cursor vanish, iconic45(xterm) β Reverse-wraparound mode47(xterm) β Same as1047(see below π)66(VT320) β Numeric keypad mode (DECNKM); same asDECKPAM/DECKPNMwhen enabled/disabled1000(xterm) β Send mouse x/y on button press/release π±οΈ1001(xterm) β Use hilite mouse tracking1002(xterm) β Use cell motion mouse tracking1003(xterm) β Use all motion mouse tracking1004(xterm) β SendFocusIn/FocusOutevents1006(xterm) β SGR mouse mode1007(xterm) β Alternate scroll mode1015(urxvt) β urxvt mouse mode1016(xterm) β SGR-Pixels mouse mode1034(xterm) β 8-bit Meta mode1035(xterm) β Num Lock modifier (see xtermnumLockoption)1036(xterm) β Send ESC when Meta modifies a key (see xtermmetaSendsEscapeoption)1042(xterm) β Perform action for BEL character (seebellinfoot.ini(5))1047(xterm) β Use alternate screen buffer1048(xterm) β Save/restore cursor (DECSET=save,DECRST=restore)1049(xterm) β Equivalent to1048and1047combined1070(xterm) β Use private color registers for each sixel π¨2004(xterm) β Wrap pasted text with start/end delimiters (bracketed paste mode)2026(terminal-wg) β Application synchronized updates mode2027(contour) β Grapheme cluster processing π¦2031(contour) β Request color theme updates2033(rockorager) β Request terminal visibility reports. Enabling this mode immediately reports the current visibility asCSI ? 999 ; 1|2 n, where1means potentially visible and2means not visible. Further reports are sent whenever the visibility changes. π2048(TODO) β In-band window resize notifications8452(xterm) β Position cursor to the right of sixels, instead of on the next line737769(foot) β Input Method Editor (IME) mode π
ngl bestie, 737769 is doing the absolute most but it's the IME mode so we respect it π«Ά
πͺ Window manipulation π
Okay so here's the tea: Foot does a sub-set of XTerm's window manipulation sequences (and those originally came from dtterm, iykyk). Not all of them, just a curated little collection. The generic format is, and I'm quoting, this:
\E[ Ps ; Ps ; Ps t
So you've got your Ps parameters lined up between the \E[ and the t, separated by semicolons. Now for the big mood board of what each parameter combo actually does β every single one, no skips π
- Parameter 1 =
11, Parameter 2 =-β Report if window is iconified. Foot always reports1β not iconified. (Foot's just out here living its best un-iconified life β¨) - Parameter 1 =
13, Parameter 2 =-β Report window position. Foot always reports(0,0), due to Wayland limitations. π - Parameter 1 =
13, Parameter 2 =2β Report text area position. Foot always reports(0,0)due to Wayland limitations. Yeah. Same energy. π - Parameter 1 =
14, Parameter 2 =-β Report text area size, in pixels. Foot reports the grid size, excluding the margins. - Parameter 1 =
14, Parameter 2 =2β Report window size, in pixels. Foot reports the grid size plus the margins. (Margins are back in the chat, bestie π«Ά) - Parameter 1 =
15, Parameter 2 =-β Report the screen size, in pixels. - Parameter 1 =
16, Parameter 2 =-β Report the cell size, in pixels. - Parameter 1 =
18, Parameter 2 =-β Report text area size, in characters. - Parameter 1 =
19, Parameter 2 =-β Report screen size, in characters. - Parameter 1 =
20, Parameter 2 =-β Report icon label. - Parameter 1 =
22, Parameter 2 =-β Push window title+icon. - Parameter 1 =
22, Parameter 2 =1β Push window icon. - Parameter 1 =
22, Parameter 2 =2β Push window title. - Parameter 1 =
23, Parameter 2 =-β Pop window title+icon. - Parameter 1 =
23, Parameter 2 =1β Pop window icon. - Parameter 1 =
23, Parameter 2 =2β Pop window title.
Push and pop, push and pop β it's giving stack energy, honestly iconic π
β¨ Other β¨
Okay bestie, this is the grab-bag section β the iconic mix-and-match of cursor moves, erases, and mode toggles that don't fit anywhere else. Every single one of these is literally in the table, so let's get into it π
\E[ Ps cβ DA, origin VT100. Send primary device attributes. Foot responds with "I'm a VT220 with sixel and ANSI color support". π¦ (yes, she's that girl)\E[ Ps Aβ CUU, origin VT100. Cursor up β move cursor up Ps times.\E[ Ps Bβ CUD, origin VT100. Cursor down β move cursor down Ps times.\E[ Ps Cβ CUF, origin VT100. Cursor forward β move cursor to the right Ps times.\E[ Ps Dβ CUB, origin VT100. Cursor backward β move cursor to the left Ps times.\E[ Ps gβ TBC, origin VT100. Tab clear.Ps=0β clear current column.Ps=3β clear all. π\E[ Ps ; Ps fβ HVP, origin VT100. Horizontal and vertical position β move cursor to row ; column.\E[ Ps ; Ps Hβ CUP, origin VT100. Cursor position β move cursor to row ; column. (same energy, different acronym, iykyk)\E[ Ps Jβ ED, origin VT100. Erase in display.Ps=0β below cursor.Ps=1β above\E[ Ps Kβ EL, origin VT100. Erase in line.Ps=0β right of cursor.Ps=1β left of cursor.Ps=2β all. β¨\E[ Pm hβ SM, origin VT100. Set mode.Pm=4β enable IRM (Insertion Replacement Mode). All other values of Pm are unsupported. π\E[ Pm lβ RM, origin VT100. Reset mode.Pm=4β disable IRM (Insertion Replacement Mode). All other values of Pm are unsupported. π\E[ Ps nβ DSR, origin VT100. Device status report.Ps=5β device status.Ps=6β cursor position. π\E[ Ps Lβ IL, origin VT220. Insert Ps lines.\E[ Ps Mβ DL, origin VT220. Delete Ps lines.\E[ Ps Pβ DCH, origin VT220. Delete Ps characters.\E[ Ps @β ICH, origin VT220. Insert Ps blank characters. π\E[ Ps Xβ ECH, origin VT220. Erase Ps characters.\E[ > cβ DA2, origin VT220. Send secondary device attributes. Foot responds with "I'm a VT220 and here's my version number". πΈ\E[ ! pβ DECSTR, origin VT220. Soft terminal reset. π§
Ngl, that DA / DA2 pair is giving main character energy β foot literally introduces herself twice, once with her feature list and once with her version number. Iconic. π
more CSI sequences, because weβre still in the table and weβre thriving:
\E[ ? Ps $ pβ DECRQM (VT320) β Request status of DEC private mode. ThePsparameter corresponds to one of the values mentioned in the "Private Modes" section above (as set withDECSET/DECRST). π\E[ Ps $ pβ DECRQM (VT320) β Request status of ECMA-48/ANSI mode. See the descriptions forSM/RMabove for recognizedPsvalues. β¨\E[ Pt ; Pl ; Pb ; Pr ; Pm $ rβ DECCARA (VT400) β Change attributes in rectangular area.Pt,Pl,PbandPrdenotes the rectangle,Pmdenotes the SGR attributes. π\E[ Pt ; Pl ; Pb ; Pr ; Pm $ tβ DECRARA (VT400) β Invert attributes in rectangular area.Pt,Pl,PbandPrdenotes the rectangle,Pmdenotes the SGR attributes. π¦\E[ Pt ; Pl ; Pb ; Pr ; Pp ; Pt ; Pl ; Pp $ vβ DECCRA (VT400) β Copy rectangular area.Pt,Pl,PbandPrdenotes the rectangle,PtandPldenotes the target location. πΈ\E[ Pc ; Pt ; Pl ; Pb ; Pr $ xβ DECFRA (VT420) β Fill rectangular area.Pcis the character to use,Pt,Pl,PbandPrdenotes the rectangle. π«Ά\E[ Pt ; Pl ; Pb ; Pr $ zβ DECERA (VT400) β Erase rectangular area.Pt,Pl,PbandPrdenotes the rectangle. π\E[ Ps Tβ SD (VT420) β Scroll downPslines. π₯\E[ sβ SCOSC (SCO, VT510) β Save cursor position. π\E[ uβ SCORC (SCO, VT510) β Restore cursor position. π\E[ Ps SP qβ DECSCUSR (VT510) β Set cursor style. In foot,Ps=0means "use style fromfoot.ini". β\E[ = Ps cβ DA3 (VT510) β Send tertiary device attributes. Foot responds with "FOOT", in hexadecimal. π\E[ Pm dβ VPA (ECMA-48) β Line position absolute - move cursor to linePm. π\E[ Pm eβ VPR (ECMA-48) β Line position relative - move cursor downPmlines. π\E[ Pm aβ HPR (ECMA-48) β Character position relative - move cursor to the rightPmtimes. π\E[ Ps Eβ CNL (ECMA-48) β Cursor next line - move the cursor downPstimes. π§\E[ Ps Fβ CPL (ECMA-48) β Cursor preceding line - move the cursor upPstimes. π\E[ Pm `β HPA (ECMA-48) β Character position absolute - move
okay bestie, we're still deep in the CSI table and honestly it's giving "terminal lore drops" π picking up right where we left off β every sequence, name, origin, and caveat stays exactly as it was, just with main character energy β¨
\E[ Ps Gβ (CHA, ECMA-48) Cursor character absolute - move cursor to column Ps. cursor. Ps=2 -> all. Ps=3 -> saved lines. yes the "cursor." is really in there, don't come for me π\E[ Ps Sβ (SU, ECMA-48) Scroll up Ps lines. simple, clean, iconic π«Ά\E[ Ps Iβ (CHT, ECMA-48) Cursor forward tabulation Ps tab stops. tab girlies stay winning β¨\E[ Ps Zβ (CBT, ECMA-48) Cursor backward tabulation Ps tab stops. back it up, back it up π\E[ Ps bβ (REP, ECMA-48) Repeat the preceding printable character Ps times. spam that character, respectfully π\E[ ? Pi ; Pa ; Pv Sβ (XTSMGRAPHICS, xterm) Set or request sixel attributes. sixel business, very demure π¦\E[ > Ps qβ (XTVERSION, xterm) Ps=0 -> report terminal name and version, in the form\EP>|foot(version)\E\. identity check, slay π\E[ > 4 ; Pv mβ (XTMODKEYS, xterm) Set level of themodifyOtherKeysproperty to Pv. Note that foot only supports level 1 and 2, where level 1 is the default setting. levels, but make it limited β no level 0 erasure here π\E[ ? Pp mβ (XTQMODKEYS, xterm) Query key modifier options. just asking the terminal nicely for the receipts π\E[ > 4 nβ (<unnamed>, xterm) Resets themodifyOtherKeysproperty to level 1. Note that in foot, this sequence does not completely disablemodifyOtherKeys, since foot only supports level 1 and level 2 (and not level 0). important caveat bestie β it resets, it does NOT fully disable π\E[ ? uβ (<unnamed>, kitty) Query current values of the Kitty keyboard flags. kitty keyboard lore, we love to see it π±\E[ > flags uβ (<unnamed>, kitty) Push a new entry, flags, to the Kitty keyboard stack. stack it like a boss π\E[ < number uβ (<unnamed>, kitty) Pop number of entries from the Kitty keyboard stack. pop pop pop, no cap π«§\E[ = flags ; mode uβ (<unnamed>, kitty) Update current Kitty keyboard flags, according to mode. mode-activated glow-up β¨\E[ # Pβ (XTPUSHCOLORS, xterm) Push current color palette onto stack. palette preservation station π¨\E[ # Qβ (XTPOPCOLORS, xterm) Pop color palette from stack. and pop! back to your regularly scheduled colors π\E[ # Rβ (XTREPORTCOLORS, xterm) Report the current entry on the palette stack, and the number of palettes stored on the stack. receipts on receipts, we love a full report π§Ύ\E[ ? 996 nβ (Query the current (color) theme mode, contour) The current color theme mode (light or dark) is reported asCSI ? 997 ; 1|2 n, where 1 means dark and 2 light. By convention, the primary theme in foot is considered dark, and the alternative theme light. theme mode check! dark mode girlies rise πβ¨\E[ ? 998 nβ query terminal visibility, bestie π submitted by rockorager (yes, honor the icon). The current terminal visibility gets reported back asCSI ? 999 ; 1|2 n, where1means potentially visible and2means not visible. Quick heads up though β this does not enable private mode2033, so don't go thinking it does. It's just a peek, not a switch π
π OSC π
Okay so every single OSC sequence starts with \E] β and yeah, people sometimes just abbreviate it to OSC, iykyk. π¦
\E] 0 ; Pt \E\β xterm. Sets the window icon and the title to Pt in one go. Two birds, one iconic move. π\E] 1 ; Pt \E\β xterm. Sets just the window icon to Pt. π\E] 2 ; Pt \E\β xterm. Sets just the window title to Pt. πΈ\E] 4 ; c ; spec \E\β xterm. Changes the color number c to spec, where spec is a color in XParseColor format. Heads up bestie: foot only supports RGB colors here β eitherrgb:<red>/<green>/<blue>, or the legacy format#rgb. That's it, no cap.\E] 7 ; Uri \E\β iTerm2. Updates the terminal's current working directory, and newly spawned terminals will launch in this directory. Uri must be in the formatfile://<hostname>/<path>, and hostname must refer to your local host. π₯\E] 8 ; id=ID ; Uri \E\β VTE+iTerm2. Hyperlink (a.k.a HTML-like anchors), the moment the terminal ate.id=IDis optional; if assigned, all URIs with the sameIDwill be treated as a single hyperlink. An empty URI closes the hyperlink. π¦\E] 9 ; msg \E\β iTerm2. Desktop notification β it usesnotifyinfoot.ini(5). π\E] 10 ; spec \E\β xterm. Changes the default foreground color to spec, a color in XParseColor format. β¨\E] 11 ; spec \E\β xterm. Changes the default background color to spec, a color in XParseColor format. And here's the slay: foot implements URxvt's transparency extension, so you can dospec=[75]#ff00fforspec=rgba:ff/00/ff/bf(that's pink with 75% alpha, lowkey gorgeous). π\E] 12 ; spec \E\β xterm. Changes the cursor color to spec, a color in XParseColor format. π―\E] 17 ; spec \E\β xterm. Changes the selection background color to spec, a color in XParseColor format. π\E] 19 ; spec \E\β xterm. Changes the selection foreground color to spec, a color in XParseColor format. π\E] 22 ; xcursor-pointer-name \E\β xterm. Sets the xcursor pointer. An empty name, or an invalid name, resets it. π±οΈ\E] 52 ; Pc ; ? \E\β xterm. Sends clipboard data. Pc can be eitherc,sorpβcuses the clipboard as source, andsandpuse the primary selection. The response is\E] 52 ; Pc ; <base64-encoded data> E\, where Pc denotes the source used. π\E] 52 ; Pc ; Pd \E\β xterm. Copies Pd (base64 encoded text) to the clipboard. Pc denotes the target:ctargets the clipboard andsandpthe primary selection. ποΈ\E] 66 ; params ; text \E\β kitty. Text sizing protocol β only'w', width, is supported. (Read the fine print, bestie.) π\E] 99 ; params ; payload \E\β kitty. Desktop notification; usesdesktop-notifications.commandinfoot.ini(5). π\E] 104 ; c \E\β xterm. Resets color number c β and yes, multiple semicolon separated c values may be provided β or resets all colors (excluding the default foreground/background colors) if c is omitted. π§Ό\E] 110 \E\β xterm. Resets the default foreground color. β¬\E] 111 \E\β xterm. Resets the default background color. β¬\E] 112 \E\β xterm. Resets the cursor color. π±οΈ\E] 117 \E\β xterm. Resets the selection background color. π¨\E] 119 \E\β xterm. Resets the selection foreground color. ποΈ\E] 133 ; A \E\β FinalTerm β marks the start of your shell prompt β¨\E] 133 ; C \E\β FinalTerm β marks the start of command output π\E] 133 ; D \E\β FinalTerm β marks the end of command output π\E] 176 ; app-id \E\β foot β sets the app ID.app-idis optional; if you do assign it, the terminal window App ID gets set to that value. An empty App ID resets it back to the default, no cap π«Ά\E] 555 \E\β foot β flashes the entire terminal (foot extension) β‘\E] 777;notify;title;msg \E\β urxvt β desktop notification, and it usesdesktop-notifications.commandinfoot.ini(5)π¦
π DCS π
okay so every DCS sequence starts with \EP (yeah, it's sometimes just abbreviated DCS), and they all get terminated by \E\ (that's ST, mwah π).
\EP q <sixel data> \E\β emits a sixel image right at the current cursor position πΌοΈ iconic honestly\EP $ q <query> \E\β requests a selection or setting (that's DECRQSS for the girlies who track acronyms). The implemented queries areDECSTBM,SGRandDECSCUSRπ\EP = C s \E\β begins (C=1) or ends (C=2) application synchronized updates. It's supported for compatibility reasons, but bestie, they recommend you use private mode2026(see above) instead π\EP + q <hex encoded capability name> \E\β queries the builtin terminfo database (XTGETTCAP) π
π FOOTNOTE π
Foot does not support 8-bit control characters ("C1"). literally not a vibe it does, so don't come for it π
and that's a wrap on the whole page, bestie π this version was living its best life dated 2026-09-08 and it's the foot-ctlseqs(7) manual page β go forth and slay those escape sequences πβ¨π
π¦ where this page comes from
- arch rolling: foot 1.28.0-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms