[ From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 23-OCT-1990 21:22:57.69  To:	MRGATE::"ARISIA::EVERHART" CC:	' Subj:	VT100/52/ANSI et.al. Escape codes   * Received:  by crdgw1.ge.com (5.57/GE 1.76)) 	 id AA14769; Tue, 23 Oct 90 20:05:11 EDT / Message-Id:  <9010240005.AA14769@crdgw1.ge.com> X Received: From PUCC.PRINCETON.EDU by CRVAX.SRI.COM with TCP; Tue, 23 OCT 90 12:11:41 PDT{ Received: from VUVAXCOM.BITNET by pucc.PRINCETON.EDU (IBM VM SMTP R1.2.2MX) with BSMTP id 3713; Tue, 23 Oct 90 15:02:57 EDT " Date:     Tue, 23 Oct 90 15:00 ESTI From: <20950709%VUVAXCOM.BITNET@pucc.PRINCETON.EDU> (Jim Mc Ree [Merlin]) + Subject:  VT100/52/ANSI et.al. Escape codes  To: Info-Vax@KL.SRI.COM  X-Original-To:  InfoVAX     4                                 Villanova University=                         Campus Computing - Terminal Emulation D                   Includes VT100 and VT52 Terminal and Control Codes  N         This file contains control and terminal codes for the VT100 terminals,L ANSI terminals, and VT52 terminals. Many of the codes were derived from PC -M INTERCOMM, from Mark of the Unicorn Software.  I have researched some of them  and added some of my own.   2                                         Thank you,O                                         Jim Mc Ree  (209507097@VUVAXCOM.BITNET)   P (* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** *)  6                               CONTROL SEQUENCE SUMMARY  K   * For additional information on the DEC VT100 and VT102 terminals, please K     consult the VT100 USER GUIDE and VT102 USER GUIDE, published by Digital F     Equipment Corporation as part numbers EK-VT100-UG and EK-VT102-UG.     CONTROL CHARACTERS:  ------------------  	 Character  Name    Decimal Action Taken? --------------------------------------------------------------- 1 NUL     0       Fill character; ignored on input. , ENQ     5       Transmit answerback message. BEL     7       Ring the bell.! BS      8       Move cursor left. - HT      9       Move cursor to next tab stop. 8 LF      10      Line feed; causes print if in autoprint. VT      11      Same as LF.  FF      12      Same as LF. 6 CR      13      Move cursor to left margin or newline.( SO      14      Invoke G1 character set.( SI      15      Invoke G0 character set.$ XON     17      Resume transmission." XOFF    19      Halt transmission.@ CAN     24      Cancel escape sequence and display checkerboard. SUB     26      Same as CAN.- ESC     27      Introduce a control sequence. 1 DEL     127     Fill character; ignored on input.   O   * All characters less than 32 decimal which are not listed above are ignored.   P (* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** *)   ANSI MODE SUMMARY: -----------------   F   *In ANSI sequences, parameters are given as a string of ASCII digitsJ    ('0' - '9') seperated by semicolons.  Pn refers to a number whose value<    used directly.  Ps refers to a number used as a selector.   CURSOR MOVEMENT: ---------------   "         Cursor Up:      Esc [ Pn A"         Cursor Down:    Esc [ Pn B"         Cursor Left:    Esc [ Pn C"         Cursor Right:   Esc [ Pn D  7         Direct Addressing :  Esc [ Pn(row);Pn(col);H or 4                              Esc [ Pn(row);Pn(col);f  *                              ie.  (Pascal)J                                 Writeln (Esc,'[',Row:1,';',col:1,';','H');           Index:          Esc D          New Line:       Esc E          Reverse Line:   Esc M   +         Save cursor & Attributes:     Esc 7 +         Restore cursor & attributes:  Esc 8    ERASING: -------   /         Cursor to end of line           Esc [ K 1         Beginning of line to cursor     Esc [ 1 K 1         Entire line                     Esc [ 2 K /         Cursor to end of screen         Esc [ J 1         Beginning of screen to cursor   Esc [ 1 J 1         Entire screen                   Esc [ 2 J    MODES: -----   "         Set with        Esc [ Ps h"         Reset with      Esc [ Ps l  5 Mode name               Ps      Set             Reset C ------------------------------------------------------------------- 8 Keyboard action         2       Locked          Unlocked9 Insertion               4       Insert          Overwrite 4 Send - Receive          12      Full            Echo9 Line feed/New line      20      New line        Line feed 6 Cursor key              ?1      Application     Cursor4 ANSI/VT52               ?2      ANSI            VT522 Column                  ?3      132             804 Scrolling               ?4      Smooth          Jump6 Screen                  ?5      Reverse         Normal8 Origin                  ?6      Relative        Absolute8 Wraparound              ?7      Wrap            Truncate9 Auto key repeat         ?8      Repeating       No repeat 2 Print form feed         ?18     Yes             No@ Print extent            ?19     Full screen     Scrolling region   Keypad application      Esc =  Keypad numeric mode     Esc >    EDITING: -------   *         Insert line             Esc [ Pn L*         Delete line             Esc [ Pn M*         Delete character        Esc [ Pn P7         Scrolling region        Esc [ Pn(top);Pn(bot) r   	 PRINTING:  --------  '         Print screen or region  Esc [ i +         Print cursor line       Esc [ ? 1 i +         Enter auto print        Esc [ ? 5 i +         Exit auto print         Esc [ ? 4 i )         Enter print controller  Esc [ 5 i )         Exit print controller   Esc [ 4 i   
 LINE SIZE:	 ---------   J         The following is a list of the available styles of printing on theM screen.  "Yes" in any column means that the option is supported by the escape M code on that line.  "No" means that the option is not supported by the escape I code on that line; however, it may, and almost certainly is, supported by O another escape sequence.  Double height and double width double the size of the J characters in their respective ways (ie. Double height is twice as tall asO usual).  _Line designates underlining.  Blink is for blinking characters.  Side P is the orientation of the character.  Normal means that there is no orientation.I Top and bottom refers to the position of the character in order to make a N complete character.  The top and bottom sequences will be important if you useI the double height option.  You will need to print the line twice to get a P complete line.  The first printing will print the top part of the characters andP the second printing will print the bottom part.  Inverse refers to the conditionK of the character.  "No" indicates that the character will be printed in the O color it normally is printed in with its usual backround.  "Yes" means that the N character will be printed in the backround color and the character's backroundN will be the color it is usually printed in.  Shade refers to the brightness ofN the character.  Normal is the standard brightness of the character.  Bright isK bold type.  Dark is a darker brightness than usual.  The escape code is the M command you would type before the text you want to print to get the indicated H effects.  This section was greatly expanded in version 1.1 of this file.   Double  DoubleC Height  Width   _Line   Blink  Side    Inverse  Shade   Escape Code G ----------------------------------------------------------------------- @  No      No       No     No    Normal    No     Normal  <ESC>[0mG  Yes     Yes      No     No    Top       No     Bright  <ESC>#3<ESC>[1m G  Yes     Yes      No     No    Bottom    No     Bright  <ESC>#4<ESC>[1m G  Yes     Yes      No     No    Top       No     Dark    <ESC>#3<ESC>[2m G  Yes     Yes      No     No    Bottom    No     Dark    <ESC>#4<ESC>[2m G  Yes     Yes      No     No    Top       No     Normal  <ESC>#3<ESC>[3m G  Yes     Yes      No     No    Bottom    No     Normal  <ESC>#4<ESC>[3m G  Yes     Yes      Yes    No    Top       No     Normal  <ESC>#3<ESC>[4m G  Yes     Yes      Yes    No    Bottom    No     Normal  <ESC>#4<ESC>[4m G  Yes     Yes      No     Yes   Top       No     Normal  <ESC>#3<ESC>[5m G  Yes     Yes      No     Yes   Bottom    No     Normal  <ESC>#4<ESC>[5mEG  Yes     Yes      No     No    Top       Yes    Normal  <ESC>#3<ESC>[7mAG  Yes     Yes      No     No    Bottom    Yes    Normal  <ESC>#3<ESC>[7m G  No      Yes      No     No    Normal    No     Normal  <ESC>#6<ESC>[0m2G  No      Yes      No     No    Normal    No     Bright  <ESC>#6<ESC>[1m G  No      Yes      No     No    Normal    No     Dark    <ESC>#6<ESC>[2m1G  No      Yes      Yes    No    Normal    No     Normal  <ESC>#6<ESC>[4m1G  No      Yes      No     Yes   Normal    No     Normal  <ESC>#6<ESC>[5m2G  No      Yes      No     No    Normal    Yes    Normal  <ESC>#6<ESC>[7mJG  No      No       No     No    Normal    No     Bright  <ESC>#7<ESC>[1mnG  No      No       No     No    Normal    No     Dark    <ESC>#7<ESC>[2m G  No      No       Yes    No    Normal    No     Normal  <ESC>#7<ESC>[4mTG  No      No       No     Yes   Normal    No     Normal  <ESC>#7<ESC>[5mdG  No      No       No     No    Normal    Yes    Normal  <ESC>#7<ESC>[7mo  N * Some codes have been eliminated due to a repitition of effects.  To the bestL   of my knowledge, these codes are complete and correct.  If you should findG   any errors, or you find some new sequences/effects, please inform me.   J * <ESC>#3 and <ESC>#4 behave in the same way as <ESC>#3[3m and <ESC>#4[4m.   CHARACTER SETS:X --------------  * Character set           G0              G15 ----------------------------------------------------- / United Kingdom (UK)     Esc ( A         Esc ) Ad/ United States (US)      Esc ( B         Esc ) Be/ Graphics                Esc ( 0         Esc ) 0E/ Default ROM             Esc ( 1         Esc ) 1 / Alternate ROM           Esc ( 2         Esc ) 2   - Switch to G0/G1         Esc O           Esc N-  
 TAB STOPS:	 ---------   -         Set tab at current column       Esc H-/         Clear tab at current column     Esc [ gU1         Clear all tabs                  Esc [ 3 gN   MISCELLANEOUS:
 -------------            Reset           Esc ce  *         Character attributes    Esc [ Ps m&                 0 - All attributes off                 1 - Bold one!                 4 - Underscore onT                 5 - Blink on                 7 - Reverse on  *         Programmable LEDs       Esc [ Ps q                  0 - All LEDs off*           (1 - 4) - Turn respective LED on  '         Fill screen with "E"s   Esc # 8s  P (* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** *)   NON - VT100 CONTROL SEQUENCES: -----------------------------   H         *Some VT100 terminal programs also understand a few other escapeL          sequences than the standard VT100.  I cannot guarantee any of theseN          non - standard codes will work with any particular terminal, but they'          may be useful if they do work.:  N         Transmit a file         Esc { T filenameCR   ---> CR = Carriage ReturnN         Receive a file          Esc { R filenameCR   ---> CR = Carriage ReturnN         Append to a file        Esc { A filenameCR   ---> CR = Carriage Return'         Save collected text     Esc { Su%         Save collected text     Esc Sr  L         * These sequences will probably be most useful in developing a microE           version of a VT100 emulator or in adapting an existing one.   P (* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** *)   VT52 MODE SUMMARY: -----------------   %         Cursor up               Esc A'%         Cursor down             Esc B %         Cursor right            Esc C %         Cursor left             Esc Da%         Graphics character set  Esc F %         ASCII character set     Esc G %         Home cursor             Esc Hr%         Reverse line feed       Esc I %         Erase to end of screen  Esc J %         Erase to end of line    Esc K %         Print cursor line       Esc Vn%         Enter print controller  Esc We%         Exit print controller   Esc X -         Cursor address          Esc Y row col %         Identify                Esc Zi%         Print screen            Esc ]h%         Enter auto print        Esc ^ %         Exit auto print         Esc --%         Alternate keypad        Esc =-%         Numeric keypad          Esc >o%         Enter ANSI mode         Esc <k  I         * Row and column numbers are single characters with a bias of 31.e(           E.g., "$" means row/column 5.)    KEYPAD AND FUNCTION KEY SUMMARY: -------------------------------            CURSOR CONTROL KEYS:         ------------------- A                                 Vt52    ANSI and Cursor Key modes ;                 Arrow Key       Mode    Reset           Set C                 ---------------------------------------------------r?                 Up              Esc A   Esc [ A         Esc O Ad?                 Down            Esc B   Esc [ B         Esc O B ?                 Right           Esc C   Esc [ C         Esc O C ?                 Left            Esc D   Esc [ D         Esc O Ds           AUXILLIARY KEYPAD:         -----------------   >                      VT52 Mode                       ANSI ModeK         Key     Numeric         Application     Numeric         ApplicationnN         ----------------------------------------------------------------------G         0       0               Esc ? p         0               Esc O poG         1       1               Esc ? q         1               Esc O q G         2       2               Esc ? r         2               Esc O r G         3       3               Esc ? s         3               Esc O scG         4       4               Esc ? t         4               Esc O t G         5       5               Esc ? u         5               Esc O unG         6       6               Esc ? v         6               Esc O vlG         7       7               Esc ? w         7               Esc O w G         8       8               Esc ? x         8               Esc O xeG         9       9               Esc ? y         9               Esc O y G         -       -               Esc ? m         -               Esc O m G         ,       ,               Esc ? l         ,               Esc O leG         .       .               Esc ? n         .               Esc O n G         ENTER   ^M              Esc ? M         ^M              Esc O MrG         PF1     Esc P           Esc P           Esc O P         Esc O PiG         PF2     Esc Q           Esc Q           Esc O Q         Esc O QrG         PF3     Esc R           Esc R           Esc O R         Esc O RnG         PF4     Esc S           Esc S           Esc O S         Esc O Sb   VT100 CURRENT STATES:r --------------------  ,         Esc [ c         DA:Device Attributes                           or  ;         Esc Z           DECID:Identify Terminal (ANSI mode)m  G                         * Irrespective of the parameter(s) present, thea,                           response is always  +                                 Esc [ ? 6 cs,                                 ie. a VT102.  ,         Esc Z           Identify (VT52 mode)  B                         * The sequence Esc / Z is always returned.  @         Esc [ <sol> x   DECREQTPARM: Request Terminal Parameters  F                         * <sol> values other than 1 are ignored.  UponF                           receipt of a <sol> value of 1, the following+                           response is sent:-  J                                 Esc[3;<par>;<nbits>;<xspeed>;<rspeed>;1;0x  N                                 * Where <par>, <nbits>, <xspeed>, and <rspeed>F                                   are as for VT100s with the following-                                   exceptions:Y  J                                   <nbits>       Values of 5 and 6 bits perM                                                 character are sent as 7 bits.o  3                                   <xspeed>,<rspeed>YM                                                 These two numbers will always J                                                 be the same.  9600 baud isC                                                 sent for 7200 baud.   1         Esc [ Ps n      DSR: Device Status ReportC  H                         * Parameter values other than 5, 6, are ignored.C                           If the parameter value is 5, the sequenceEK                           Esc [ O n is returned.  If the parameter value is#E                           6, the CPR: Cursor Position Report sequenceCH                           Esc [ Pn ; Pn R is returned with the Pn set to8                           cursor row and column numbers.  