
 Xterm Control Sequences
 Edward Moy
 University of California, Berkeley
 Revised by
 Stephen Gildea
 X Consortium

For example, the move cursor entry appears as:
      ESC [ Ps ; Ps H
        Cursor Position [row;column] (default = [1,1]) (CUP)
In assembler this would translate to:
      db 1bh	;esc
      db "["
      db "01"	;row 01
      db ";"	;separator character
      db "04"	;column 4
      db "H"	;end of sequence and type code character

Definitions
c     The literal character c.
C     A single (required) character.
Ps   A single (usually optional) numeric parameter, composed of one of
      more digits.
Pm   A multiple numeric parameter composed of any number of single
      numeric parameters, separated by ; character(s).
Pt   A text parameter composed of printable characters.

The asmref file "ascii" describes the codes for special characters.
For example: ctrl-G or the Bell character is 07h (hex 07).      
 
VT100 Mode
Most of these control sequences are standard VT102 control sequences,
but there are some sequences here from later DEC VT terminals, too.
VT102 features not supported are smooth scrolling, double size
characters, blinking characters, and VT52 mode. There are additional control
sequences to provide xterm-dependent functions, like the scrollbar or
window size. Where the function is specified by DEC or ISO 6429, the
code assigned to it is given in parentheses. The escape codes to
designate and invoke character sets are specified by ISO 2022; see that
document for a discussion of character sets.

BEL Bell (Ctrl-G)
BS Backspace (Ctrl-H)
TAB Horizontal Tab (HT) (Ctrl-I)
LF Line Feed or New Line (NL) (Ctrl-J)
VT Vertical Tab (Ctrl-K) same as LF
FF Form Feed or New Page (NP) (Ctrl-L) same as LF
CR Carriage Return (Ctrl-M)
SO Shift Out (Ctrl-N) <->> Switch to Alternate Character Set: invokes

 the G1 character set.

SI Shift In (Ctrl-O) <->> Switch to Standard Character Set: invokes the
 G0 character set (the default).

ESC # 8
 DEC Screen Alignment Test (DECALN)

ESC ( C
 Designate G0 Character Set (ISO 2022)
  C = 0 <->> DEC Special Character and Line Drawing Set
  C = A <->> United Kingdom (UK)
  C = B <->> United States (USASCII)

ESC ) C
 Designate G1 Character Set (ISO 2022)
  C = 0 <->> DEC Special Character and Line Drawing Set
  C = A <->> United Kingdom (UK)
  C = B <->> United States (USASCII)

ESC * C
 Designate G2 Character Set (ISO 2022)
  C = 0 <->> DEC Special Character and Line Drawing Set
  C = A <->> United Kingdom (UK)
  C = B <->> United States (USASCII)

ESC + C
 Designate G3 Character Set (ISO 2022)
  C = 0 <->> DEC Special Character and Line Drawing Set
  C = A <->> United Kingdom (UK)
  C = B <->> United States (USASCII)

ESC 7
 Save Cursor (DECSC)

ESC 8
 Restore Cursor (DECRC)

ESC =
 Application Keypad (DECPAM)

ESC >
 Normal Keypad (DECPNM)

ESC D
 Index (IND)

ESC E
 Next Line (NEL)

ESC F
 Cursor to lower left corner of screen (if enabled by the
 hpLowerleftBugCompat resource).

ESC H
 Tab Set (HTS)

ESC M
 Reverse Index (RI)

ESC N
 Single Shift Select of G2 Character Set (SS2): affects next character only

ESC O
 Single Shift Select of G3 Character Set (SS3): affects next charac ter only

ESC P Pt ESC \
 Device Control String (DCS)
  xterm implements no DCS functions; Pt is ignored. Pt need not be
 printable characters.

ESC Z
 Return Terminal ID (DECID). Obsolete form of ESC [ c (DA).

ESC [ Ps @
 Insert Ps (Blank) Character(s) (default = 1) (ICH)

ESC [ Ps A
 Cursor Up Ps Times (default = 1) (CUU)

ESC [ Ps B
 Cursor Down Ps Times (default = 1) (CUD)

ESC [ Ps C
 Cursor Forward Ps Times (default = 1) (CUF)

ESC [ Ps D
 Cursor Backward Ps Times (default = 1) (CUB)

ESC [ Ps ; Ps H
 Cursor Position [row;column] (default = [1,1]) (CUP)

ESC [ Ps J
 Erase in Display (ED)
  Ps = 0 <->> Clear Below (default)
  Ps = 1 <->> Clear Above
  Ps = 2 <->> Clear All

ESC [ Ps K
 Erase in Line (EL)
  Ps = 0 <->> Clear to Right (default)
  Ps = 1 <->> Clear to Left
  Ps = 2 <->> Clear All

ESC [ Ps L
 Insert Ps Line(s) (default = 1) (IL)

ESC [ Ps M
 Delete Ps Line(s) (default = 1) (DL)

ESC [ Ps P
 Delete Ps Character(s) (default = 1) (DCH)

ESC [ Ps ; Ps ; Ps ; Ps ; Ps T
 Initiate hilite mouse tracking. Parameters are
 [func;startx;starty;firstrow;lastrow]. See the section Mouse
 Tracking.

ESC [ Ps c
 Send Device Attributes (DA)
  Ps = 0 or omitted <->> request attributes from terminal
  <->> ESC [ ? 1 ; 2 c (``I am a VT100 with Advanced Video
 Option.'')

ESC [ Ps ; Ps f
 Horizontal and Vertical Position [row;column] (default = [1,1])
 (HVP)

ESC [ Ps g
 Tab Clear (TBC)
  Ps = 0 <->> Clear Current Column (default)
  Ps = 3 <->> Clear All

ESC [ Pm h
 Set Mode (SM)
  Ps = 4 <->> Insert Mode (IRM)
  Ps = 2 0 <->> Automatic Newline (LNM)

ESC [ Pm l
 Reset Mode (RM)
  Ps = 4 <->> Replace Mode (IRM)
  Ps = 2 0 <->> Normal Linefeed (LNM)

ESC [ Pm m
 Character Attributes (SGR)
  Ps = 0 <->> Normal (default)
  Ps = 1 <->> Bold
  Ps = 4 <->> Underscore
  Ps = 5 <->> Blink (appears as Bold)
  Ps = 7 <->> Inverse

ESC [ Ps n
 Device Status Report (DSR)
  Ps = 5 <->> Status Report ESC [ 0 n (``OK'')
  Ps = 6 <->> Report Cursor Position (CPR) [row;column] as ESC [ r ;
 c R

ESC [ Ps ; Ps r
 Set Scrolling Region [top;bottom] (default = full size of window)
 (DECSTBM)

ESC [ Ps x
 Request Terminal Parameters (DECREQTPARM)

ESC [ ? Pm h
 DEC Private Mode Set (DECSET)
  Ps = 1 <->> Application Cursor Keys (DECCKM)
  Ps = 2 <->> Designate USASCII for character sets G0-G3. (In the
 VT102, this selects VT52 mode (DECANM), which xterm doesn't sup port.)
  Ps = 3 <->> 132 Column Mode (DECCOLM)
  Ps = 4 <->> Smooth (Slow) Scroll (DECSCLM)
  Ps = 5 <->> Reverse Video (DECSCNM)
  Ps = 6 <->> Origin Mode (DECOM)
  Ps = 7 <->> Wraparound Mode (DECAWM)
  Ps = 8 <->> Auto-repeat Keys (DECARM)
  Ps = 9 <->> Send Mouse X & Y on button press. See the section
 Mouse Tracking.
  Ps = 3 8 <->> Enter Tektronix Mode (DECTEK)
  Ps = 4 0 <->> Allow 80 <->> 132 Mode
  Ps = 4 1 <->> more(1) fix (see curses resource)
  Ps = 4 4 <->> Turn On Margin Bell
  Ps = 4 5 <->> Reverse-wraparound Mode
  Ps = 4 6 <->> Start Logging (normally disabled by a compile-time
 option)
  Ps = 4 7 <->> Use Alternate Screen Buffer (unless disabled by the
 titeInhibit resource)
  Ps = 1 0 0 0 <->> Send Mouse X & Y on button press and release.
 See the section Mouse Tracking.
  Ps = 1 0 0 1 <->> Use Hilite Mouse Tracking. See the section
 Mouse Tracking.

ESC [ ? Pm l
 DEC Private Mode Reset (DECRST)
  Ps = 1 <->> Normal Cursor Keys (DECCKM)
  Ps = 3 <->> 80 Column Mode (DECCOLM)
  Ps = 4 <->> Jump (Fast) Scroll (DECSCLM)
  Ps = 5 <->> Normal Video (DECSCNM)
  Ps = 6 <->> Normal Cursor Mode (DECOM)
  Ps = 7 <->> No Wraparound Mode (DECAWM)
  Ps = 8 <->> No Auto-repeat Keys (DECARM)
  Ps = 9 <->> Don't Send Mouse X & Y on button press
  Ps = 4 0 <->> Disallow 80 <->> 132 Mode
  Ps = 4 1 <->> No more(1) fix (see curses resource)
  Ps = 4 4 <->> Turn Off Margin Bell
  Ps = 4 5 <->> No Reverse-wraparound Mode
  Ps = 4 6 <->> Stop Logging (normally disabled by a compile-time
 option)
  Ps = 4 7 <->> Use Normal Screen Buffer
  Ps = 1 0 0 0 <->> Don't Send Mouse X & Y on button press and
 release
  Ps = 1 0 0 1 <->> Don't Use Hilite Mouse Tracking

ESC [ ? Pm r
 Restore DEC Private Mode Values. The value of Ps previously saved
 is restored. Ps values are the same as for DECSET.

ESC [ ? Pm s
 Save DEC Private Mode Values. Ps values are the same as for DEC SET.

ESC ] Ps ; Pt BEL
 Set Text Parameters
  Ps = 0 <->> Change Icon Name and Window Title to Pt
  Ps = 1 <->> Change Icon Name to Pt
  Ps = 2 <->> Change Window Title to Pt
  Ps = 4 6 <->> Change Log File to Pt (normally disabled by a com pile-time option)
  Ps = 5 0 <->> Set Font to Pt

ESC ^ Pt ESC \
 Privacy Message (PM)
  xterm implements no PM functions; Pt is ignored. Pt need not be
 printable characters.

ESC _ Pt ESC \
 Application Program Command (APC)
  xterm implements no APC functions; Pt is ignored. Pt need not be
 printable characters.

ESC c
 Full Reset (RIS)

ESC l
 Memory Lock (per HP terminals). Locks memory above the cursor.

ESC m
 Memory Unlock (per HP terminals)

ESC n
 Invoke the G2 Character Set (LS2)

ESC o
 Invoke the G3 Character Set (LS3)

ESC |
 Invoke the G3 Character Set as GR (LS3R). Has no visible effect in
 xterm.

ESC }
 Invoke the G2 Character Set as GR (LS2R). Has no visible effect in
 xterm.

ESC ~
 Invoke the G1 Character Set as GR (LS1R). Has no visible effect in
 xterm.

Mouse Tracking
The VT widget can be set to send the mouse position and other
information on button presses. These modes are typically used by editors and
other full-screen applications that want to make use of the mouse.

There are three mutually exclusive modes, each enabled (or disabled) by
a different parameter in the DECSET (or DECRST) escape sequence. Parameters
for all mouse tracking escape sequences generated by xterm encode
numeric parameters in a single character as value+040. For example, !
is 1. The screen coodinate system is 1-based.

X10 compatibility mode sends an escape sequence on button press encoding
the location and the mouse button pressed. It is enabled by specifying
parameter 9 to DECSET. On button press, xterm sends ESC [ M C bC xC y (6
characters). C b is button<->1. C x and C y are the x and y coordinates of
the mouse when the button was pressed.

Normal tracking mode sends an escape sequence on both button press and
release. Modifier information is also sent. It is enabled by specifying
parameter 1000 to DECSET. On button press or release, xterm sends
ESC [ M C bC xC y. The low two bits of C b encode button information: 0=MB1
pressed, 1=MB2 pressed, 2=MB3 pressed, 3=release. The upper bits encode
what modifiers were down when the button was pressed and are added
together. 4=Shift, 8=Meta, 16=Control. C x and C y are the x and y
coordinates of the mouse event. The upper left corner is (1,1).

Mouse hilite tracking notifies a program of a button press, receives a
range of lines from the program, highlights the region covered by the
mouse within that range until button release, and then sends the program
the release coordinates. It is enabled by specifying parameter 1001 to
DECSET. Warning: use of this mode requires a cooperating program or it
will hang xterm. On button press, the same information as for normal
tracking is generated; xterm then waits for the program to send mouse
tracking information. All X events are ignored until the proper escape
sequence is received from the pty: ESC [ Ps ; Ps ; Ps ; Ps ; Ps T . The
parameters are func, startx, starty, firstrow, and lastrow. func is
non-zero to initiate hilite tracking and zero to abort. startx and
starty give the starting x and y location for the highlighted region.
The ending location tracks the mouse, but will never be above row
firstrow and will always be above row lastrow. (The top of the screen
is row 1.) When the button is released, xterm reports the ending position
one of two ways: if the start and end coordinates are valid text
locations: ESC [ t C xC y. If either coordinate is past the end of the
line: ESC [ T C xC yC xC yC xC y. The parameters are startx, starty, endx,
endy, mousex, and mousey. startx, starty, endx, and endy give the
starting and ending character positions of the region. mousex and
mousey give the location of the mouse at button up, which may not be
over a character.

Tektronix 4014 Mode
Most of these sequences are standard Tektronix 4014 control sequences.
Graph mode supports the 12-bit addressing of the Tektronix 4014. The
major features missing are the write-thru and defocused modes. This
document does not describe the commands used in the various Tektronix
plotting modes but does describe the commands to switch modes.

BEL Bell (Ctrl-G)
BS Backspace (Ctrl-H)
TAB Horizontal Tab (Ctrl-I)
LF Line Feed or New Line (Ctrl-J)
VT Cursor up (Ctrl-K)
FF Form Feed or New Page (Ctrl-L)
CR Carriage Return (Ctrl-M)
ESC ETX Switch to VT100 Mode (ESC Ctrl-C)
ESC ENQ Return Terminal Status (ESC Ctrl-E)
ESC FF PAGE (Clear Screen) (ESC Ctrl-L)
ESC SO Begin 4015 APL mode (ignored by xterm) (ESC Ctrl-N)
ESC SI End 4015 APL mode (ignored by xterm) (ESC Ctrl-O)
ESC ETB COPY (Save Tektronix Codes to file COPYyy-mm-dd.hh:mm:ss)
 (ESC Ctrl-W)
ESC CAN Bypass Condition (ESC Ctrl-X)
ESC SUB GIN mode (ESC Ctrl-Z)
ESC FS Special Point Plot Mode (ESC Ctrl-\)
ESC 8 Select Large Character Set
ESC 9 Select #2 Character Set
ESC : Select #3 Character Set
ESC ; Select Small Character Set
ESC ] Ps ; Pt BEL
 Set Text Parameters of VT window
  Ps = 0 <->> Change Icon Name and Window Title to Pt
  Ps = 1 <->> Change Icon Name to Pt
  Ps = 2 <->> Change Window Title to Pt
  Ps = 4 6 <->> Change Log File to Pt (normally disabled
 by a compile-time option)
ESC <ga> Normal Z Axis and Normal (solid) Vectors
ESC a Normal Z Axis and Dotted Line Vectors
ESC b Normal Z Axis and Dot-Dashed Vectors
ESC c Normal Z Axis and Short-Dashed Vectors
ESC d Normal Z Axis and Long-Dashed Vectors
ESC h Defocused Z Axis and Normal (solid) Vectors
ESC i Defocused Z Axis and Dotted Line Vectors
ESC j Defocused Z Axis and Dot-Dashed Vectors
ESC k Defocused Z Axis and Short-Dashed Vectors
ESC l Defocused Z Axis and Long-Dashed Vectors
ESC p Write-Thru Mode and Normal (solid) Vectors
ESC q Write-Thru Mode and Dotted Line Vectors
ESC r Write-Thru Mode and Dot-Dashed Vectors
ESC s Write-Thru Mode and Short-Dashed Vectors
ESC t Write-Thru Mode and Long-Dashed Vectors
FS Point Plot Mode (Ctrl-\)
GS Graph Mode (Ctrl-])
RS Incremental Plot Mode (Ctrl-^)
US Alpha Mode (Ctrl-_)

----------------------------------------------------------------------------
The following is a summary of Common xterm control codes.  This
duplicates the previous material in a condensed form.
------------------------------------------------------------------------------
BEL		Bell (Ctrl-G)
BS		Backspace (Ctrl-H)
HT		Horizontal Tab (Ctrl-I)
NL		Line Feed or New Line (Ctrl-J)
VT		Vertical Tab (Ctrl-K)
NP		Form Feed or New Page (Ctrl-L)
CR		Carriage Return (Ctrl-M)
SO		Shift Out (Ctrl-N) -> Switch to Alternate Character Set
SI		Shift In (Ctrl-O) -> Switch to Standard Character Set
ESC BEL		(Same as non-escaped BEL)
ESC BS		(Same as non-escaped BS)
ESC HT		(Same as non-escaped HT)
ESC NL		(Same as non-escaped NL)
ESC VT		(Same as non-escaped VT)
ESC NP		(Same as non-escaped NP)
ESC CR		(Same as non-escaped CR)
ESC SO		(Same as non-escaped SO)
ESC SI		(Same as non-escaped SI)
ESC # BEL	(Same as non-escaped BEL)
ESC # BS	(Same as non-escaped BS)
ESC # HT	(Same as non-escaped HT)
ESC # NL	(Same as non-escaped NL)
ESC # VT	(Same as non-escaped VT)
ESC # NP	(Same as non-escaped NP)
ESC # CR	(Same as non-escaped CR)
ESC # SO	(Same as non-escaped SO)
ESC # SI	(Same as non-escaped SI)
ESC # 8		DEC Screen Alignment Test (DECALN)
ESC ( BEL	(Same as non-escaped BEL)
ESC ( BS	(Same as non-escaped BS)
ESC ( HT	(Same as non-escaped HT)
ESC ( NL	(Same as non-escaped NL)
ESC ( VT	(Same as non-escaped VT)
ESC ( NP	(Same as non-escaped NP)
ESC ( CR	(Same as non-escaped CR)
ESC ( SO	(Same as non-escaped SO)
ESC ( SI	(Same as non-escaped SI)
ESC ( C		Select G0 Character Set (SCS)
		C = 0 -> Special Character and Line Drawing Set
		C = 1 -> Alternate Character ROM Standard Set
		C = 2 -> Alternate Character ROM Special Set
		C = A -> United Kingdom (UK)
		C = B -> United States (USASCII)
ESC ) C		Select G1 Character Set (SCS)
		C takes same values as above
ESC * C		Select G2 Character Set (SCS)
		C takes same values as above
ESC + C		Select G3 Character Set (SCS)
		C takes same values as above
ESC 7		Save Cursor (DECSC)
ESC 8		Restore Cursor (DECRC)
ESC =		Application Keypad (DECPAM)
ESC >		Normal Keypad (DECNM)
ESC D		Index (IND)
ESC E		Next Line (NEL)
ESC H		Tab Set (HTS)
ESC M		Reverse Index (RI)
ESC N		Single Shift Select of G2 Character Set (SS2)
ESC O		Single Shift Select of G3 Character Set (SS3)
ESC [ BEL	(Same as non-escaped BEL)
ESC [ BS	(Same as non-escaped BS)
ESC [ HT	(Same as non-escaped HT)
ESC [ NL	(Same as non-escaped NL)
ESC [ VT	(Same as non-escaped VT)
ESC [ NP	(Same as non-escaped NP)
ESC [ CR	(Same as non-escaped CR)
ESC [ SO	(Same as non-escaped SO)
ESC [ SI	(Same as non-escaped SI)
ESC [ ? BEL	(Same as non-escaped BEL)
ESC [ ? BS	(Same as non-escaped BS)
ESC [ ? HT	(Same as non-escaped HT)
ESC [ ? NL	(Same as non-escaped NL)
ESC [ ? VT	(Same as non-escaped VT)
ESC [ ? NP	(Same as non-escaped NP)
ESC [ ? CR	(Same as non-escaped CR)
ESC [ ? SO	(Same as non-escaped SO)
ESC [ ? SI	(Same as non-escaped SI)
ESC [ ? Ps h	DEC Private Mode Set (DECSET)
		Ps = 1 -> Application Cursor Keys (DECCKM)
		Ps = 2 -> Set VT52 Mode
		Ps = 3 -> 132 Column Mode (DECCOLM)
		Ps = 4 -> Smooth (Slow) Scroll (DECSCLM)
		Ps = 5 -> Reverse Video (DECSCNM)
		Ps = 6 -> Origin Mode (DECOM)
		Ps = 7 -> Wraparound Mode (DECAWM)
		Ps = 8 -> Auto-Repeat Keys (DECARM)
		Ps = 9 -> Send MIT Mouse Row & Column on Button
			  Press
		Ps = 38 -> Enter Tektronix Mode (DECTEK)
		Ps = 40 -> Allow 80 <-> 132 Mode
		Ps = 41 -> curses(5) fix
		Ps = 44 -> Turn on Margin Bell
		Ps = 45 -> Reverse-wraparound Mode
		Ps = 46 -> Start Logging
		Ps = 47 -> Use Alternate Screen Buffer
		Ps = 1000 -> xtem bogus sequence (???)
		Ps = 1001 -> xtem sequence w/hilite tracking (???)
ESC [ ? Ps l	DEC Private Mode Reset (DECRST)
		Ps = 1 -> Normal Cursor Keys (DECCKM)
		Ps = 3 -> 80 Column Mode (DECCOLM)
		Ps = 4 -> Jump (Fast) Scroll (DECSCLM)
		Ps = 5 -> Normal Video (DECSCNM)
		Ps = 6 -> Normal Cursor Mode (DECOM)
		Ps = 7 -> No Wraparound Mode (DECAWM)
		Ps = 8 -> No Auto-Repeat Keys (DECARM)
		Ps = 9 -> Don't Send MIT Mouse Row & Column on
			  Button Press
		Ps = 40 -> Don't Allow 80 <-> 132 Mode
		Ps = 41 -> No curses(5) fix
		Ps = 44 -> Turn Off Margin Bell
		Ps = 45 -> No Reverse-wraparound Mode
		Ps = 46 -> Stop Logging
		Ps = 47 -> Use Normal Screen Buffer
		Ps = 1000 -> xtem bogus sequence (???)
		Ps = 1001 -> xtem sequence w/hilite tracking (???)
ESC [ ? Ps r	Restore DEC Private Mode
		Ps = 1 -> Normal/Application Cursor Keys (DECCKM)
		Ps = 3 -> 80/132 Column Mode (DECCOLM)
		Ps = 4 -> Jump (Fast)/Smooth (Slow) Scroll (DECSCLM)
		Ps = 5 -> Normal/Reverse Video (DECSCNM)
		Ps = 6 -> Normal/Origin  Cursor Mode (DECOM)
		Ps = 7 -> No Wraparound/Wraparound Mode (DECAWM)
		Ps = 8 -> Auto-repeat/No Auto-repeat Keys (DECARM)
		Ps = 9 -> Don't Send/Send MIT Mouse Row & Column on
			  Button Press
		Ps = 40 -> Disallow/Allow 80 <-> 132 Mode
		Ps = 41 -> Off/On curses(5) fix
		Ps = 44 -> Turn Off/On Margin Bell
		Ps = 45 -> No Reverse-wraparound/Reverse-wraparound
			   Mode 
		Ps = 46 -> Stop/Start Logging
		Ps = 47 -> Use Normal/Alternate Screen Buffer
		Ps = 1000 -> mouse bogus sequence (???)
		Ps = 1001 -> mouse bogus sequence (???)
ESC [ ? Ps s	Save DEC Private Mode
			Same P's as Restore DEC Private Mode
ESC [ Ps @	Insert Ps (Blank) Character(s) (default = 1) (ICH)
ESC [ Ps A	Cursor Up Ps Times (default = 1) (CUU)
ESC [ Ps B	Cursor Down Ps Times (default = 1) (CUD)
ESC [ Ps C	Cursor Forward Ps Times (default = 1) (CUF)
ESC [ Ps D	Cursor Backward Ps Times (default = 1) (CUB)
ESC [ Ps ; Ps H	Cursor Position [row;column] (default = [1,1]) (CUP)
ESC [ Ps J	Erase in Display
		Ps = 0 -> Clear Below (default)
		Ps = 1 -> Clear Above
		Ps = 2 -> Clear All
ESC [ Ps K	Erase in Line
		Ps = 0 -> Clear to Right (default)
		Ps = 1 -> Clear to Left
		Ps = 2 -> Clear All
ESC [ Ps L	Insert Ps lines (default = 1) (IL)
ESC [ Ps M	Delete Ps lines (default = 1) (DL)
ESC [ Ps P	Delete Ps Characters (default = 1) (DCH)
ESC [ T		Track Mouse (???)
ESC [ Ps c	Device Attributes (DA1)
ESC [ Ps ; Ps f	Cursor Position [row;column] (default = [1,1]) (HVP)
ESC [ Ps g	Tab Clear
		Ps = 0 -> Clear Current Column (default)
		Ps = 3 -> Clear All
ESC [ Ps h	Mode Set (SET)
		Ps = 4 -> Insert Mode (IRM)
		Ps = 20 -> Automatic Linefeed (LNM)
ESC [ Ps l	Mode Reset (RST)
		Ps = 4 -> Insert Mode (IRM)
		Ps = 20 -> Automatic Linefeed (LNM)
ESC [ Ps m	Character Attributes (SGR)
		Ps = 0 -> Normal (default)
		Ps = 1 -> Bold
		Ps = 4 -> Underscore
		Ps = 5 -> Blink (appears as Bold)
		Ps = 7 -> Inverse
ESC [ Ps n	Device Status Report (DSR)
		Ps = 5 -> Status Report ESC [ 0 n -> OK
		Ps = 6 -> Report Cursor Position (CPR) [row;column]
			  as ESC [ r ; c R
ESC [ Ps ; Ps r	Set Scrolling Region [top;bottom] (default = full size
		of window) (DECSTBM)
ESC [ Ps x	Request Terminal Parameters (DECREQTPARM)
ESC ] Ps ND string NP		OSC Mode
		ND can be any non-digit Character (it's discarded)
		NP can be any non-printing Character (it's discarded)
		string can be any ASCII printable string
			(max 511 characters)
		Ps = 0 -> use string as a new icon name and title
		Ps = 1 -> use string is a new icon name only
		Ps = 2 -> use string is a new title only
		Ps = 46 -> use string as a new log file name
		
ESC c		Full Reset
ESC n		Switch to Alternate Character Set LS2
ESC o		Switch to Alternate Character Set LS3
ESC |		Switch to Alternate Graphics(?) Set LS3R
ESC }		Switch to Alternate Graphics(?) Set LS2R
ESC ~		Switch to Alternate Graphics(?) Set LS1R
--
