DTTERM(5)
β¨ NAME β¨
dtterm β the escape sequences that dtterm and the DtTerm widget recognize, babes. (This is the dtterm(file formats) page, so yes we're in file formats territory π
)
πΈ DESCRIPTION πΈ
π Received Escape Sequences π
okay so first things first: the dtterm(1) utility and the DtTerm widget both support the whole list of received escape sequences below. fr fr, all of them.
Housekeeping before we dive in, because the notation matters and I refuse to let you get caught out:
- Spaces have been added for readability and are not part of the escape sequence. Readability only. Do not send the space.
- The following indicate parameters: pi, p1, label, file and text.
- A space indicates a required space, hexadecimal code
0x20. - A
&<control>-char indicates a control code (like&<control>-G, which is hexadecimal code0x07). Escindicates hexadecimal code0x1b.Backslashindicates hexadecimal code0x5c.- Literals are indicated as literal and must be included exactly as specified.
- All references to the
dtterm(1)utility in this man page also apply to theDtTermwidget. same energy, both of them π
&<control>-Gβ (BEL) Bell. The terminal either issues an audible bell, or flashes the text window depending on the state of the visual bell flag. your choice bestie π&<control>-Hβ (BS) Backspace. The cursor moves one cursor position to the left. If reverse-wrap mode is disabled and the cursor is at the left-most column of the line when a backspace character is received, the cursor remains at its current position. If reverse-wrap mode is enabled and the cursor is at the left-most column of the line when a backspace character is received, the cursor moves to the right-most column of the previous line. And if the cursor is also in the top-most row, the cursor moves to the right-most column of the bottom-most row. yeah, it wraps around like that, iconic π&<control>-Iβ (HT) Horizontal Tab. The cursor moves right to the next tab stop. If there are no further tab stops set to the right of the cursor, the cursor moves to the right-most column of the current line. no tab stops left? it just parks itself at the end π&<control>-Jβ (LF) Line Feed or New Line. The cursor moves to the same column of the next line. If the cursor is in the bottom-most line of the scrolling region, the scrolling region scrolls up one line. Lines scrolled off the top of the scrolling region are lost. Blank lines with no visible character attributes are added at the bottom of the scrolling region.&<control>-Kβ (VT) Vertical Tab. Same as Line Feed. literally the same, no notes π&<control>-Lβ (FF) Form Feed or New Page. Same as Line Feed. also the same. we love a reuse moment π&<control>-Mβ (CR) Carriage Return. The cursor moves to the left-most column of the current line.
π¦ SCS (designate those character sets) π¦
Esc ( Bβ (SCS) Designate ASCII (base font) as G0.Esc ( 0β (SCS) Designate DEC Special Graphic (line draw) as G0.Esc ) Bβ (SCS) Designate ASCII (base font) as G1.Esc ) 0β (SCS) Designate DEC Special Graphic (line draw) as G1.Esc * Bβ (SCS) Designate ASCII (base font) as G2.Esc * 0β (SCS) Designate DEC Special Graphic (line draw) as G2.Esc + Bβ (SCS) Designate ASCII (base font) as G3.Esc + 0β (SCS) Designate DEC Special Graphic (line draw) as G3.
&<control>-Nβ (LS1) Map G1 into GL.&<control>-Oβ (LS0) Map G0 into GL.Esc nβ (LS2) Map G2 into GL.Esc oβ (LS3) Map G3 into GL.Esc Nβ (SS2) Map G2 into GL for the next character. just the next one, okay? π«ΆEsc Oβ (SS3) Map G3 into GL for the next character. also just the next one.
Esc Space Fβ (S7C1T) Select 7-bit C1 Control Characters. In this mode, thedttermutility sends all C1 Control Characters to the host as 7-bit escape sequences. That is,CSIis sent to the host asEsc [. seven bits of pure vibe β¨Esc Space Gβ (C8C1T) Select 8-bit C1 Control Characters. In this mode, thedttermutility sends all C1 Control Characters to the host as 8-bit control codes. That is,CSIis sent back as the hexadecimal value0x9B. the glow-up version πEsc # 8β (DECALN) DEC Screen Align Test. The screen is filled with the characterE. that's it. a whole screen of E. no cap π
π Cursor save & restore, the whole situation π
Esc 7β (DECSC) Save cursor. The following is saved:- Cursor position
- Character attributes set by the
SGRcommand - Any pending single shift 2 or 3 (
SS2orSS3) - State of the autowrap flag
- State of the reverse wrap flag
- State of origin mode (
DECOM) - State of selective erase
Esc 8β (DECRC) Restore cursor. The terminal emulator is restored to the state saved by the save cursor (DECSC) function. If nothing was saved byDECSC, then the following actions are performed:- Moves the cursor to the home position
- Resets the origin mode (
DECOM) - Turns off all character attributes (
SGR) - Maps the ASCII character set into GL
so if you never saved anything, it just does the sensible little default thing. no stress π«Ά
π Keypad modes π
Esc =β (DECPAM) Application keypad. In this mode, the numeric keypad sends application sequences. (See the ``Transmitted Escape Sequences'' section later in this document for additional information.) yes, we'll get there πEsc >β (DECPNM) Normal keypad. In this mode, the numeric keypad sends the characters shown on the keypad. KeysPF1toPF4, inclusive, send application sequences. (See the ``Transmitted Escape Sequences'' section later in this document for additional information.) the whole PF1βPF4 crew stays on application mode, periodt π₯
π Index / next line / tab set / reverse index π
Esc Dβ (IND) Index. The cursor moves down to the same column of the next line. If the cursor is in the bottom-most line of the scrolling region, the scrolling region is scrolled up one line. The line scrolled off the top of the scrolling region is lost. A blank line with no visible character attributes is added at the bottom of the scrolling region.Esc Eβ (NEL) Next line. The cursor moves down to the first column of the next line. If the cursor is in the bottom-most line of the scrolling region, the scrolling region is scrolled up one line. The line scrolled off the top of the scrolling region is lost. A blank line with no visible character attributes is added at the bottom of the scrolling region.Esc Hβ (HTS) Tab set. This function sets a horizontal tab stop at the column where the cursor is located. pin it right there πEsc Mβ (RI) Reverse index. The cursor moves up to the same column of the previous line. If the cursor is in the top-most line of the scrolling region, the scrolling region is scrolled down one line. The line scrolled off the bottom of the scrolling region is lost. A blank line with no visible character attributes is added at the top of the scrolling region. yes, scrolling in the other direction, she's versatile π«
Esc P p1 ; p2 | p3 Esc Backslashβ (DECUDK) User defined keys.Esc Zβ (DECID) Return terminal ID. This function is similar to a primary device attributes (DA) request. (SeeEsc [ c(DA) described later in this document.) hi, who am i πEsc cβ (RIS) Full reset. This function performs a full (hard) reset. For additional information, see the ``Reset'' section in this man page. hard reset. ngl, respect the commitment π
β Select character protection attribute & friends β
Esc [ pi qβ (DECSCA) Select character protection attribute. The default value is0. This escape sequence defines the characters that come after it as erasable or not erasable from the screen. The selective erase escape sequences, (DECSEDandDECSEL), can only erase characters defined as erasable. Valid supported values of pi are:0βDECSEDandDECSELcan erase characters.1βDECSEDandDECSELcannot erase characters.2β Same as0.
π₯ The cursor-movement classics π₯
Esc [ pi @β (ICH) Insert pi blank characters. The default value is1. A parameter value of0or1inserts a single blank character. A parameter value ofNinsertsNblank characters. Blank characters with normal character attributes are inserted at the cursor position. Characters to the right of the cursor move to the right. Characters scrolled past the end of the line are lost.Esc [ pi Aβ (CUU) Cursor up pi lines. The default value is1. A parameter value0or1moves the cursor up one line. A parameter value ofNmoves the cursor upNlines. The cursor stops at the top margin. If the cursor is already above the top margin, the cursor stops at the top line.Esc [ pi Bβ (CUD) Cursor down pi lines. The default value is1. A parameter value0or1moves the cursor down one line. A parameter value ofNmoves the cursor downNlines. The cursor stops at the bottom margin. If the cursor is already below the bottom margin, the cursor stops at the bottom line.Esc [ pi Cβ (CUF) Cursor forward pi characters. The default value is1. A parameter value0or1moves the cursor forward one character. A parameter value ofNmoves the cursor forwardNcharacters. The cursor stops at the right-most column of the line.Esc [ pi Dβ (CUB) Cursor backward pi characters. The default value is1. A parameter value0or1moves the cursor backward one character. A parameter value ofNmoves the cursor backwardNcharacters. The cursor stops at the left-most column of the line.Esc [ pi Fβ (CPL) Cursor to the first column of the pi-th preceding line. The default value is1. A parameter value0or1moves the cursor to the preceding line. A parameter value ofNmoves the cursor to theN-th preceding line. If the cursor is below the top margin, the cursor stops at the top margin. If the cursor is already above the top margin, the cursor stops at the top line.Esc [ pi Gβ (CHA) Cursor to column pi. The default value is1. A parameter value0or1moves the cursor to the first column of the current line. A parameter value ofNmoves the cursor to theN-th column of the current line.Esc [ p1 ; p2 Hβ (CUP) Cursor position. The default value is1. A p1 value0or1moves the cursor to row one. A p1 value ofNmoves the cursor to rowN. A p2 value0or1moves the cursor to column one. A p2 value ofNmoves the cursor to columnN. The starting point for lines and columns depends on the setting of the origin mode (DECOM). this is the one everyone actually uses tbh π
and that's literally just the beginning of the list, we are so not done yet πΈ
Esc [ pi Jβ (ED) Erase in display, bestie. The default value is0. A parameter value of0erases from the cursor to the end of the display. A parameter value of1erases from the beginning of the display to the cursor position, inclusive. A parameter value of2erases the complete display. Like a full glow-up reset for your screen β¨Esc [ pi Kβ (EL) Erase in line. Default is0. A parameter value of0erases from the cursor to the end of the line. A parameter value of1erases from the beginning of the line to the cursor position, inclusive. A parameter value of2erases the complete line. One line only, no drama πEsc [ pi Lβ (IL) Insert lines. The default value is1. A parameter value of0or1inserts one line at the cursor. A parameter value ofNinsertsNlines at the cursor. As lines are inserted, lines below the cursor and in the scrolling region move down. Lines scrolled off the page are lost. There is no effect outside the scrolling region. It's giving "make room, main character incoming" π«ΆEsc [ pi Mβ (DL) Delete lines. The default value is1. A parameter value of0or1deletes one line at the cursor. A parameter value ofNdeletesNlines at the cursor. As lines are deleted, lines below the cursor and in the scrolling region move up. Blank lines with no visible character attributes are added at the bottom of the scrolling region. There is no effect outside the scrolling region. Blocked and deleted, no cap πEsc [ pi Pβ (DCH) Delete characters. The default value is1. A parameter value of0or1deletes one character at the cursor position. A parameter value ofNdeletesNcharacters at the cursor position. A parameter greater than the number of characters between the cursor and the right margin only deletes the remaining characters on the line. As characters are deleted, the remaining characters move left and are replaced by blank spaces with no visual character attributes. Sliding left like you just left the group chat πEsc [ pi Sβ (SU) Scroll uppilines. The default value is1. A parameter value of0or1scrolls the display up one line. A parameter value ofNscrolls the display upNlines. The scrolling region scrolls up. Lines scrolled off the top of the scrolling region are lost. Blank lines with no visible character attributes are added at the bottom of the scrolling region.Esc [ pi Tβ (SD) Scroll downpilines. The default value is1. A parameter value of0or1scrolls the display down one line. A parameter value ofNscrolls the display downNlines. The scrolling region scrolls down. Lines scrolled off the bottom of the scrolling region are lost. Blank lines with no visible character attributes are added at the top of the scrolling region.Esc [ pi Xβ (ECH) Erasepicharacters. The default value is1. A parameter value of0or1erases a single character. A parameter value ofNerasesNcharacters. The character attributes of erased characters are cleared. This escape sequences works inside or outside the scrolling margins. Iconic behavior tbh πΈEsc [ pi cβ (DA) Send device attributes. The default is0. A parameter value of0or1causes the terminal emulator to respond withEsc [ ? 1; 2 c. This is the standard response for the DEC VT100 Terminal andxterm(1). It's literally quoting the classics π₯
Esc [ p1 ; p2 fβ (HVP) Horizontal and vertical position. This escape sequence has been replaced by CUP and offers identical functionality. It is provided to maintain backward compatibility. Retirement-era icon, we respect her πEsc [ pi gβ (TBC) Tab clear. The default is0. A parameter value of0clears the tab stop at the current cursor column. A parameter value of3clears all tab stops. All of them. Gone. Periodt π
ποΈ modes era
Esc [ pi hβ (SM) Set mode. This escape sequence sets ANSI modes. Valid supported values ofpiare:2β (KAM) Keyboard lock. In this mode,dtterm(1)ignores all keystrokes from the keyboard. Bestie is on do-not-disturb π4β (IRM) Insert mode. In this mode, new characters move characters in display memory to the right. Characters moved past the end of the line are lost.12β (SRM) Local echo off. In this mode,dtterm(1)sends keyboard characters to the host only. The host must echo back characters for them to be displayed.20β (LNM) New line. In this mode, the cursor moves to the first column on the next line whendtterm(1)receives an LF, FF or VT character. When the Return key is pressed,dtterm(1)sends a carriage-return (CR) followed by a newline (NL).
Esc [ pi lβ (RM) Reset mode. This escape sequences resets ANSI modes. Valid supported values ofpiare:2β (KAM) Keyboard unlock. In this mode,dtterm(1)processes all keystrokes from the keyboard. We're back online π¦4β (IRM) Replace mode. In this mode, new characters replace the character at the cursor position.12β (SRM) Local echo on. In this mode,dtterm(1)sends keyboard characters to both the host and the display. The host does not have to echo back characters for them to be displayed.20β (LNM) New line. In this mode, the cursor moves to the same column on the next line whendtterm(1)receives an LF, FF or VT character. When the Return key is pressed,dtterm(1)sends a carriage-return (CR).
π¨ the aesthetic corner
Esc [ pi ; ... mβ (SG) Graphics rendition. The default value is0. This escape sequence selects one or more character attributes. Valid supported values forpiare:0β All attributes off1β Bold2β Faint4β Underline5β Blinking. This attribute appears as bold text7β Negative image8β Invisible image22β Bold and Faint off24β Underline off25β Blinking off27β Negative image off28β Invisible image off30β Black display (text)31β Red display (text)32β Green display (text)33β Yellow display (text)34β Blue display (text)35β Magenta display (text)36β Cyan display (text)37β White display (text)39β Default display (text)40β Black background41β Red background42β Green background43β Yellow background44β Blue background45β Magenta background46β Cyan background47β White background49β Default background
π reports & receipts
Esc [ pi nβ (DSR) Device status report. Valid supported values forpiare:Esc [ ? pi nβ (DSR) DEC private device status report. Valid supported values forpiare:15β Printer port status. Thedtterm(1)utility responds with a "no printer available" message ofEsc [ ? 13 n. Tragic, honestly π25β User-defined key status. Thedtterm(1)utility responds with either a message ofEsc [ ? 20 nif UDKs are unlocked, orEsc [ ? 21 nif UDKs are locked.26β Keyboard status. Thedtterm(1)utility responds with a message ofEsc [ ? 27 ; 1 n, which indicates a North American keyboard.
Esc [ p1 ; p2 rβ (DECSTBM) Set top and bottom margins. The default value forp1is1. The default value forp2is the current number of lines in the terminal window. The top and bottom margins are set top1andp2respectively. Scrolling is not performed outside the margins. Setting boundaries, we love to see it πEsc [ p1 ; p2 ; p3 tβ Window manipulation. Valid values forp1(and any additional parameters) are:1β Restore (de-iconify) window. Come back to me bestie π«Ά2β Minimize (iconify) window.3 ; x ; yβ Move window to [x,y].4 ; height ; widthβ Resize thedtterm(1)window toheightandwidthin pixels.5β Raise thedtterm(1)window to the front of the stacking order.6β Lower thedtterm(1)window to the bottom of the stacking order.7β Refresh thedtterm(1)window.8 ; height ; widthβ Resize the text area toheightandwidthin characters.11β Reportdtterm(1)window state. If thedtterm(1)window is open (non-iconified), it returnsEsc [ 1 t. If thedtterm(1)window is iconified, it returnsEsc [ 2 t.13β Report thedtterm(1)window position. The terminal emulator returnsEsc [ 3 ; x ; y t.14β Report thedtterm(1)window in pixels. The terminal emulator returnsEsc [ 4 ; height ; width t.18β Report the size of the area in characters. The terminal emulator returnsEsc [ 8 ; height ; width t.20β Report thedtterm(1)window's icon label. The terminal emulator returnsEsc ] L label Esc Backslash. iykyk π
21β Report thedtterm(1)window's title π. The terminal emulator returnsEsc ] l title Esc Backslash.
π¦ Esc [ pi x β request terminal modes
The default value is 0. Valid values are 0 or 1. If pi is 0, dtterm(1) responds with the message of Esc [ 2; 1; 1; 112; 112 ; 1; 0 x. If pi is 1, dtterm(1) responds with the message of Esc [ 3; 1; 1; 112; 112; 1; 0x.
Ok bestie, heads up: this escape sequence is supported for backward compatibility for xterm(1) only β it's giving legacy, not main character energy.
πΈ Esc [ ? pi h β ( SM) DEC private set mode
This escape sequence sets DEC private modes. Valid supported values of pi are:
1( DECCKM) Enable cursor keys mode. When cursor keys mode is enabled, the arrow keys send application sequences to the host.3( DECCOLM) Enable 132-column mode. When 132-column mode is enabled, the number of columns in the terminal window is changed to 132. When entering into 132-column mode, the left, right, top, and bottom margins are reset to their default positions and the display is cleared.4( DECSCLM) Enable smooth scrolling. When smooth scrolling is enabled, lines are added and the screen is scrolled a single line at a time.5( DECSCNM) Enable reverse video. When reverse video mode is enabled, the foreground and background colors of the terminal window are reversed.6( DECOM) Enable origin mode. When origin mode is enabled, the home cursor position is the upper-left corner of the screen, within the margins. The starting point for line numbers depends on the current top margin. The cursor cannot be moved outside the top and bottom margins.7( DECAWM) Enable autowrap. When autowrap mode is enabled, characters received when the cursor is at the right-most column of the page are inserted at the beginning of the next line. If the cursor is at the bottom line of the scrolling region, the page is scrolled up 1 line.8( DECARM) Enable auto-repeat keys. This option is ignored.25( DECTCEM) Enable cursor visible. In this mode, the text cursor is visible.40Enable DECCOLM escape sequence. When the DECCOLM escape sequence is enabled, the terminal emulator switches into either an 80- or 132-column window when it receives a DECCOLM escape sequence.44Enable margin bell. When the margin bell is enabled, thedttermutility's bell (either audible or visible) is invoked when the cursor is a predefined distance from the right margin and a key is pressed.45Enable reverse-autowrap mode. When reverse-autowrap mode is enabled, and a backspace is received when the cursor is at the left-most column of the page, the cursor is wrapped to the right-most column of the previous line. If the cursor is at the top line of the scrolling region, the cursor is wrapped to the right-most column of the bottom line of the scrolling region. If the cursor is at the top line of the terminal window, the cursor is wrapped to the right-most column of the bottom line of the terminal window.46Enable logging. When logging is enabled, all text received from the child process is logged to a file.
π Esc [ ? pi l β ( RM) DEC private mode reset
This escape sequence sets DEC private modes. Valid supported values of pi are:
1( DECCKM) Disable cursor keys mode. When cursor keys mode is disabled, the arrow keys send ANSI cursor sequences to the host.3( DECCOLM) Disable 132-column mode. When 132-column mode is disabled, the number of columns in the terminal window is changed to 80. When entering into 80-column mode, the left, right, top, and bottom margins are reset to their default positions and the display is cleared.4( DECSCLM) Disable smooth scrolling. When smooth scrolling is disabled, lines are added and the screen is scrolled up to a full screen at a time depending on how fast text is received from the child process.5( DECSCNM) Disable reverse video. When reverse video mode is disabled, the foreground and background colors of the terminal window are not reversed.6( DECOM) Disable origin mode. When origin mode is disabled, the home cursor position is the upper-left corner of the screen. The starting point for line numbers is independent of the current top margin. The cursor can be moved outside the top and bottom margins.7( DECAWM) Disable autowrap. When autowrap mode is enabled, characters received when the cursor is at the right-most column of the page, replace the character already on the line.8( DECARM) Disable auto-repeat keys. This option is ignored.25( DECTCEM) Disable cursor visible. In this mode, the text cursor is invisible.40Disable DECCOLM escape sequence. When the DECCOLM escape sequence is disabled, the terminal emulator ignores the DECCOLM escape sequence and does not switch into either an 80- or 132-column window when it is received.44Disable margin bell. When the margin bell is disabled, thedttermutility's bell is not invoked when the cursor is a pre-defined distance from the right margin and a key is pressed.45Disable reverse-autowrap mode. When reverse-autowrap mode is disabled, and a backspace is received when the cursor is at the left-most column of the page, the cursor remains at that position.46Disable logging. When logging is disabled, text received from the child process is not logged to a file.
π Esc [ ? pi r β restore DEC private mode values
The value corresponding to mode pi previously saved is restored. Valid values for pi are the same as the DEC private modes supported by SM. It is provided to maintain backward compatibility with xterm(1).
β Using this escape sequence is discouraged. Like, it exists, but don't make it your whole personality, ok?
π«Ά Esc [ ? pi s β save DEC private mode values
The value corresponding to mode pi is saved. Valid values for pi are the same as the DEC private modes supported by SM. This escape sequence is provided to maintain backward compatibility with xterm(1).
β Using this escape sequence is discouraged. Same vibe check as above, bestie.
π Esc ] p1 ; p2 &<control>-G β set text parameters
This escape sequence allows various terminal emulator text values to be set. Valid supported values of p1 are:
0Change the icon name and window title to the string p2.1Change the icon name to the string p2.2Change the window title to the string p2.3Set the current working directory to the string p2. The terminal emulator tries to restart in this directory when it is restarted in a new session.
π Esc β message Esc Backslash β ( PM) privacy message
The data received in a privacy message is ignored and is not displayed. iykyk, it's giving "we don't see it, we don't talk about it" π
π§ Esc _ pi Esc Backslash β ( APC) application program command
The terminal emulator implements no APC functions. The data is ignored and is not displayed.
π Esc [ ? pi K β ( DECSEL) selective erase in line
The default value is 0. This escape sequence only erases erasable characters in a single line of text. Only those characters defined as erasable by the DECSCA escape sequence are erased. A parameter value of 0 erases from the cursor to the end of the line. A parameter value of 1 erases from the beginning of the line to the cursor position, inclusive. A parameter value of 2 erases the complete line.
β Esc [ ? pi J β ( DECSED) selective erase in display
The default value is 0. This escape sequence only erases erasable characters in the display. Only those characters defined as erasable by the DECSCA escape sequence are erased. A parameter value of 0 erases from the cursor to the end of the display. A parameter value of 1 erases from the beginning of the display to the cursor position, inclusive. A parameter value of 2 erases the complete display.
Esc ] l text Esc Backslashβ set the window title to text.Esc ] I file Esc Backslashβ set the icon to the icon found in file.Esc ] L label Esc Backslashβ set the icon name to label.
π¦ Esc [ ! p β ( DECSTR) soft terminal reset
This function performs a soft reset. For additional information, see the ``Reset'' section in this man page. (Spoiler: it's literally the next section, scrolling is free π)
β¨ Reset β¨
The dtterm(1) utility supports two levels of reset: full reset and soft reset. Reset can be invoked by menu buttons, the keyboard or by escape sequences.
Soft reset performs the following actions:
- Turns on the text cursor ( DECTCEM )
- Enables replace mode ( IRM)
- Turns off origin mode ( DECOM)
- Turns on autowrap ( DECAWM)
- Turns off reverse wrap β no backwards-wrapping nonsense, we don't do that here π
- Unlocks the keyboard (
KAM) β the keyboard is free again π - Sets the cursor keypad mode to normal (
DECCKM) - Sets the numeric keypad mode to numeric (
DECNKM) - Sets the top and bottom margins to the first and last lines of the window (
DECSTBM) - Sets all character sets (
GL,G0,G1,G2andG3) to ASCII β everybody back to plain ASCII, no cap π - Turns off all character attributes (
SGR) β bold, underline, all of it, gone π - Sets selective erase mode off (
DECSCA) - Clears any cursor state information saved with save cursor (
DECSC)
Then full reset does literally everything soft reset does, plus these extra actions:
- Cursor is moved to the home position π
- Clears the screen β poof, empty screen era β¨
- Clears user defined keys (
DECUDK) - Turns off reverse video (
DECSCNM) - Turns off auto linefeed mode (
LNM) - Turns on jump scroll (
DECSCLM)
β¨ Transmitted Escape Sequences β¨
π« Cursor Key Mode π«
Bestie, the cursor keys send different escape sequences depending on which mode you're in β and that mode gets set either by the appCursorDefault resource or by the mode specified via the DECCKM escape sequence. Two vibes, same keys:
- Cursor Up β
Esc [ Ain normal,Esc O Ain application - Cursor Down β
Esc [ Bin normal,Esc O Bin application - Cursor Right β
Esc [ Cin normal,Esc O Cin application - Cursor Left β
Esc [ Din normal,Esc O Din application
πΉ Application Keypad Mode πΉ
Same situation but for the keypad: the application keypad transmits different escape sequences depending on the setting of the mode, which is specified either via the appKeypadDefault resource or the mode specified via the DECPNM escape sequence. Here's the whole lineup π«Ά
- Space β
Spacein numeric,Esc O Ain application - Tab β
Tabin numeric,Esc O Iin application - Enter β
CRin numeric,Esc O Min application - PF1 β
Esc O Pin numeric,Esc O Pin application - PF2 β
Esc O Qin numeric,Esc O Qin application - PF3 β
Esc O Rin numeric,Esc O Rin application - PF4 β
Esc O Sin numeric,Esc O Sin application *(multiply) β*in numeric,Esc O jin application+(add) β+in numeric,Esc O kin application,(comma) β,in numeric,Esc O lin application-(minus) β-in numeric,Esc O min application/(divide) β/in numeric,Esc O oin application0β0in numeric,Esc O pin application1β1in numeric,Esc O qin application2β2in numeric,Esc O rin application3β3in numeric,Esc O sin application4β4in numeric,Esc O tin application5β5in numeric,Esc O uin application6β6in numeric,Esc O vin application7β7in numeric,Esc O win application8β8in numeric,Esc O xin application9β9in numeric,Esc O yin application=(equal) β=in numeric,Esc O Xin application
πΈ ANSI Function Keys πΈ
These are the escape sequences the function keys transmit β unless Sun function keys mode has been selected, either via the dtterm -sk option, or the sunFunctionKeys resource in dtterm(1) or the DtTerm widget. Everything you need, nobody left out π
- F1 β
Esc [ 1 1 ~ - F2 β
Esc [ 1 2 ~ - F3 β
Esc [ 1 3 ~ - F4 β
Esc [ 1 4 ~ - F5 β
Esc [ 1 5 ~ - F6 β
Esc [ 1 7 ~ - F7 β
Esc [ 1 8 ~ - F8 β
Esc [ 1 9 ~ - F9 β
Esc [ 2 0 ~ - F10 β
Esc [ 2 1 ~ - F11 β
Esc [ 2 3 ~ - F12 β
Esc [ 2 4 ~ - F13 β
Esc [ 2 5 ~ - F14 β
Esc [ 2 6 ~ - F15 β
Esc [ 2 8 ~ - F16 β
Esc [ 2 9 ~ - F17 β
Esc [ 3 1 ~ - F18 β
Esc [ 3 2 ~ - F19 β
Esc [ 3 3 ~ - F20 β
Esc [ 3 4 ~ - Help β
Esc [ 2 8 ~ - Menu β
Esc [ 2 9 ~ - Find β
Esc [ 1 ~ - Insert β
Esc [ 2 ~ - Delete β
Esc [ 3 ~ - Remove β
Esc [ 3 ~ - Select β
Esc [ 4 ~ - Prior β
Esc [ 5 ~ - Next β
Esc [ 6 ~
π Sun Function Keys π
And if Sun function keys mode is on, these are the sequences instead β yes there are a lot of them, yes we're doing all of them, no I will not be skipping any π
- F1 β
Esc [ 2 2 4 z - F2 β
Esc [ 2 2 5 z - F3 β
Esc [ 2 2 6 z - F4 β
Esc [ 2 2 7 z - F5 β
Esc [ 2 2 8 z - F6 β
Esc [ 2 2 9 z - F7 β
Esc [ 2 3 0 z - F8 β
Esc [ 2 3 1 z - F9 β
Esc [ 2 3 2 z - F10 β
Esc [ 2 3 3 z - F11 β
Esc [ 1 9 2 z - F12 β
Esc [ 1 9 3 z - F13 β
Esc [ 1 9 4 z - F14 β
Esc [ 1 9 5 z - F15 β
Esc [ 1 9 6 z - F16 β
Esc [ 1 9 7 z - F17 β
Esc [ 1 9 8 z - F18 β
Esc [ 1 9 9 z - F19 β
Esc [ 2 0 0 z - F20 β
Esc [ 2 0 1 z - F21 (R1) β
Esc [ 2 0 8 z - F22 (R2) β
Esc [ 2 0 9 z - F23 (R3) β
Esc [ 2 1 0 z - F24 (R4) β
Esc [ 2 1 1 z - F25 (R5) β
Esc [ 2 1 2 z - F26 (R6) β
Esc [ 2 1 3 z - F27 (R7) β
Esc [ 2 1 4 z - F28 (R8) β
Esc [ 2 1 5 z - F29 (R9) β
Esc [ 2 1 6 z - F30 (R10) β
Esc [ 2 1 7 z - F31 (R11) β
Esc [ 2 1 8 z - F32 (R12) β
Esc [ 2 1 9 z - F33 (R13) β
Esc [ 2 2 0 z - F34 (R14) β
Esc [ 1 2 1 z - F35 (R15) β
Esc [ 1 2 2 z - Help β
Esc [ 1 9 6 z - Menu β
Esc [ 1 9 7 z - Find β
Esc [ 1 z - Insert β
Esc [ 2 z - Delete β
Esc [ 3 z - Remove β
Esc [ 3 z - Select β
Esc [ 4 z - Prior β
Esc [ 5 z - Next β
Esc [ 6 z - Caret β listed in the original with no escape sequence next to it, bestie, so I'm not gonna make one up π
π¦ SEE ALSO π¦
Go read these too, they're iconic:
dtterm(1)DtCreateTerm(3)xterm(1)dtterm(1)β yes it's listed twice in the original, and yes I'm keeping it twice π
That's the whole page, bestie! π This one's from the dtterm file formats corner of the manual, and the copy we were reading was dated dtterm(file formats) β go off, you now know more about terminal escape sequences than most people will learn in a lifetime. Slay π β¨
π¦ where this page comes from
- nixos 26.05: cde 2.5.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms