This document covers the technical aspects of Eterm, including escape sequences
it supports, "under-the-hood" descriptions of certain Eterm features, etc.
Portions of this document were taken from the XTerm documentation.
| Sequence |
Function |
| ESC { ( | ) | * | + | $ } { 0 | A | B } |
Select ISO 2022 character sets.
- ( sets the G0 character set
- ) sets the G1 character set
- * sets the G2 character set
- + sets the G3 character set
- $ sets the Kanji character set
- 0 uses the DEC Special Character and Line Drawing set
- A uses the United Kingdom (UK) character set
- B uses the United States (USASCII) character set
|
| ESC 7 |
Save cursor (SC) |
| ESC 8 |
Restore cursor (RC) |
| ESC = |
Application Keypad (SMKX) |
| ESC > |
Numeric Keypad (RMKX) |
| ESC @ |
Discards the subsequent character |
| ESC D |
Index (IND) |
| ESC E |
Next Line (NEL) |
| ESC G |
Graphics (an rxvt extension). Eterm replies to ESC G
Q (query graphics) with ESC G 0 (no
graphics available) and ignores all other graphics
sequences. |
| ESC H |
Tab Set (HTS) |
| ESC M |
Reverse Index (RI) |
| ESC Z |
Obselete form of Send Device Attributes (DA), which is ESC [ c |
| ESC [ [ n ] @ |
Insert n blank Characters (ICH). Default for n is 1. |
| ESC [ [ n ] A |
Cursor Up n times (CUU), default 1 |
| ESC [ [ n ] B |
Cursor Down n times (CUD), default 1 |
| ESC [ [ n ] C |
Cursor Forward n times (CUF), default 1 |
| ESC [ [ n ] D |
Cursor Backward n times (CUB), default 1 |
| ESC [ [ n ] E |
Cursor Down n times and to first column, default 1 |
| ESC [ [ n ] F |
Cursor Up n times and to first column, default 1 |
| ESC [ [ n ] G |
Cursor to Column n (HPA) |
| ESC [ [ r ; c ] H |
Cursor Position [row;column] (CUP), default 1;1 |
| ESC [ [ n ] I |
Move forward n tab stops, default 1 |
| ESC [ [ n ] J |
Erase in Display (ED)
- n == 0: Clear Below (default)
- n == 1: Clear Above
- n == 2: Clear All
|
| ESC [ [ n ] K |
Erase in Line (EL)
- n == 0: Clear to Right (default)
- n == 1: Clear to Left (EL1)
- n == 2: Clear All
|
| ESC [ [ n ] L |
Insert n lines (IL), default 1 |
| ESC [ [ n ] M |
Delete n lines (DL), default 1 |
| ESC [ [ n ] P |
Delete n characters (DCH), default 1 |
| ESC [ [ n ] W |
Tabulator functions
- n == 0: Tab Set (HTS)
- n == 2: Tab Clear (TBC), clear current column
- n == 5: Tab Clear (TBC), clear all
|
| ESC [ [ n ] X |
Erase n characters (ECH), default 1 |
| ESC [ [ n ] Z |
Move backward n tabstops, default 1 |
| ESC [ [ n ] ` |
Same as ESC [ n G (HPA) |
| ESC [ [ n ] a |
Same as ESC [ n C (CUF) |
| ESC [ [ n ] c |
Send Device Attributes (DA), default of 0 returns
"ESC[?1;2c" indicating a VT100 with advanced video option
|
| ESC [ [ n ] d |
Cursor to line n (VPA) |
| ESC [ [ n ] e |
Same as ESC [ n A (CUU) |
| ESC [ [ r ; c ] f |
Horizontal and Vertical Position (HVP), default 1;1 |
| ESC [ [ n ] g |
Tab Clear
- n == 0: Tab Clear (TBC), clear current column (default)
- n == 3: Tab Clear (TBC), clear all
|
| ESC [ [ n ] i |
Printing
- n == 4: Disable transparent print mode (MC4)
- n == 5: Enable transparent print mode (MC5)
|
| ESC [ n [ ; n ... ] { h | l } |
- h: Set Mode (SM)
- l: Reset Mode (RM)
- n == 4: Insert Mode (SMIR)/Replace Mode (RMIR)
- n == 20: Automatic Newline/Normal Linefeed (LNM)
|
| ESC [ n [ ; n ... ] m |
Character Attributes (SGR)
- n == 0: Normal (default)
- n == 1/22: Turn bold (bright fg) on/off
- n == 4/24: Turn underline on/off
- n == 5/25: Turn "blink" (bright bg) on/off
- n == 7/27: Turn inverse on/off
- n == 30/40: foreground/background black
- n == 31/41: foreground/background red
- n == 32/42: foreground/background green
- n == 33/43: foreground/background yellow
- n == 34/44: foreground/background blue
- n == 35/45: foreground/background magenta
- n == 36/46: foreground/background cyan
- n == 37/47: foreground/background white
- n == 39/49: foreground/background default
|
| ESC [ [ n ] n |
Device Status Report (DSR)
- n == 5: Status Report, returns "ESC[0n"
("OK")
- n == 6: Report Cursor Position (CPR) as
"ESC[r;cR"
- n == 7: Request display name (ignored by default for
security reasons)
- n == 8: Request version number in window title
- n == 9: Display pixmap/transparency status in
window title (See
below.)
|
| ESC [ [ t ; b ] r |
Set Scrolling Region (CSR), where t is the top row and b is
the bottom row, defaults to the full screen |
| ESC [ ? n [ ; n ... ] { h | l | s | r | t } |
DEC Private Modes (shown as set/reset)
- h: Set Private Mode (DECSET)
- l: Reset Private Mode (DECRST)
- s: Save all DEC Private Mode values
- r: Restore previously-saved DEC Private Mode values
- t: Toggle Private Mode (rxvt/Eterm extension)
- n == 1: Application/Normal cursor keys (DECCKM)
- n == 3: 132/80 column mode (DECCOLM)
- n == 4: Smooth/Jump scrolling (DECSCLM) [not yet implemented]
- n == 5: Reverse/Normal video (DECSCNM)
- n == 6: Origin/Normal cursor mode (DECOM)
- n == 7: Wraparound mode on/off (DECAWM)
- n == 9: (X10 Xterm mouse reporting) Do/Don't send mouse
coords on button press (see below)
- n == 25: Visible/invisible cursor
- n == 30: Toggle scrollbar on/off (rxvt/Eterm extension)
- n == 35: Allow/Disallow xterm shift+key sequences (rxvt/Eterm extension)
- n == 40: Allow/Disallow 80 <--> 132 mode
- n == 47: Use Alternate/Normal screen buffer
- n == 66: Application/Normal keypad (DECPAM)
- n == 67: Backspace key sends BS/DEL (DECBKM)
- n == 1000: (X11 Xterm mouse reporting) Do/Don't send mouse
coords on button press and release (see
below)
- n == 1010: Scroll to bottom on tty output
- n == 1012: Scroll to bottom on tty input
|
| ESC [ n [ ; n [ ... ] ] t |
Window Operations
- n == 1: Un-iconify window
- n == 2: Iconify window
- n == 3: Move window. Must by followed by
;x;y
- n == 4: Resize window. Must by followed by
;height;width
- n == 5: Raise window
- n == 6: Lower window
- n == 7: Refresh window
- n == 8: Resize text area. Must by followed by
;height;width,
with height and width given in
characters.
- n == 11: Report icon state. (not implemented)
- n == 13: Report window position as
ESC[3;x;yt
- n == 14: Report window size in pixels as
ESC[4;height;widtht
- n == 18: Report text area size in characters as
ESC[4;height;widtht
- n == 20: Report icon name as
ESC]LnameESC\
- n == 21: Report window title as
ESC]ltitleESC\
|
| ESC ] n ; string BEL |
Set X Terminal Parameters
- n == 0: Change icon name and window title to string
- n == 1: Change icon name to string
- n == 2: Change window title to string
- n == 3: Set text property string (format: var=value)
- n == 5: Steal input focus and raise window (See
below.)
- n == 6: Eterm-specific escape sequences (See
below.)
- n == 10: Set foreground color to string.
If additional semicolon-delimited
string values are specified,
continue with n == 11.
- n == 11: Set background color to string.
If additional semicolon-delimited
string values are specified,
continue with n == 12.
- n == 12: Set cursor color to string.
If additional semicolon-delimited
string values are specified,
continue with n == 13.
- n == 13: Set mouse pointer color to string.
If additional semicolon-delimited
string values are specified,
continue with n == 14.
- n == 14: Ignore string.
If additional semicolon-delimited
string values are specified,
continue with n == 15.
- n == 15: Ignore string.
If additional semicolon-delimited
string values are specified,
continue with n == 16.
- n == 16: Ignore string.
If additional semicolon-delimited
string values are specified,
continue with n == 17.
- n == 17: Ignore string.
If additional semicolon-delimited
string values are specified,
continue with n == 18.
- n == 18: Set bold color to string.
Eterm extension (see below).
If additional semicolon-delimited
string values are specified,
continue with n == 19.
- n == 19: Set underline color to string.
Eterm extension (see below).
- n == 20: Image commands (see below)
- n == 30: Dump contents of scrollback to file
string. (Disabled by default.)
- n == 39: Set the default foreground color to string
- n == 49: Set the default background color to string
- n == 50: Set font to string. rxvt/Eterm extensions:
- string == "#+n": Change font up by n, default 1
- string == "#-n": Change font down by n, default 1
- string empty: Change to font 0
- string == "#n": Change to font n
|
| ESC ] { l | L | I } string ESC \ |
- l: Change window title to string
- L: Change icon name to string
- I: Read new icon image from file whose path is string
|
| ESC ] P n rr gg bb |
Changes terminal color n ('0' through 'f') to the color
represented by the RGB values rr, gg, and
bb. (Compatible with Linux console.) |
| ESC ] R |
Restores the original palette. (Compatible with Linux
console.) |
| ESC c |
Full Reset (RIS) |
| ESC n |
Invoke the G2 character set (LS2) |
| ESC o |
Invoke the G3 character set (LS3) |
| String |
Function |
| Adjusting scaling and position |
| WxH+X+Y |
Set scaling to W% by H%, and position to X%
by Y%. W and H are percentages of the
terminal window size. X and Y are also
percentages; e.g., +50+50 centers the image in the
window. |
| WxH+X |
Assumes Y == X |
| WxH |
Assumes Y == X == 50 (centers the image) |
| W+X+Y |
Assumes H == W |
| W+X |
Assumes H == W and Y == X |
| W |
Assumes H == W and Y == X == 50 |
| Adjusting position only |
| =+X+Y |
Set position to X% by Y% (absolute). |
| =+X |
Set position to X% by X%. |
| +X+Y |
Adjust position horizontally X% and vertically Y% from
current position (relative). |
| +X+X |
Adjust position horizontally X% and vertically X% from
current position. |
| Adjusting scale only |
| Wx0 |
Multiply horizontal scaling factor by W% |
| 0xH |
Multiply vertical scaling factor by H% |
| 0x0 |
No scaling (show image at normal size). |
| Pixmap Operations |
| tile |
Tile image. Scaling/position modifiers above will affect the
tile size and origin. |
| propscale |
When scaling, scale proportionally. That is, maintain the
proper aspect ratio for the image. Any portion of the
background not covered by the image is filled with the current
background color. |
When Eterm receives a mouse reporting request (and if mouse reporting is
currently enabled), it replies with the sequence
"ESC[Mbxy". The values for b, x, and
y are as follows (subtract the value of space ' ' first):