1mXterm Control Sequences0m 4mEdward24m 4mMoy0m University of California, Berkeley Revised by 4mStephen24m 4mGildea0m X Consortium (1994) 4mThomas24m 4mDickey0m XFree86 Project (1996-2005) 1mDefinitions0m 4mc24m The literal character 4mc24m. 4mC24m A single (required) character. 4mPs24m A single (usually optional) numeric parameter, composed of one of more digits. 4mPm24m A multiple numeric parameter composed of any number of single numeric parameters, separated by ; character(s). Individual val- ues for the parameters are listed with 4mPs24m . 4mPt24m A text parameter composed of printable characters. 1mC1 (8-Bit) Control Characters0m The 4mxterm24m program recognizes both 8-bit and 7-bit control characters. It generates 7-bit controls (by default) or 8-bit if S8C1T is enabled. The following pairs of 7-bit and 8-bit control characters are equiva- lent: ESC D Index (IND is 0x84) ESC E Next Line (NEL is 0x85) ESC H Tab Set (HTS is 0x88) ESC M Reverse Index (RI is 0x8d) ESC N Single Shift Select of G2 Character Set (SS2 is 0x8e): affects next character only ESC O Single Shift Select of G3 Character Set (SS3 is 0x8f): affects next character only ESC P Device Control String (DCS is 0x90) ESC V Start of Guarded Area (SPA is 0x96) ESC W End of Guarded Area (EPA is 0x97) ESC X Start of String (SOS is 0x98) ESC Z Return Terminal ID (DECID is 0x9a). Obsolete form of CSI c (DA). ESC [ Control Sequence Introducer (CSI is 0x9b) ESC \ String Terminator (ST is 0x9c) ESC ] Operating System Command (OSC is 0x9d) ESC ^ Privacy Message (PM is 0x9e) ESC _ Application Program Command (APC is 0x9f) These control characters are used in the vtXXX emulation. 1mVT100 Mode0m Most of these control sequences are standard VT102 control sequences, but there is support for later DEC VT terminals (i.e., VT220, VT320, VT420), as well as ISO 6429 and 4maixterm24m color controls. The only VT102 features not supported is auto-repeat, since the only way X provides for this will affect all windows. There are additional control sequences to provide 4mxterm-24mdependent functions, such as 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 dis- cussion of character sets. 1mSingle-character functions0m BEL Bell (Ctrl-G) BS Backspace (Ctrl-H) CR Carriage Return (Ctrl-M) ENQ Return Terminal Status (Ctrl-E). Default response is an empty string, but may be overridden by a resource 1manswer-0m 1mbackString22m. FF Form Feed or New Page (NP) (Ctrl-L) same as LF LF Line Feed or New Line (NL) (Ctrl-J) SO Shift Out (Ctrl-N) -> Switch to Alternate Character Set: invokes the G1 character set. SP Space. TAB Horizontal Tab (HT) (Ctrl-I) VT Vertical Tab (Ctrl-K) same as LF SI Shift In (Ctrl-O) -> Switch to Standard Character Set: invokes the G0 character set (the default). 1mControls beginning with ESC (other than those where ESC is part of a0m 1m7-bit equivalent to 8-bit C1 controls), ordered by the final charac-0m 1mter(s).0m ESC SP F 7-bit controls (S7C1T). ESC SP G 8-bit controls (S8C1T). ESC SP L Set ANSI conformance level 1 (dpANS X3.134.1). ESC SP M Set ANSI conformance level 2 (dpANS X3.134.1). ESC SP N Set ANSI conformance level 3 (dpANS X3.134.1). ESC # 3 DEC double-height line, top half (DECDHL) ESC # 4 DEC double-height line, bottom half (DECDHL) ESC # 5 DEC single-width line (DECSWL) ESC # 6 DEC double-width line (DECDWL) ESC # 8 DEC Screen Alignment Test (DECALN) ESC % @ Select default character set, ISO 8859-1 (ISO 2022) ESC % G Select UTF-8 character set (ISO 2022) ESC ( 4mC24m Designate G0 Character Set (ISO 2022) ESC ) 4mC24m Designate G1 Character Set (ISO 2022) ESC * 4mC24m Designate G2 Character Set (ISO 2022) ESC + 4mC24m Designate G3 Character Set (ISO 2022) Final character 4mC24m for designating character sets (0 , A and B apply to VT100 and up, the remainder to VT220 and up): 4mC24m = 0 -> DEC Special Character and Line Drawing Set 4mC24m = A -> United Kingdom (UK) 4mC24m = B -> United States (USASCII) 4mC24m = 4 -> Dutch 4mC24m = C or 5 -> Finnish 4mC24m = R -> French 4mC24m = Q -> French Canadian 4mC24m = K -> German 4mC24m = Y -> Italian 4mC24m = E or 6 -> Norwegian/Danish 4mC24m = Z -> Spanish 4mC24m = H or 7 -> Swedish 4mC24m = = -> Swiss ESC 7 Save Cursor (DECSC) ESC 8 Restore Cursor (DECRC) ESC = Application Keypad (DECPAM) ESC > Normal Keypad (DECPNM) ESC F Cursor to lower left corner of screen (if enabled by the 1mhpLowerleftBugCompat 22mresource). 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 as GL (LS2). ESC o Invoke the G3 Character Set as GL (LS3). ESC | Invoke the G3 Character Set as GR (LS3R). ESC } Invoke the G2 Character Set as GR (LS2R). ESC ~ Invoke the G1 Character Set as GR (LS1R). 1mApplication Program-Control functions0m APC 4mPt24m ST 4mxterm24m implements no APC functions; 4mPt24m is ignored. 4mPt0m need not be printable characters. 1mDevice-Control functions0m DCS 4mPs24m; 4mPs24m| 4mPt24m ST User-Defined Keys (DECUDK). The first parameter: 4mPs24m = 0 -> Clear all UDK definitions before starting (default) 4mPs24m = 1 -> Erase Below (default) The second parameter: 4mPs24m = 0 -> Lock the keys (default) 4mPs24m = 1 -> Do not lock. The third parameter is a ';'-separated list of strings denoting the key-code separated by a '/' from the hex- encoded key value. The key codes correspond to the DEC function-key codes (e.g., F6=17). DCS $ q 4mPt24m ST Request Status String (DECRQSS). The string following the "q" is one of the following: " q -> DECSCA " p -> DECSCL r -> DECSTBM m -> SGR 4mxterm24m responds with DCS 1 $ r 4mPt24m ST for valid requests, replacing the 4mPt24m with the corresponding CSI string, or DCS 0 $ r 4mPt24m ST for invalid requests. DCS + q 4mPt24m ST Request Termcap/Terminfo String (xterm, experimental). The string following the "q" is a list of names encoded in hexadecimal (2 digits per character) separated by ; which correspond to termcap or terminfo key names. 4mxterm24m responds with DCS 1 + r 4mPt24m ST for valid requests, adding to 4mPt24m an = , and the value of the corresponding string that xterm would send, or DCS 0 + r 4mPt24m ST for invalid requests. The strings are encoded in hexadecimal (2 digits per character). 1mFunctions using CSI , ordered by the final character(s)0m CSI 4mPs24m @ Insert 4mPs24m (Blank) Character(s) (default = 1) (ICH) CSI 4mPs24m A Cursor Up 4mPs24m Times (default = 1) (CUU) CSI 4mPs24m B Cursor Down 4mPs24m Times (default = 1) (CUD) CSI 4mPs24m C Cursor Forward 4mPs24m Times (default = 1) (CUF) CSI 4mPs24m D Cursor Backward 4mPs24m Times (default = 1) (CUB) CSI 4mPs24m E Cursor Next Line 4mPs24m Times (default = 1) (CNL) CSI 4mPs24m F Cursor Preceding Line 4mPs24m Times (default = 1) (CPL) CSI 4mPs24m G Cursor Character Absolute [column] (default = [row,1]) (CHA) CSI 4mPs24m ; 4mPs24m H Cursor Position [row;column] (default = [1,1]) (CUP) CSI 4mPs24m I Cursor Forward Tabulation 4mPs24m tab stops (default = 1) (CHT) CSI 4mPs24m J Erase in Display (ED) 4mPs24m = 0 -> Erase Below (default) 4mPs24m = 1 -> Erase Above 4mPs24m = 2 -> Erase All 4mPs24m = 3 -> Erase Saved Lines (xterm) CSI ? 4mPs24m J Erase in Display (DECSED) 4mPs24m = 0 -> Selective Erase Below (default) 4mPs24m = 1 -> Selective Erase Above 4mPs24m = 2 -> Selective Erase All CSI 4mPs24m K Erase in Line (EL) 4mPs24m = 0 -> Erase to Right (default) 4mPs24m = 1 -> Erase to Left 4mPs24m = 2 -> Erase All CSI ? 4mPs24m K Erase in Line (DECSEL) 4mPs24m = 0 -> Selective Erase to Right (default) 4mPs24m = 1 -> Selective Erase to Left 4mPs24m = 2 -> Selective Erase All CSI 4mPs24m L Insert 4mPs24m Line(s) (default = 1) (IL) CSI 4mPs24m M Delete 4mPs24m Line(s) (default = 1) (DL) CSI 4mPs24m P Delete 4mPs24m Character(s) (default = 1) (DCH) CSI 4mPs24m S Scroll up 4mPs24m lines (default = 1) (SU) CSI 4mPs24m T Scroll down 4mPs24m lines (default = 1) (SD) CSI 4mPs24m ; 4mPs24m ; 4mPs24m ; 4mPs24m ; 4mPs24m T Initiate highlight mouse tracking. Parameters are [func;startx;starty;firstrow;lastrow]. See the section 1mMouse Tracking22m. CSI 4mPs24m X Erase 4mPs24m Character(s) (default = 1) (ECH) CSI 4mPs24m Z Cursor Backward Tabulation 4mPs24m tab stops (default = 1) (CBT) CSI 4mPm24m ` Character Position Absolute [column] (default = [row,1]) (HPA) CSI 4mPs24m b Repeat the preceding graphic character 4mPs24m times (REP) CSI 4mPs24m c Send Device Attributes (Primary DA) 4mPs24m = 0 or omitted -> request attributes from terminal. The response depends on the 1mdecTerminalID 22mresource set- ting. -> CSI ? 1 ; 2 c (``VT100 with Advanced Video Option'') -> CSI ? 1 ; 0 c (``VT101 with No Options'') -> CSI ? 6 c (``VT102'') -> CSI ? 6 0 ; 1 ; 2 ; 6 ; 8 ; 9 ; 1 5 ; c (``VT220'') The VT100-style response parameters do not mean anything by themselves. VT220 parameters do, telling the host what features the terminal supports: -> 1 132-columns -> 2 Printer -> 6 Selective erase -> 8 User-defined keys -> 9 National replacement character sets -> 1 5 Technical characters -> 2 2 ANSI color, e.g., VT525 -> 2 9 ANSI text locator (i.e., DEC Locator mode) CSI > 4mPs24m c Send Device Attributes (Secondary DA) 4mPs24m = 0 or omitted -> request the terminal's identifi- cation code. The response depends on the 1mdecTerminalID0m resource setting. It should apply only to VT220 and up, but 4mxterm24m extends this to VT100. -> CSI > 4mPp24m ; 4mPv24m ; 4mPc24m c where 4mPp24m denotes the terminal type -> 0 (``VT100'') -> 1 (``VT220'') and 4mPv24m is the firmware version (for 4mxterm24m, this is the XFree86 patch number, starting with 95). In a DEC termi- nal, 4mPc24m indicates the ROM cartridge registration number and is always zero. CSI 4mPm24m d Line Position Absolute [row] (default = [1,column]) (VPA) CSI 4mPs24m ; 4mPs24m f Horizontal and Vertical Position [row;column] (default = [1,1]) (HVP) CSI 4mPs24m g Tab Clear (TBC) 4mPs24m = 0 -> Clear Current Column (default) 4mPs24m = 3 -> Clear All CSI 4mPm24m h Set Mode (SM) 4mPs24m = 2 -> Keyboard Action Mode (AM) 4mPs24m = 4 -> Insert Mode (IRM) 4mPs24m = 1 2 -> Send/receive (SRM) 4mPs24m = 2 0 -> Automatic Newline (LNM) CSI ? 4mPm24m h DEC Private Mode Set (DECSET) 4mPs24m = 1 -> Application Cursor Keys (DECCKM) 4mPs24m = 2 -> Designate USASCII for character sets G0-G3 (DECANM), and set VT100 mode. 4mPs24m = 3 -> 132 Column Mode (DECCOLM) 4mPs24m = 4 -> Smooth (Slow) Scroll (DECSCLM) 4mPs24m = 5 -> Reverse Video (DECSCNM) 4mPs24m = 6 -> Origin Mode (DECOM) 4mPs24m = 7 -> Wraparound Mode (DECAWM) 4mPs24m = 8 -> Auto-repeat Keys (DECARM) 4mPs24m = 9 -> Send Mouse X & Y on button press. See the section 1mMouse Tracking22m. 4mPs24m = 1 0 -> Show toolbar (rxvt) 4mPs24m = 1 2 -> Start Blinking Cursor (att610) 4mPs24m = 1 8 -> Print form feed (DECPFF) 4mPs24m = 1 9 -> Set print extent to full screen (DECPEX) 4mPs24m = 2 5 -> Show Cursor (DECTCEM) 4mPs24m = 3 0 -> Show scrollbar (rxvt). 4mPs24m = 3 5 -> Enable font-shifting functions (rxvt). 4mPs24m = 3 8 -> Enter Tektronix Mode (DECTEK) 4mPs24m = 4 0 -> Allow 80 -> 132 Mode 4mPs24m = 4 1 -> 4mmore24m(1) fix (see 1mcurses 22mresource) 4mPs24m = 4 2 -> Enable Nation Replacement Character sets (DECNRCM) 4mPs24m = 4 4 -> Turn On Margin Bell 4mPs24m = 4 5 -> Reverse-wraparound Mode 4mPs24m = 4 6 -> Start Logging (normally disabled by a com- pile-time option) 4mPs24m = 4 7 -> Use Alternate Screen Buffer (unless dis- abled by the 1mtiteInhibit 22mresource) 4mPs24m = 6 6 -> Application keypad (DECNKM) 4mPs24m = 6 7 -> Backarrow key sends backspace (DECBKM) 4mPs24m = 1 0 0 0 -> Send Mouse X & Y on button press and release. See the section 1mMouse Tracking22m. 4mPs24m = 1 0 0 1 -> Use Hilite Mouse Tracking. 4mPs24m = 1 0 0 2 -> Use Cell Motion Mouse Tracking. 4mPs24m = 1 0 0 3 -> Use All Motion Mouse Tracking. 4mPs24m = 1 0 1 0 -> Scroll to bottom on tty output (rxvt). 4mPs24m = 1 0 1 1 -> Scroll to bottom on key press (rxvt). 4mPs24m = 1 0 3 5 -> Enable special modifiers for Alt and NumLock keys. 4mPs24m = 1 0 3 6 -> Send ESC when Meta modifies a key (enables the 1mmetaSendsEscape 22mresource). 4mPs24m = 1 0 3 7 -> Send DEL from the editing-keypad Delete key 4mPs24m = 1 0 4 7 -> Use Alternate Screen Buffer (unless disabled by the 1mtiteInhibit 22mresource) 4mPs24m = 1 0 4 8 -> Save cursor as in DECSC (unless dis- abled by the 1mtiteInhibit 22mresource) 4mPs24m = 1 0 4 9 -> Save cursor as in DECSC and use Alter- nate Screen Buffer, clearing it first (unless disabled by the 1mtiteInhibit 22mresource). This combines the effects of the 1 0 4 7 and 1 0 4 8 modes. Use this with terminfo- based applications rather than the 4 7 mode. 4mPs24m = 1 0 5 1 -> Set Sun function-key mode. 4mPs24m = 1 0 5 2 -> Set HP function-key mode. 4mPs24m = 1 0 5 3 -> Set SCO function-key mode. 4mPs24m = 1 0 6 0 -> Set legacy keyboard emulation (X11R6). 4mPs24m = 1 0 6 1 -> Set Sun/PC keyboard emulation of VT220 keyboard. 4mPs24m = 2 0 0 4 -> Set bracketed paste mode. CSI 4mPm24m i Media Copy (MC) 4mPs24m = 0 -> Print screen (default) 4mPs24m = 4 -> Turn off printer controller mode 4mPs24m = 5 -> Turn on printer controller mode CSI ? 4mPm24m i Media Copy (MC, DEC-specific) 4mPs24m = 1 -> Print line containing cursor 4mPs24m = 4 -> Turn off autoprint mode 4mPs24m = 5 -> Turn on autoprint mode 4mPs24m = 1 0 -> Print composed display, ignores DECPEX 4mPs24m = 1 1 -> Print all pages CSI 4mPm24m l Reset Mode (RM) 4mPs24m = 2 -> Keyboard Action Mode (AM) 4mPs24m = 4 -> Replace Mode (IRM) 4mPs24m = 1 2 -> Send/receive (SRM) 4mPs24m = 2 0 -> Normal Linefeed (LNM) CSI ? 4mPm24m l DEC Private Mode Reset (DECRST) 4mPs24m = 1 -> Normal Cursor Keys (DECCKM) 4mPs24m = 2 -> Designate VT52 mode (DECANM). 4mPs24m = 3 -> 80 Column Mode (DECCOLM) 4mPs24m = 4 -> Jump (Fast) Scroll (DECSCLM) 4mPs24m = 5 -> Normal Video (DECSCNM) 4mPs24m = 6 -> Normal Cursor Mode (DECOM) 4mPs24m = 7 -> No Wraparound Mode (DECAWM) 4mPs24m = 8 -> No Auto-repeat Keys (DECARM) 4mPs24m = 9 -> Don't Send Mouse X & Y on button press 4mPs24m = 1 0 -> Hide toolbar (rxvt) 4mPs24m = 1 2 -> Stop Blinking Cursor (att610) 4mPs24m = 1 8 -> Don't print form feed (DECPFF) 4mPs24m = 1 9 -> Limit print to scrolling region (DECPEX) 4mPs24m = 2 5 -> Hide Cursor (DECTCEM) 4mPs24m = 3 0 -> Don't show scrollbar (rxvt). 4mPs24m = 3 5 -> Disable font-shifting functions (rxvt). 4mPs24m = 4 0 -> Disallow 80 -> 132 Mode 4mPs24m = 4 1 -> No 4mmore24m(1) fix (see 1mcurses 22mresource) 4mPs24m = 4 2 -> Disable Nation Replacement Character sets (DECNRCM) 4mPs24m = 4 4 -> Turn Off Margin Bell 4mPs24m = 4 5 -> No Reverse-wraparound Mode 4mPs24m = 4 6 -> Stop Logging (normally disabled by a com- pile-time option) 4mPs24m = 4 7 -> Use Normal Screen Buffer 4mPs24m = 6 6 -> Numeric keypad (DECNKM) 4mPs24m = 6 7 -> Backarrow key sends delete (DECBKM) 4mPs24m = 1 0 0 0 -> Don't Send Mouse X & Y on button press and release. See the section 1mMouse Tracking22m. 4mPs24m = 1 0 0 1 -> Don't Use Hilite Mouse Tracking 4mPs24m = 1 0 0 2 -> Don't Use Cell Motion Mouse Tracking 4mPs24m = 1 0 0 3 -> Don't Use All Motion Mouse Tracking 4mPs24m = 1 0 1 0 -> Don't scroll to bottom on tty output (rxvt). 4mPs24m = 1 0 1 1 -> Don't scroll to bottom on key press (rxvt). 4mPs24m = 1 0 3 5 -> Disable special modifiers for Alt and NumLock keys. 4mPs24m = 1 0 3 6 -> Don't send ESC when Meta modifies a key (disables the 1mmetaSendsEscape 22mresource). 4mPs24m = 1 0 3 7 -> Send VT220 Remove from the editing- keypad Delete key 4mPs24m = 1 0 4 7 -> Use Normal Screen Buffer, clearing screen first if in the Alternate Screen (unless disabled by the 1mtiteInhibit 22mresource) 4mPs24m = 1 0 4 8 -> Restore cursor as in DECRC (unless disabled by the 1mtiteInhibit 22mresource) 4mPs24m = 1 0 4 9 -> Use Normal Screen Buffer and restore cursor as in DECRC (unless disabled by the 1mtiteInhibit0m resource). This combines the effects of the 1 0 4 7 and 1 0 4 8 modes. Use this with terminfo-based applica- tions rather than the 4 7 mode. 4mPs24m = 1 0 5 1 -> Reset Sun function-key mode. 4mPs24m = 1 0 5 2 -> Reset HP function-key mode. 4mPs24m = 1 0 5 3 -> Reset SCO function-key mode. 4mPs24m = 1 0 6 0 -> Reset legacy keyboard emulation (X11R6). 4mPs24m = 1 0 6 1 -> Reset Sun/PC keyboard emulation of VT220 keyboard. 4mPs24m = 2 0 0 4 -> Reset bracketed paste mode. CSI 4mPm24m m Character Attributes (SGR) 4mPs24m = 0 -> Normal (default) 4mPs24m = 1 -> Bold 4mPs24m = 4 -> Underlined 4mPs24m = 5 -> Blink (appears as Bold) 4mPs24m = 7 -> Inverse 4mPs24m = 8 -> Invisible, i.e., hidden (VT300) 4mPs24m = 2 2 -> Normal (neither bold nor faint) 4mPs24m = 2 4 -> Not underlined 4mPs24m = 2 5 -> Steady (not blinking) 4mPs24m = 2 7 -> Positive (not inverse) 4mPs24m = 2 8 -> Visible, i.e., not hidden (VT300) 4mPs24m = 3 0 -> Set foreground color to Black 4mPs24m = 3 1 -> Set foreground color to Red 4mPs24m = 3 2 -> Set foreground color to Green 4mPs24m = 3 3 -> Set foreground color to Yellow 4mPs24m = 3 4 -> Set foreground color to Blue 4mPs24m = 3 5 -> Set foreground color to Magenta 4mPs24m = 3 6 -> Set foreground color to Cyan 4mPs24m = 3 7 -> Set foreground color to White 4mPs24m = 3 9 -> Set foreground color to default (original) 4mPs24m = 4 0 -> Set background color to Black 4mPs24m = 4 1 -> Set background color to Red 4mPs24m = 4 2 -> Set background color to Green 4mPs24m = 4 3 -> Set background color to Yellow 4mPs24m = 4 4 -> Set background color to Blue 4mPs24m = 4 5 -> Set background color to Magenta 4mPs24m = 4 6 -> Set background color to Cyan 4mPs24m = 4 7 -> Set background color to White 4mPs24m = 4 9 -> Set background color to default (origi- nal). If 16-color support is compiled, the following apply. Assume that 4mxterm24m's resources are set so that the ISO color codes are the first 8 of a set of 16. Then the 4maixterm24m colors are the bright versions of the ISO colors: 4mPs24m = 9 0 -> Set foreground color to Black 4mPs24m = 9 1 -> Set foreground color to Red 4mPs24m = 9 2 -> Set foreground color to Green 4mPs24m = 9 3 -> Set foreground color to Yellow 4mPs24m = 9 4 -> Set foreground color to Blue 4mPs24m = 9 5 -> Set foreground color to Magenta 4mPs24m = 9 6 -> Set foreground color to Cyan 4mPs24m = 9 7 -> Set foreground color to White 4mPs24m = 1 0 0 -> Set background color to Black 4mPs24m = 1 0 1 -> Set background color to Red 4mPs24m = 1 0 2 -> Set background color to Green 4mPs24m = 1 0 3 -> Set background color to Yellow 4mPs24m = 1 0 4 -> Set background color to Blue 4mPs24m = 1 0 5 -> Set background color to Magenta 4mPs24m = 1 0 6 -> Set background color to Cyan 4mPs24m = 1 0 7 -> Set background color to White If 4mxterm24m is compiled with the 16-color support disabled, it supports the following, from 4mrxvt24m: 4mPs24m = 1 0 0 -> Set foreground and background color to default If 88- or 256-color support is compiled, the following apply. 4mPs24m = 3 8 ; 5 ; 4mPs24m -> Set foreground color to the sec- ond 4mPs0m 4mPs24m = 4 8 ; 5 ; 4mPs24m -> Set background color to the sec- ond 4mPs0m CSI 4mPs24m n Device Status Report (DSR) 4mPs24m = 5 -> Status Report CSI 0 n (``OK'') 4mPs24m = 6 -> Report Cursor Position (CPR) [row;column] as CSI 4mr24m ; 4mc24m R CSI ? 4mPs24m n Device Status Report (DSR, DEC-specific) 4mPs24m = 6 -> Report Cursor Position (CPR) [row;column] as CSI ? 4mr24m ; 4mc24m R (assumes page is zero). 4mPs24m = 1 5 -> Report Printer status as CSI ? 1 0 n (ready) or CSI ? 1 1 n (not ready) 4mPs24m = 2 5 -> Report UDK status as CSI ? 2 0 n (unlocked) or CSI ? 2 1 n (locked) 4mPs24m = 2 6 -> Report Keyboard status as CSI ? 2 7 ; 1 ; 0 ; 0 n (North American) The last two parameters apply to VT400 & up, and denote keyboard ready and LK01 respectively. 4mPs24m = 5 3 -> Report Locator status as CSI ? 5 3 n Locator available, if compiled-in, or CSI ? 5 0 n No Locator, if not. CSI ! p Soft terminal reset (DECSTR) CSI 4mPs24m ; 4mPs24m " p Set conformance level (DECSCL) Valid values for the first parameter: 4mPs24m = 6 1 -> VT100 4mPs24m = 6 2 -> VT200 4mPs24m = 6 3 -> VT300 Valid values for the second parameter: 4mPs24m = 0 -> 8-bit controls 4mPs24m = 1 -> 7-bit controls (always set for VT100) 4mPs24m = 2 -> 8-bit controls CSI 4mPs24m " q Select character protection attribute (DECSCA). Valid values for the parameter: 4mPs24m = 0 -> DECSED and DECSEL can erase (default) 4mPs24m = 1 -> DECSED and DECSEL cannot erase 4mPs24m = 2 -> DECSED and DECSEL can erase CSI 4mPs24m ; 4mPs24m r Set Scrolling Region [top;bottom] (default = full size of window) (DECSTBM) CSI ? 4mPm24m r Restore DEC Private Mode Values. The value of 4mPs24m previ- ously saved is restored. 4mPs24m values are the same as for DECSET. CSI 4mPt24m; 4mPl24m; 4mPb24m; 4mPr24m; 4mPs24m$ r Change Attributes in Rectangular Area (DECCARA). 4mPt24m; 4mPl24m; 4mPb24m; 4mPr24m denotes the rectangle. 4mPs24m denotes the SGR attributes to change: 0, 1, 4, 5, 7 CSI s Save cursor (ANSI.SYS) CSI ? 4mPm24m s Save DEC Private Mode Values. 4mPs24m values are the same as for DECSET. CSI 4mPs24m ; 4mPs24m ; 4mPs24m t Window manipulation (from 4mdtterm24m, as well as extensions). These controls may be disabled using the 4mallowWindowOps0m resource. Valid values for the first (and any additional parameters) are: 4mPs24m = 1 -> De-iconify window. 4mPs24m = 2 -> Iconify window. 4mPs24m = 3 ; 4mx24m 4m;24m 4my24m -> Move window to [x, y]. 4mPs24m = 4 ; 4mheight24m 4m;24m 4mwidth24m -> Resize the 4mxterm24m window to height and width in pixels. 4mPs24m = 5 -> Raise the 4mxterm24m window to the front of the stacking order. 4mPs24m = 6 -> Lower the 4mxterm24m window to the bottom of the stacking order. 4mPs24m = 7 -> Refresh the 4mxterm24m window. 4mPs24m = 8 ; 4mheight24m 4m;24m 4mwidth24m -> Resize the text area to [height;width] in characters. 4mPs24m = 9 ; 0 -> Restore maximized window. 4mPs24m = 9 ; 1 -> Maximize window (i.e., resize to screen size). 4mPs24m = 1 1 -> Report 4mxterm24m window state. If the 4mxterm0m window is open (non-iconified), it returns CSI 1 t . If the 4mxterm24m window is iconified, it returns CSI 2 t . 4mPs24m = 1 3 -> Report 4mxterm24m window position as CSI 3 ; 4mx24m; 4my24mt 4mPs24m = 1 4 -> Report 4mxterm24m window in pixels as CSI 4 ; 4mheight24m ; 4mwidth24m t 4mPs24m = 1 8 -> Report the size of the text area in char- acters as CSI 8 ; 4mheight24m ; 4mwidth24m t 4mPs24m = 1 9 -> Report the size of the screen in charac- ters as CSI 9 ; 4mheight24m ; 4mwidth24m t 4mPs24m = 2 0 -> Report 4mxterm24m window's icon label as OSC L 4mlabel24m ST 4mPs24m = 2 1 -> Report 4mxterm24m window's title as OSC l 4mtitle24m ST 4mPs24m >= 2 4 -> Resize to 4mPs24m lines (DECSLPP) CSI 4mPt24m; 4mPl24m; 4mPb24m; 4mPr24m; 4mPs24m$ t Reverse Attributes in Rectangular Area (DECRARA). 4mPt24m; 4mPl24m; 4mPb24m; 4mPr24m denotes the rectangle. 4mPs24m denotes the attributes to reverse. 1, 4, 5, 7 CSI u Save cursor (ANSI.SYS) CSI 4mPt24m; 4mPl24m; 4mPb24m; 4mPr24m; 4mPp24m; 4mPt24m; 4mPl24m; 4mPp24m$ v Copy Rectangular Area (DECCRA) 4mPt24m; 4mPl24m; 4mPb24m; 4mPr24m denotes the rectangle. 4mPp24m denotes the source page. 4mPt24m; 4mPl24m denotes the target location. 4mPp24m denotes the target page. CSI 4mPt24m ; 4mPl24m ; 4mPb24m ; 4mPr24m ' w Enable Filter Rectangle (DECEFR) Parameters are [top;left;bottom;right]. Defines the coordinates of a filter rectangle and acti- vates it. Anytime the locator is detected outside of the filter rectangle, an outside rectangle event is generated and the rectangle is disabled. Filter rectangles are always treated as "one-shot" events. Any parameters that are omitted default to the current locator position. If all parameters are omitted, any locator motion will be reported. DECELR always cancels any prevous rectangle definition. CSI 4mPs24m x Request Terminal Parameters (DECREQTPARM) if 4mPs24m is a "0" (default) or "1", and 1mxterm 22mis emulating VT100, the control sequence elicits a response of the same form whose parameters describe the terminal: 4mPs24m -> the given 4mPs24m incremented by 2. 1 -> no parity 1 -> eight bits 1 2 8 -> transmit 38.4k baud 1 2 8 -> receive 38.4k baud 1 -> clock multiplier 0 -> STP flags CSI 4mPs24m x Select Attribute Change Extent (DECSACE). 4mPs24m = 0 -> from start to end position, wrapped 4mPs24m = 1 -> from start to end position, wrapped 4mPs24m = 2 -> rectangle (exact). CSI 4mPc24m; 4mPt24m; 4mPl24m; 4mPb24m; 4mPr24m$ x Fill Rectangular Area (DECFRA). 4mPc24m is the character to use. 4mPt24m; 4mPl24m; 4mPb24m; 4mPr24m denotes the rectangle. CSI 4mPs24m ; 4mPu24m ' z Enable Locator Reporting (DECELR) Valid values for the first parameter: 4mPs24m = 0 -> Locator disabled (default) 4mPs24m = 1 -> Locator enabled 4mPs24m = 2 -> Locator enabled for one report, then dis- abled The second parameter specifies the coordinate unit for locator reports. Valid values for the second parameter: 4mPu24m = 0 or omitted -> default to character cells 4mPu24m = 1 -> device physical pixels 4mPu24m = 2 -> character cells CSI 4mPt24m; 4mPl24m; 4mPb24m; 4mPr24m$ z Erase Rectangular Area (DECERA). 4mPt24m; 4mPl24m; 4mPb24m; 4mPr24m denotes the rectangle. CSI 4mPm24m ' { Select Locator Events (DECSLE) Valid values for the first (and any additional parame- ters) are: 4mPs24m = 0 -> only respond to explicit host requests (DECRQLP) (default) also cancels any filter rectangle 4mPs24m = 1 -> report button down transitions 4mPs24m = 2 -> do not report button down transitions 4mPs24m = 3 -> report button up transitions 4mPs24m = 4 -> do not report button up transitions CSI 4mPt24m; 4mPl24m; 4mPb24m; 4mPr24m$ { Selective Erase Rectangular Area (DECSERA). 4mPt24m; 4mPl24m; 4mPb24m; 4mPr24m denotes the rectangle. CSI 4mPs24m ' | Request Locator Position (DECRQLP) Valid values for the parameter are: 4mPs24m = 0 , 1 or omitted -> transmit a single DECLRP loca- tor report If Locator Reporting has been enabled by a DECELR, xterm will respond with a DECLRP Locator Report. This report is also generated on button up and down events if they have been enabled with a DECSLE, or when the locator is detected outside of a filter rectangle, if filter rectan- gles have been enabled with a DECEFR. -> CSI 4mPe24m ; 4mPb24m ; 4mPr24m ; 4mPc24m ; 4mPp24m & w Parameters are [event;button;row;column;page]. Valid values for the event: 4mPe24m = 0 -> locator unavailable - no other parameters sent 4mPe24m = 1 -> request - xterm received a DECRQLP 4mPe24m = 2 -> left button down 4mPe24m = 3 -> left button up 4mPe24m = 4 -> middle button down 4mPe24m = 5 -> middle button up 4mPe24m = 6 -> right button down 4mPe24m = 7 -> right button up 4mPe24m = 8 -> M4 button down 4mPe24m = 9 -> M4 button up 4mPe24m = 1 0 -> locator outside filter rectangle ``button'' parameter is a bitmask indicating which but- tons are pressed: 4mPb24m = 0 -> no buttons down 4mPb24m & 1 -> right button down 4mPb24m & 2 -> middle button down 4mPb24m & 4 -> left button down 4mPb24m & 8 -> M4 button down ``row'' and ``column'' parameters are the coordinates of the locator position in the xterm window, encoded as ASCII decimal. The ``page'' parameter is not used by xterm, and will be omitted. 1mOperating System Controls0m OSC 4mPs24m ; 4mPt24m ST OSC 4mPs24m ; 4mPt24m BEL Set Text Parameters. For colors and font, if 4mPt24m is a "?", the control sequence elicits a response which con- sists of the control sequence which would set the corre- sponding value. The 4mdtterm24m control sequences allow you to determine the icon name and window title. 4mPs24m = 0 -> Change Icon Name and Window Title to 4mPt0m 4mPs24m = 1 -> Change Icon Name to 4mPt0m 4mPs24m = 2 -> Change Window Title to 4mPt0m 4mPs24m = 3 -> Set X property on top-level window. 4mPt0m should be in the form "4mprop=value24m", or just "4mprop24m" to delete the property 4mPs24m = 4 ; 4mc24m 4m;24m 4mspec24m -> Change Color Number 4mc24m to the color specified by 4mspec24m, i.e., a name or RGB specifica- tion as per 4mXParseColor24m. Any number of 4mc24m 4mname24m pairs may be given. The color numbers correspond to the ANSI col- ors 0-7, their bright versions 8-15, and if supported, the remainder of the 88-color or 256-color table. If a "?" is given rather than a name or RGB specifica- tion, xterm replies with a control sequence of the same form which can be used to set the corresponding color. Because more than one pair of color number and specifica- tion can be given in one control sequence, 1mxterm 22mcan make more than one reply. The 8 colors which may be set using 1 0 through 1 7 are denoted 4mdynamic24m 4mcolors24m, since the corresponding control sequences were the first means for setting 1mxterm22m's colors dynamically, i.e., after it was started. They are not the same as the ANSI colors. One or more parameters is expected for 4mPt24m. Each successive parameter changes the next color in the list. The value of 4mPs24m tells the start- ing point in the list. The colors are specified by name or RGB specification as per 4mXParseColor24m. If a "?" is given rather than a name or RGB specifica- tion, xterm replies with a control sequence of the same form which can be used to set the corresponding dynamic color. Because more than one pair of color number and specification can be given in one control sequence, 1mxterm0m can make more than one reply. 4mPs24m = 1 0 -> Change VT100 text foreground color to 4mPt0m 4mPs24m = 1 1 -> Change VT100 text background color to 4mPt0m 4mPs24m = 1 2 -> Change text cursor color to 4mPt0m 4mPs24m = 1 3 -> Change mouse foreground color to 4mPt0m 4mPs24m = 1 4 -> Change mouse background color to 4mPt0m 4mPs24m = 1 5 -> Change Tektronix foreground color to 4mPt0m 4mPs24m = 1 6 -> Change Tektronix background color to 4mPt0m 4mPs24m = 1 7 -> Change highlight color to 4mPt0m 4mPs24m = 1 8 -> Change Tektronix cursor color to 4mPt0m 4mPs24m = 4 6 -> Change Log File to 4mPt24m (normally disabled by a compile-time option) 4mPs24m = 5 0 -> Set Font to 4mPt24m If 4mPt24m begins with a "#", index in the font menu, relative (if the next character is a plus or minus sign) or absolute. A number is expected but not required after the sign (the default is the current entry for relative, zero for absolute index- ing). 4mPs24m = 5 1 (reserved for Emacs shell) 4mPs24m = 5 2 -> Manipulate Selection Data. These controls may be disabled using the 4mallowWindowOps24m resource. The parameter 4mPt24m is parsed as 4mPc24m; 4mPd0m The first, 4mPc24m, may contain any character from the set c p s 0 1 2 3 4 5 6 7 . It is used to construct a list of selection parameters for clipboard, primary, select, or cut buffers 0 through 8 respectively, in the order given. If the parameter is empty, 4mxterm24m uses s 0 , to specify the configurable primary/clipboard selection and cut buffer 0. The second parameter, 4mPd24m, gives the selection data. Nor- mally this is a string encoded in base64. The data becomes the new selection, which is then available for pasting by other applications. If the second parameter is a ? , 4mxterm24m replies to the host with the selection data encoded using the same pro- tocol. 1mPrivacy Message0m PM 4mPt24m ST 4mxterm24m implements no PM functions; 4mPt24m is ignored. 4mPt0m need not be printable characters. 1mPC-Style Function Keys0m If 4mxterm24m does minimal translation of the function keys, it usually does this with a PC-style keyboard, so PC-style function keys result. Sun keyboards are similar to PC keyboards. Both have cursor and scrolling operations printed on the keypad, which duplicate the smaller cursor and scrolling keypads. X does not predefine NumLock (used for VT220 keyboards) or Alt (used as an extension for the Sun/PC keyboards) as modifiers. These keys are recognized as modifiers when enabled by the 1mnumLock 22mresource, or by the DECSET 1 0 3 5 control sequence. The cursor keys transmit the following escape sequences depending on the mode specified via the 1mDECCKM 22mescape sequence. 1mKey Normal Application0m -------------------------------------- 1mCursor Up CSI A SS3 A0m 1mCursor Down CSI B SS3 B0m 1mCursor Right CSI C SS3 C0m 1mCursor Left CSI D SS3 D0m -------------------------------------- The home- and end-keys (unlike PageUp and other keys also on the 6-key editing keypad) are considered "cursor keys" by 4mxterm24m. Their mode is also controlled by the 1mDECCKM 22mescape sequence: 1mKey Normal Application0m ---------------------------------- 1mHome CSI H SS3 H0m 1mEnd CSI F SS3 F0m ---------------------------------- The application keypad transmits the following escape sequences depend- ing on the mode specified via the 1mDECPNM 22mand 1mDECPAM 22mescape sequences. Use the NumLock key to override the application mode. Not all keys are present on the Sun/PC keypad (e.g., PF1, Tab), but are supported by the program. 1mKey Numeric Application Terminfo Termcap0m -------------------------------------------------------------- 1mSpace SP SS3 SP - -0m 1mTab TAB SS3 I - -0m 1mEnter CR SS3 M kent @80m 1mPF1 SS3 P SS3 P kf1 k10m 1mPF2 SS3 Q SS3 Q kf2 k20m 1mPF3 SS3 R SS3 R kf3 k30m 1mPF4 SS3 S SS3 S kf4 k40m 1m* 22m(multiply) 1m* SS3 j - -0m 1m+ 22m(add) 1m+ SS3 k - -0m 1m, 22m(comma) 1m, SS3 l - -0m 1m- 22m(minus) 1m- SS3 m - -0m 1m. 22m(Delete) 1m. CSI 3 ~ - -0m 1m/ 22m(divide) 1m/ SS3 o - -0m 1m0 22m(Insert) 1m0 CSI 2 ~ - -0m 1m1 22m(End) 1m1 SS3 F kc1 K40m 1m2 22m(DownArrow) 1m2 CSI B - -0m 1m3 22m(PageDown) 1m3 CSI 6 ~ kc3 K50m 1m4 22m(LeftArrow) 1m4 CSI D - -0m 1m5 22m(Begin) 1m5 CSI E kb2 K20m 1m6 22m(RightArrow) 1m6 CSI C - -0m 1m7 22m(Home) 1m7 SS3 H ka1 K10m 1m8 22m(UpArrow) 1m8 CSI A - -0m 1m9 22m(PageUp) 1m9 CSI 5 ~ ka3 K30m 1m= (equal) = SS3 X - -0m -------------------------------------------------------------- They also provide 12 function keys, as well as a few other special-pur- pose keys. 1mKey Escape Sequence0m --------------------------- 1mF1 SS3 P0m 1mF2 SS3 Q0m 1mF3 SS3 R0m 1mF4 SS3 S0m 1mF5 CSI 1 5 ~0m 1mF6 CSI 1 7 ~0m 1mF7 CSI 1 8 ~0m 1mF8 CSI 1 9 ~0m 1mF9 CSI 2 0 ~0m 1mF10 CSI 2 1 ~0m 1mF11 CSI 2 3 ~0m 1mF12 CSI 2 4 ~0m --------------------------- Older versions of 4mxterm24m implement different escape sequences for F1 through F4. These can be activated by setting the 1moldXtermFKeys0m resource. However, since they do not correspond to any hardware termi- nal, they have been deprecated. (The DEC VT220 reserves F1 through F5 for local functions such as 1mSetup22m). 1mKey Escape Sequence0m --------------------------- 1mF1 CSI 1 1 ~0m 1mF2 CSI 1 2 ~0m 1mF3 CSI 1 3 ~0m 1mF4 CSI 1 4 ~0m --------------------------- In normal mode, i.e., a Sun/PC keyboard when the 1msunKeyboard 22mresource is false, 4mxterm24m recognizes function key modifiers which are parameters appended before the final character of the control sequence. 1mCode Modifiers0m --------------------------------- 1m2 Shift0m 1m3 Alt0m 1m4 Shift + Alt0m 1m5 Control0m 1m6 Shift + Control0m 1m7 Alt + Control0m 1m8 Shift + Alt + Control0m --------------------------------- For example, shift-F5 would be sent as CSI 1 5 ; 2 ~ If the 1malwaysUseMods 22mresource is set, the Meta modifier also is recog- nized, making parameters 9 through 16. 1mVT220-Style Function Keys0m However, 4mxterm24m is most useful as a DEC VT102 or VT220 emulator. Set the 1msunKeyboard 22mresource to true to force a Sun/PC keyboard to act like a VT220 keyboard. The VT102/VT220 application keypad transmits unique escape sequences in application mode, which are distinct from the cursor and scrolling key- pad: 1mKey Numeric Application0m -------------------------------------- 1mSpace SP SS3 SP0m 1mTab TAB SS3 I0m 1mEnter CR SS3 M0m 1mPF1 SS3 P SS3 P0m 1mPF2 SS3 Q SS3 Q0m 1mPF3 SS3 R SS3 R0m 1mPF4 SS3 S SS3 S0m 1m* 22m(multiply) 1m* SS3 j0m 1m+ 22m(add) 1m+ SS3 k0m 1m, 22m(comma) 1m, SS3 l0m 1m- 22m(minus) 1m- SS3 m0m 1m. 22m(period) 1m. SS3 n0m 1m/ 22m(divide) 1m/ SS3 o0m 1m0 0 SS3 p0m 1m1 1 SS3 q0m 1m2 2 SS3 r0m 1m3 3 SS3 s0m 1m4 4 SS3 t0m 1m5 5 SS3 u0m 1m6 6 SS3 v0m 1m7 7 SS3 w0m 1m8 8 SS3 x0m 1m9 9 SS3 y0m 1m= (equal) = SS3 X0m -------------------------------------- The VT220 provides a 6-key editing keypad, which is analogous to that on the PC keyboard. It is not affected by 1mDECCKM 22mor 1mDECPNM22m/1mDECPAM22m: 1mKey Normal Application0m ---------------------------------- Insert 1mCSI 2 ~ CSI 2 ~0m Delete 1mCSI 3 ~ CSI 3 ~0m Home 1mCSI 1 ~ CSI 1 ~0m End 1mCSI 4 ~ CSI 4 ~0m PageUp 1mCSI 5 ~ CSI 5 ~0m PageDown 1mCSI 6 ~ CSI 6 ~0m ---------------------------------- The VT220 provides 8 additional function keys. With a Sun/PC keyboard, access these keys by Control/F1 for F13, etc. 1mKey Escape Sequence0m --------------------------- 1mF13 CSI 2 5 ~0m 1mF14 CSI 2 6 ~0m 1mF15 CSI 2 8 ~0m 1mF16 CSI 2 9 ~0m 1mF17 CSI 3 1 ~0m 1mF18 CSI 3 2 ~0m 1mF19 CSI 3 3 ~0m 1mF20 CSI 3 4 ~0m --------------------------- 1mVT52-Style Function Keys0m A VT52 does not have function keys, but it does have a numeric keypad and cursor keys. They differ from the other emulations by the prefix. Also, the cursor keys do not change: 1mKey Normal/Application0m ---------------------------------- 1mCursor Up ESC A0m 1mCursor Down ESC B0m 1mCursor Right ESC C0m 1mCursor Left ESC D0m ---------------------------------- The keypad is similar: 1mKey Numeric Application0m -------------------------------------- 1mSpace SP ESC ? SP0m 1mTab TAB ESC ? I0m 1mEnter CR ESC ? M0m 1mPF1 ESC P ESC P0m 1mPF2 ESC Q ESC Q0m 1mPF3 ESC R ESC R0m 1mPF4 ESC S ESC S0m 1m* 22m(multiply) 1m* ESC ? j0m 1m+ 22m(add) 1m+ ESC ? k0m 1m, 22m(comma) 1m, ESC ? l0m 1m- 22m(minus) 1m- ESC ? m0m 1m. 22m(period) 1m. ESC ? n0m 1m/ 22m(divide) 1m/ ESC ? o0m 1m0 0 ESC ? p0m 1m1 1 ESC ? q0m 1m2 2 ESC ? r0m 1m3 3 ESC ? s0m 1m4 4 ESC ? t0m 1m5 5 ESC ? u0m 1m6 6 ESC ? v0m 1m7 7 ESC ? w0m 1m8 8 ESC ? x0m 1m9 9 ESC ? y0m 1m= (equal) = ESC ? X0m -------------------------------------- 1mSun-Style Function Keys0m The 4mxterm24m program provides support for Sun keyboards more directly, by a menu toggle that causes it to send Sun-style function key codes rather than VT220. Note, however, that the 4msun24m and 4mVT10024m emulations are not really compatible. For example, their wrap-margin behavior differs. Only function keys are altered; keypad and cursor keys are the same. The emulation responds identically. See the xterm-sun terminfo entry for details. 1mHP-Style Function Keys0m Similarly, 4mxterm24m can be compiled to support HP keyboards. See the xterm-hp terminfo entry for details. 1mThe Alternate Screen Buffer0m 1mXterm 22mmaintains two screen buffers. The normal screen buffer allows you to scroll back to view saved lines of output up to the maximum set by the 1msaveLines 22mresource. The alternate screen buffer is exactly as large as the display, contains no additional saved lines. When the alternate screen buffer is active, you cannot scroll back to view saved lines. 1mXterm 22mprovides control sequences and menu entries for switching between the two. Most full-screen applications use terminfo or termcap to obtain strings used to start/stop full-screen mode, i.e., 4msmcup24m and 4mrmcup24m for terminfo, or the corresponding 4mti24m and 4mte24m for termcap. The 1mtiteInhibit 22mresource removes the 4mti24m and 4mte24m strings from the TERMCAP string which is set in the environment for some platforms. That is not done when 1mxterm 22mis built with terminfo libraries because terminfo does not provide the whole text of the termcap data in one piece. It would not work for ter- minfo anyway, since terminfo data is not passed in environment vari- ables; setting an environment variable in this manner would have no effect on the application's ability to switch between normal and alter- nate screen buffers. Instead, the newer private mode controls (such as 1 0 4 9 ) for switching between normal and alternate screen buffers sim- ply disable the switching. They add other features such as clearing the display for the same reason: to make the details of switching indepen- dent of the application that requests the switch. 1mBracketed Paste Mode0m When bracketed paste mode is set, pasted text is bracketed with control sequences so that the program can differentiate pasted text from typed- in text. When bracketed paste mode is set, the program will receive: ESC [ 200 ~, followed by the pasted text, followed by ESC [ 201 ~. 1mMouse Tracking0m The VT widget can be set to send the mouse position and other informa- tion 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 six mutually exclusive modes. One is DEC Locator mode, enabled by the DECELR CSI 4mPs24m ; 4mPs24m īz control sequence, and is not described here (control sequences are summarized above). The remaining five modes are each enabled (or disabled) by a different parameter in DECSET CSI ? 4mPm24m h or DECRST CSI ? 4mPm24m l control sequence. Manifest constants for the parameter values are defined in 1mxcharmouse.h0m as follows: #define SET_X10_MOUSE 9 #define SET_VT200_MOUSE 1000 #define SET_VT200_HIGHLIGHT_MOUSE 1001 #define SET_BTN_EVENT_MOUSE 1002 #define SET_ANY_EVENT_MOUSE 1003 The motion reporting modes are strictly 4mxterm24m extensions, and are not part of any standard, though they are analogous to the DEC VT200 DECELR locator reports. Parameters (such as pointer position and button number) for all mouse tracking escape sequences generated by 4mxterm24m encode numeric parameters in a single character as 4mvalue24m+32. For example, ! specifies the value 1. The upper left character position on the terminal is denoted as 1,1. X10 compatibility mode sends an escape sequence only on button press, encoding the location and the mouse button pressed. It is enabled by specifying parameter 9 to DECSET. On button press, 4mxterm24m sends CSI M 4mCbCxCy24m (6 characters). 4mCb24m is button-1. 4mCx24m and 4mCy24m are the x and y coor- dinates of the mouse when the button was pressed. Normal tracking mode sends an escape sequence on both button press and release. Modifier key (shift, ctrl, meta) information is also sent. It is enabled by specifying parameter 1000 to DECSET. On button press or release, 4mxterm24m sends CSI M 4mCbCxCy24m. The low two bits of 4mCb24m encode button information: 0=MB1 pressed, 1=MB2 pressed, 2=MB3 pressed, 3=release. The next three bits encode the modifiers which were down when the button was pressed and are added together: 4=Shift, 8=Meta, 16=Control. Note however that the shift and control bits are normally unavailable because 4mxterm24m uses the control modifier with mouse for popup menus, and the shift modifier is used in the default translations for button events. The 4mMeta24m modifier recognized by 4mxterm24m is the 4mmod124m mask, and is not nec- essarily the "Meta" key (see 4mxmodmap24m). 4mCx24m and 4mCy24m are the x and y coor- dinates of the mouse event, encoded as in X10 mode. Wheel mice may return buttons 4 and 5. Those buttons are represented by the same event codes as buttons 1 and 2 respectively, except that 64 is added to the event code. Release events for the wheel buttons are not reported. Mouse highlight 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. Highlighting is performed only for button 1, though other but- ton events can be received. 1mWarning: 22muse of this mode requires a coop- erating program or it will hang 4mxterm.24m On button press, the same infor- mation as for normal tracking is generated; 4mxterm24m then waits for the program to send mouse tracking information. 4mAll24m 4mX24m 4mevents24m 4mare24m 4mignored0m 4muntil24m 4mthe24m 4mproper24m 4mescape24m 4msequence24m 4mis24m 4mreceived24m 4mfrom24m 4mthe24m 4mpty:24m CSI 4mPs24m ; 4mPs24m ; 4mPs24m ; 4mPs24m ; 4mPs24m T . The parameters are 4mfunc,24m 4mstartx,24m 4mstarty,24m 4mfirstrow,24m and 4mlastrow.24m 4mfunc24m is non-zero to initiate highlight tracking and zero to abort. 4mstartx24m and 4mstarty24m give the starting x and y location for the highlighted region. The ending location tracks the mouse, but will never be above row 4mfirstrow24m and will always be above row 4mlastrow.24m (The top of the screen is row 1.) When the button is released, 4mxterm24m reports the ending position one of two ways: if the start and end coordinates are valid text locations: CSI t 4mCxCy24m. If either coordinate is past the end of the line: CSI T 4mCxCyCxCyCxCy24m. The parameters are 4mstartx,24m 4mstarty,0m 4mendx,24m 4mendy,24m 4mmousex,24m and 4mmousey.24m 4mstartx,24m 4mstarty,24m 4mendx,24m and 4mendy24m give the starting and ending character positions of the region. 4mmousex24m and 4mmousey24m give the location of the mouse at button up, which may not be over a character. Button-event tracking is essentially the same as normal tracking, but 4mxterm24m also reports button-motion events. Motion events are reported only if the mouse pointer has moved to a different character cell. It is enabled by specifying parameter 1002 to DECSET. On button press or release, 4mxterm24m sends the same codes used by normal tracking mode. On button-motion events, 4mxterm24m adds 32 to the event code (the third charac- ter, 4mCb24m). The other bits of the event code specify button and modifier keys as in normal mode. For example, motion into cell x,y with button 1 down is reported as CSI M @ 4mCxCy24m. ( @ = 32 + 0 (button 1) + 32 (motion indicator) ). Similarly, motion with button 3 down is reported as CSI M B 4mCxCy24m. ( B = 32 + 2 (button 3) + 32 (motion indicator) ). Any-event mode is the same as button-event mode, except that all motion events are reported, even if no mouse button is down. It is enabled by specifying 1003 to DECSET. 1mTektronix 4014 Mode0m 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-through 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 4mxterm24m) (ESC Ctrl-N) ESC SI End 4015 APL mode (ignored by 4mxterm24m) (ESC Ctrl-O) ESC ETB COPY (Save Tektronix Codes to file COPYyyyy-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 OSC 4mPs24m ; 4mPt24m BEL Set Text Parameters of VT window 4mPs24m = 0 -> Change Icon Name and Window Title to 4mPt0m 4mPs24m = 1 -> Change Icon Name to 4mPt0m 4mPs24m = 2 -> Change Window Title to 4mPt0m 4mPs24m = 4 6 -> Change Log File to 4mPt24m (normally disabled by a compile-time option) ESC ` 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-_) 1mVT52 Mode0m Parameters for cursor movement are at the end of the ESC Y escape sequence. Each ordinate is encoded in a single character as 4mvalue24m+32. For example, ! is 1. The screen coordinate system is 0-based. ESC A Cursor up. ESC B Cursor down. ESC C Cursor right. ESC D Cursor left. ESC F Enter graphics mode. ESC G Exit graphics mode. ESC H Move the cursor to the home position. ESC I Reverse line feed. ESC J Erase from the cursor to the end of the screen. ESC K Erase from the cursor to the end of the line. ESC Y 4mPs24m 4mPs24m Move the cursor to given row and column. ESC Z Identify -> ESC / Z (``I am a VT52.'') ESC = Enter alternate keypad mode. ESC > Exit alternate keypad mode. ESC < Exit VT52 mode (Enter VT100 mode).