Created	    : Fri 31 Mar 2006 02:08:26 PM CST
Modified    : Thu 21 Jun 2007 12:46:29 AM CDT
Author	    : Gautam Iyer <gi1242@users.sourceforge.net>
Description : This file describes the escape sequences used to control mrxvt.
	      This document is mostly complete, though there might be a few
	      omissions. Most omissions are documented with the xterm
	      documentation (the file ctlseqs.txt that comes with the xterm
	      package), however not all xterm sequences are supported by mrxvt.
	      
	      There may be a few escape sequences that are listed here that
	      behave differently or are not implemented by mrxvt. If you find
	      such errors please report them to mrxvt-devel@lists.sf.net.


------------------------------------------------------------------------------

				ESCAPE SEQUENCES

------------------------------------------------------------------------------


ESC # 8
    DEC Screen Alignment Test (DECALN)

ESC 7
ESC 8
    Save Cursor (SC)
    Restore Cursor

ESC =
ESC >
    Application Keypad (SMKX) == ESC[?66h
    Normal Keypad (RMKX) == ESC[?66l

    Note: If the numeric keypad is activated, eg, Num_Lock has been pressed,
    numbers or control functions are generated by the numeric keypad (see Key
    Codes)

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): affects next character only
    unimplemented

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

ESC Z
    Obsolete form of ESC[c 
    returns: ESC[?1;2C rxvt compile-time option

ESC c
    Full reset (RIS)

ESC n
    Invoke the G2 Character Set (LS2)

ESC o
    Invoke the G3 Character Set (LS3)

ESC ( C
ESC ) C
ESC * C
ESC + C
ESC $ C
    Designate G0 Character Set (ISO 2022)
    Designate G1 Character Set (ISO 2022)
    Designate G2 Character Set (ISO 2022)
    Designate G3 Character Set (ISO 2022)
    Designate Kanji Character Set 
    where C is 
	C = 0  DEC Special Character and Line Drawing Set 
	C = A  United Kingdom (UK) 
	C = B  United States (USASCII) 
	C = <  Multinational character set unimplemented 
	C = 5  Finnish character set unimplemented 
	C = C  Finnish character set unimplemented 
	C = K  German character set unimplemented 


------------------------------------------------------------------------------

		    CSI (CODE SEQUENCE INTRODUCER) SEQUENCES

------------------------------------------------------------------------------


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 E
    Cursor Down Ps Times [default: 1] and to first column

ESC [ Ps F
    Cursor Up Ps Times [default: 1] and to first column

ESC [ Ps G
    Cursor to Column Ps (HPA)

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

ESC [ Ps I
    Move forward Ps tab stops [default: 1]

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.  unimplemented
    Parameters are [func;startx;starty;firstrow;lastrow].

ESC [ Ps W
    Tabulator functions 
	Ps = 0  Tab Set (HTS) 
	Ps = 2  Tab Clear (TBC), Clear Current Column (default) 
	Ps = 5  Tab Clear (TBC), Clear All 

ESC [ Ps X
    Erase Ps Character(s) [default: 1] (ECH)

ESC [ Ps Z
    Move backward Ps [default: 1] tab stops

ESC [ Ps '
    == ESC [ Ps G

ESC [ Ps a
    == ESC [ Ps C

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

ESC [ Ps d
    Cursor to Line Ps (VPA)

ESC [ Ps e
    == ESC [ Ps A

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

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

ESC [ Ps i
    Printing 
	Ps = 4  disable transparent print mode (MC4) 
	Ps = 5  enable transparent print mode (MC5) unimplemented 

ESC [ Pm h
ESC [ Pm l
    Set Mode (SM) 
    Reset Mode (RM)

	Ps = 4
	    h  Insert Mode (SMIR) 
	    l  Replace Mode (RMIR) 

	Ps = 20 unimplemented
	    h  Automatic Newline (LNM) 
	    l  Normal Linefeed (LNM) 

ESC [ Pm m
    Character Attributes (SGR) 
	Ps = 0  Normal (default) 
	Ps = 1 / 22	On / Off Bold (bright fg) 
	Ps = 4 / 24	On / Off Underline 
	Ps = 5 / 25	On / Off Blink (bright bg) 
	Ps = 7 / 27	On / Off Inverse 
	Ps = 30 / 40	fg/bg Black 
	Ps = 31 / 41	fg/bg Red 
	Ps = 32 / 42	fg/bg Green 
	Ps = 33 / 43	fg/bg Yellow 
	Ps = 34 / 44	fg/bg Blue 
	Ps = 35 / 45	fg/bg Magenta 
	Ps = 36 / 46	fg/bg Cyan 
	Ps = 37 / 47	fg/bg White 
	Ps = 39 / 49	fg/bg Default 

    When compiled with 16 color support

	Ps =  90 .. 97	Sets foreground to color 8 .. 15
	Ps = 100 .. 107	Sets background to color 8 .. 15

    When compiled with 256 color support

	Ps = 38;5;Ps	Set foreground color to Ps
	Ps = 48;5;Ps	Set background color to Ps

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 
	Ps = 7  Request Display Name 
	Ps = 8  Request Version Number (place in window title) 

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

ESC [ s
    Save Cursor (SC)

ESC [ Ps x
    Request Terminal Parameters (DECREQTPARM)

ESC [ u
    Restore Cursor


------------------------------------------------------------------------------

			       DEC PRIVATE MODES

------------------------------------------------------------------------------


ESC [ ? Pm h
    DEC Private Mode Set (DECSET)

ESC [ ? Pm l
    DEC Private Mode Reset (DECRST)

ESC [ ? Pm r
    Restore previously saved DEC Private Mode Values.

ESC [ ? Pm s
    Save DEC Private Mode Values.

ESC [ ? Pm t
    Toggle DEC Private Mode Values (rxvt extension). Where 

    Ps = 1 (DECCKM)
	h  Application Cursor Keys 
	l  Normal Cursor Keys 

    Ps = 2 (ANSI/VT52 mode)
	h  Enter VT52 mode 
	l  Enter VT52 mode 

    Ps = 3
	h  132 Column Mode (DECCOLM) 
	l  80 Column Mode (DECCOLM) 

    Ps = 4
	h  Smooth (Slow) Scroll (DECSCLM) 
	l  Jump (Fast) Scroll (DECSCLM) 

    Ps = 5
	h  Reverse Video (DECSCNM) 
	l  Normal Video (DECSCNM) 

    Ps = 6
	h  Origin Mode (DECOM) 
	l  Normal Cursor Mode (DECOM) 

    Ps = 7
	h  Wraparound Mode (DECAWM) 
	l  No Wraparound Mode (DECAWM) 

    Ps = 8 unimplemented
	h  Auto-repeat Keys (DECARM) 
	l  No Auto-repeat Keys (DECARM) 

    Ps = 9 X10 XTerm mouse reporting
	h  Send Mouse X & Y on button press. 
	l  No mouse reporting. 

    Ps = 10 (rxvt)
	h  menuBar visible 
	l  menuBar invisible 

    Ps = 25
	h  Visible cursor {cnorm/cvvis} 
	l  Invisible cursor {civis} 

    Ps = 30
	h  scrollBar visisble 
	l  scrollBar invisisble 

    Ps = 35 (rxvt)
	h  Allow XTerm Shift+key sequences 
	l  Disallow XTerm Shift+key sequences 

    Ps = 38 unimplemented
	Enter Tektronix Mode (DECTEK)

    Ps = 40
	h  Allow 80/132 Mode 
	l  Disallow 80/132 Mode 

    Ps = 44 unimplemented
	h  Turn On Margin Bell 
	l  Turn Off Margin Bell 

    Ps = 45 unimplemented
	h  Reverse-wraparound Mode 
	l  No Reverse-wraparound Mode 

    Ps = 46 unimplemented

    Ps = 47
	h  Use Alternate Screen Buffer 
	l  Use Normal Screen Buffer 

    Ps = 66
	h  Application Keypad (DECPAM) == ESC = 
	l  Normal Keypad (DECPNM) == ESC > 

    Ps = 67
	h  Backspace key sends BS (DECBKM) 
	l  Backspace key sends DEL 

    Ps = 1000 (X11 XTerm mouse reporting)
	h  Send Mouse X & Y on button press and release. 
	l  No mouse reporting. 

    Ps = 1001 (X11 XTerm mouse tracking) unimplemented
	h  Use Hilite Mouse Tracking. 
	l  No mouse reporting. 

    Ps = 1010
	h  Don't scroll to bottom on TTY output 
	l  Scroll to bottom on TTY output 

    Ps = 1011
	h  Scroll to bottom when a key is pressed 
	l  Don't scroll to bottom when a key is pressed 

    Ps = 1047
	h  Use Alternate Screen Buffer 
	l  Use Normal Screen Buffer - clear Alternate Screen Buffer if
	   returning from it 

    Ps = 1048
	h  Save cursor position 
	l  Restore cursor position 

    Ps = 1049
	h  Save cursor position and use alternate screen clearing it first
	l  Use normal screen and restore cursor


------------------------------------------------------------------------------

			XTERM OPERATING SYSTEM COMMANDS

------------------------------------------------------------------------------


ESC ] Ps;Pt ST
    Set XTerm Parameters 
    8-bit ST: 0x9c, 
    7-bit ST sequence: ESC \ (0x1b, 0x5c), 
    backwards compatible terminator BEL (0x07) is also accepted. 

    Ps = 0  Change Icon Name and Window Title to Pt. (NOTE: A compile time
	    option, enabled by default, causes this to set the tab title
	    instead of the Window title).

    Ps = 1  Change Icon Name to Pt 

    Ps = 2  Change Window Title to Pt. (NOTE: A compile time option, enabled by
	    default, causes this to set the tab title instead of the Window
	    title).

    Ps = 4  Pt is a semi-colon separated sequence of one or more semi-colon
	    separated number/name pairs, where number is an index to a colour
	    and name is the name of a colour.  Each pair causes the numbered
	    colour to be changed to name.

	    Numbers 0-7 corresponds to low-intensity (normal) colours and 8-15
	    corresponds to high-intensity colours. 0=black, 1=red, 2=green,
	    3=yellow, 4=blue, 5=magenta, 6=cyan, 7=white 

    Ps = 10 (NB: may change in future)  menuBar command Pt rxvt compile-time
	    option 

    Ps = 12 Change colour of text cursor foreground to Pt 

    Ps = 13 Change colour of mouse foreground to Pt 

    Ps = 17 Change colour of highlight characters to Pt 

    Ps = 18 Change colour of bold characters to Pt 

    Ps = 19 Change colour of underlined characters to Pt 

    Ps = 20 Change default background pixmap to Pt 

    Ps = 39 Change default foreground colour to Pt rxvt compile-time option 

    Ps = 46 Change Log File to Pt unimplemented 

    Ps = 49 Change default background colour to Pt rxvt compile-time option 

    Ps = 50 Set Font to Pt, with the following special values of Pt (rxvt) 

	#+n change up n font(s) 
	#-n change down n font(s) 
	if n is missing of 0, a value of 1 is used 
	empty change to font0 
	n change to font n 

    Ps = 55  Log all scrollback buffer and all of screen to Pt 


------------------------------------------------------------------------------

			MRXVT OPERATING SYSTEM COMMANDS

------------------------------------------------------------------------------


ESC ] Ps;Pt ST
    Set XTerm Parameters 
    8-bit ST: 0x9c, 
    7-bit ST sequence: ESC \ (0x1b, 0x5c), 
    backwards compatible terminator BEL (0x07) is also accepted. 

    Ps = 60 Change terminal window title to Pt

    Ps = 61 Change tab title to Pt

    Ps = 62 Change tab and terminal title to Pt

    Ps = 63 Change winTitleFormat (for current tab) to Pt

    Ps = 64 Change titleFormat for current tab to Pt

    Ps = 66 Change background tinting color to Pt. Pt should be a color
	    in a format understood by the X server.

    Ps = 67 Change background shade value for tinting to Pt. If Pt
	    begins with a '+' or '-' then the shading level is
	    increased / decreased by Pt instead.

    Ps = 68 Change encoding method

    Ps = 70 Set opacity level to Pt. If Pt begins with a '+' or '-'
	    then the opacity level is increased / decreased by Pt.

    Ps = 72 Set active tab foreground color to Pt

    Ps = 73 Set tabbar/active tab background color to Pt

    Ps = 74 Set inactive tab foreground color to Pt

    Ps = 75 Set inactive tab background color to Pt

    Ps = 82 (OBSOLETE) Change backgroundFade degree to Pt. Use Ps=67
	    instead.

    Ps = 83 Change terminal name to Pt. In addition to setting the
	    environment variable TERM to your terminal name, you need to
	    let mrxvt know about the changed terminal. Use this escape
	    sequence to do so.


DISABLED MRXVT OPERATING SYSTEM COMMANDS


The following commands were available in previous versions of mrxvt, but have
been disabled as of version 0.5.0. Some were disabled because the functionality
provided by these commands is also provided by the macros feature. Some were
disabled because of security risks.

    Ps = 63 (DISABLED) Create a new tab with title Pt

    Ps = 64 (DISABLED) Switch to the previous tab.

    Ps = 65 (DISABLED) Switch to the next tab.

    Ps = 69 (DISABLED) Hide/show tabbar

    Ps = 69 (DISABLED) Hide/show scrollbar

    Ps = 69 (DISABLED) Hide/show menubar

    Ps = 71 (DISABLED) Hide/Show tabbar buttons

    Ps = 76 (DISABLED) Toggle background transparency

    Ps = 77 (DISABLED) Move active tab to the left

    Ps = 78 (DISABLED) Move active tab to the right

    Ps = 79 (DISABLED) Toggle bold font for highlighting text.

    Ps = 80 (DISABLED) Toggle disabling keyboard shortcuts.

    Ps = 81 (DISABLED) Save configuration to file.

    Ps = 84 (DISABLED) Close the Nth tab. If N is 0, then kill the
	    currently active tab. If N is not specified, then close all
	    tabs and exit.

    Ps = 85 (DISABLED) Switch to the Nth tab. If N is 0, then switch to
	    the previously active tab.


 vim: set ts=8 sts=4 nospell:
