home *** CD-ROM | disk | FTP | other *** search
- Credit for the original compilation of this file goes to Cameron Simpson.
- Subsequent additions/extensions marked by (|) in left margin. I have taken
- the liberty of reordering some passages.
- Tim Challis July `85
- --------------------------------------------------------------------------
- Control Codes Recognized by the VT-101
- Name Mnem- Octal Function
- onic Code
- ===============================================================================
- Null NUL 000 Ignored when received (not stored in input
- buffer), used as fill character.
- Enquire ENQ 005 Transmits answerback message.
- Bell BEL 007 Generates bell tone.
- Backspace BS 010 Moves cursor left one position, except in left
- column, where no action occurs.
- Horizontal Tab HT 011 Moves cursor to the next tab stop, or to the
- right margin if there are no more tab stops.
- Line Feed LF 012 Causes line feed or new line operation.
- (See line feed/new line mode.)
- Vertical Tab VT 013 Processed as LF.
- Form Feed FF 014 Processed as LF.
- Shift Out SO 016 Select G1 character set.
- Shift In SI 017 Select G0 character set.
- Device DC1 021 Processed as XON.
- Control 1 Causes terminal to recommence transmitting
- characters following receipt of XOFF code.
- Device DC3 023 Processed as XOFF.
- Control 3 Causes terminal to stop transmitting all
- characters except XON and XOFF.
- Cancel CAN 030 If received during an escape or control
- sequence, the sequence is cancelled and the
- substitution character (block) is displayed.
- Characters of the sequence received after the
- cancel character are displayed.
- Substitute SUB 032 Processed as CAN.
- Escape ESC 033 Processed as a sequence introducer.
- Delete DEL 177 Ignored when received (not stored in input
- buffer).
- -------------------------------------------------------------------------------
- Escape Sequences Recognised by the VT101
- ===============================================================================
- ESC # 3 Causes current line to become top half of a double
- width and double height line. Sequences must be used
- in pairs on adjacent lines. The same character must be
- displayed on both lines to form full characters.
- If the line is single width and single height, all
- characters to the right of the centre of the screen
- are lost.
- ESC # 4 As above for bottom half of line.
- ESC # 5 Causes current line to become single width and single
- height. This is the attribute of all new lines on the
- screen.
- ESC # 6 Causes the current line to become double width and
- single height. If the line is single width and single
- height, all characters to the right of the centre of
- the screen are lost.
- ESC # 8 Fills the entire screen with "E"s for screen focusing
- and alignment.
- ESC ( 0 Sets G0 as the special character & line drawing set.
- ESC ( A Sets G0 as the UK character set.
- ESC ( B Sets G0 as the US character set.
- ESC ) 0 Sets G1 as the special character & line drawing set.
- ESC ) A Sets G1 as the UK character set.
- ESC ) B Sets G1 as the US character set.
- ESC N Select G2 character set.
- ESC O Select G3 character set.
- The VT101 has 4 character sets: G0, G1, G2 and G3.
- Sets G2 and G3 are always the United States standard
- ASCII set (on unadorned VT101's [TC]). Sets G0 and
- G1 are selected by the SI and SO control codes.
- (See the Control Codes section.)
- The US & UK sets differ only in that the US set has
- a crosshatch, and the UK set a pound symbol.
- ESC 7 Saves cursor position, character attribute, and
- character set. (See next sequence.)
- ESC 8 Restore previously saved cursor position, character
- attribute, and character set. If none were saved,
- cursor moves to the origin.
- ESC < All sequences are interpreted according to ANSI
- standards X3.64-1979 and X3.41-1974. The VT52 escape
- sequences are not recognised.
- | i.e. a means of switching out of VT-52 emulation
- | mode; a complete no-op whilst in ANSI mode.
- ESC = Select alternate keypad mode.
- ESC > Select numeric keypad mode.
- In both modes the PF keys are as follows :-
- PF1 ESC O P
- PF2 ESC O Q
- PF3 ESC O R
- PF4 ESC O S
- In numeric keypad mode, the other keys are as
- labelled, and <ENTER> mimics the <RETURN> key.
- In alternate keypad mode, the keys return :-
- 0 ESC O p
- 1 ESC O q
- 2 ESC O r
- 3 ESC O s
- 4 ESC O t
- 5 ESC O u
- 6 ESC O v
- 7 ESC O w
- 8 ESC O x
- 9 ESC O y
- minus ESC O m
- comma ESC O l
- period ESC O n
- <ENTER> ESC O M
- ESC D Move cursor down one line in same column. If cursor
- already at bottom of scrolling region, do a scroll.
- ESC E Move cursor to first position on next line. If cursor
- already at bottom of scrolling region, do a scroll.
- ESC H Set a tab stop at the cursor position.
- ESC M Move cursor up one line in same column. If cursor
- already at top of scrolling region, do a scroll.
- ESC N Select G2 character set. (See "ESC ) 0", etc.)
- ESC O Select G3 character set. (See "ESC ) 0", etc.)
- ESC [ J Erase from cursor to end of screen, including current
- position. All erased lines become single width and
- single height.
- ESC [ 0 J As for ESC [ J.
- ESC [ 1 J Erase from beginning of screen to cursor, including
- current position. All erased lines become single width
- and single height.
- ESC [ 2 J Erase entire display. The cursor does not move. All
- lines become single width and single height.
- ESC [ K Erase from cursor to end of line, including current
- position.
- ESC [ 0 K As for ESC [ K.
- ESC [ 1 K Erase from beginning of line to cursor, including
- current position.
- ESC [ 2 K Erase entire line.
- ESC [ 0 g Clear tab stop at the cursor position.
- |ESC [ m Turn off video attributes.
- ESC [ 0 m Turn off attributes.
- |ESC [ 4 m If cursor is currently set to Block, then all text
- | following the ESC [4m will be in reverse video (i.e.
- | black-on-white, or white-on-black) compared with the
- | current screen setting. If, however, the cursor is
- | currently set to Underscore, then the following text
- | will be underlined.
- |ESC [ 7 m As for ESC [ 4 m.
- | (A little background:
- | The VT101 was introduced essentially as a cut-
- | down version of the DEC VT100 model, which
- | recognised the following video attribute
- | commands:
- | ESC [ 0 m -> All attributes off.
- | ESC [ 1 m -> Enhanced (bold) video ON.
- | ESC [ 4 m -> Underline commence.
- | ESC [ 5 m -> Text blink commence.
- | ESC [ 7 m -> Reverse video commence.
- | I have experimented with the TATUNG brand terminals
- | the CSD has been installing lately, and have found
- | all of the above features actually work. VT100
- | emulating terminals are common at present, so I
- | advocate experiment.
- | End of aside.)
- || The TATUNG and VT-240 terminals occasionally enter
- || `insert mode' on power-up where characters to be
- || displayed cause the entire line to the right of
- || the cursor to be shifted one position to the right
- || to make room for the new character. As a consequence,
- || some sequences (like char backspace char for special
- || effect) produce strange results. The mode is not a
- || permanent attribute of the terminal, and may
- || occasionally (at least on the TATUNGs) be reset
- || by repeating the power-up sequence. I have not found
- || a way to set or reset this mode without powering
- || the terminal down and back up again.
- || - Cameron Simpson
- ESC [ 2 ; 1 0 y Repeats data loop-back test until failure or power
- down.
- ESC [ 2 ; 1 y Power-up test. Terminal resets and performs power-up
- test.
- ESC [ 2 ; 2 y Data loop-back test. Uses test connector.
- |ESC [ 2 ; 8 y Halt state; never returns. Of academic interest only.
- ESC [ 2 ; 9 y Repeats power-up test continuously until failure or
- power down.
- | Initiating this test and then sending sufficient line
- | feed characters for the terminal to lock back onto
- | the input stream will cause the screen to blink at
- | about 2 Hz. This is the only non-software method I
- | have ever been able to discover to cause the VT101
- | to blink its display.
- ESC [ 3 g Clear all tab stops.
- ESC [ H Move cursor to home position. Home also depends on the
- origin mode.
- ESC [ Pl ; Pc H Move cursor to line Pl, column Pc. If Pl or Pc are not
- selected or zero, cursor moves to first line or column
- respectively. Line numbering and ability to move
- beyond scrolling region are controlled by the origin
- mode.
- ESC [ Pl ; Pc f As for ESC [ Pl ; Pc H.
- ESC [ Pn A Move cursor up Pn lines in current column. Cursor
- stops at top of scrolling region.
- ESC [ Pn B Move cursor down Pn lines in current column. Cursor
- stops at bottom of scrolling region.
- ESC [ Pn C Move cursor right Pn columns in current line. Cursor
- stops at the right margin.
- ESC [ Pn D Move cursor left Pn positions in current line. Cursor
- stops at the left margin.
- ESC [ Ps ;...; Ps q Loads keyboard indicators as follows :-
- Ps Function
- 0 All are off
- 1 L1 is on
- 2 L2 is on
- 3 L3 is on
- 4 L4 is on
- ESC [ Ps q As above.
- ESC [ Ps ;...; Ps h Sets specified parameters.
- ESC [ Ps ;...; Ps l Resets specified parameters.
- Parameters are separated by ";".
- If the "[" is followed by a "?", the parameters are
- ANSI private parameters.
-
- ANSI specified modes :-
- 0 Ignored.
- 20 Line feed/new line.
- When set, LF or CR moves the cursor to the
- first character of the next line. RETURN
- transmits a carriage return and a line feed
- code. When reset, LF moves the cursor to the
- current column in the next line. RETURN
- transmits a carriage return control character.
-
- ANSI private modes :-
- 0 Ignored.
- 1 Cursor key.
- When set, the cursor control keys (arrows)
- generate application control functions.
- These are :-
- Up ESC O A
- Down ESC O B
- Right ESC O C
- Left ESC O D
- When reset, the arrows generate the ANSI
- specified cursor control sequences.
- These are :-
- Up ESC [ A
- Down ESC [ B
- Right ESC [ C
- Left ESC [ D
- 2 ANSI/VT52.
- | Obviously ESC [ ? 2 h is a no-op. ESC [ ? 2 l
- | may be reversed by ESC < sequence (VT-52 mode)
- 3 Column.
- When set, the screen is 14 rows of 132
- columns. When reset, the screen is 24 rows
- of 80 columns.
- When switching between 80 and 132, the screen
- is erased.
- 4 Scroll.
- When set, scrolling is smooth. A maximum of
- six lines may be added to the screen at a time
- in this mode. Auto XON/XOFF should be set in
- this mode so that characters are not lost.
- 5 Screen.
- When reset, the screen is black.
- 6 Origin.
- When set, the cursor cannot be moved outside
- the scrolling region. Lines on the screen are
- numbered. The origin is always line 1,
- column 1. When origin mode is set, the origin
- is always the first line and first column of
- the scrolling region. When origin mode is
- reset, the origin is the first character on
- the screen. Power-up or RESET causes origin
- mode to be reset.
- 7 Auto wrap.
- When reset, characters received while cursor
- is at the right margin overwrite the character
- there.
- 8 Auto repeat.
- half a second repeats at about 30 times a
- second. SET-UP, ESC, RETURN, ENTER, NO SCROLL,
- and all CNTRLed keys do not repeat.
- 9 Interlace.
- When set, the terminal uses 480 scan lines per
- screen. When reset, the terminal uses 240 scan
- lines per screen.
- ESC [ Pt ; Pb r Set top and bottom of scrolling region. If Pt and Pb
- are omitted, the whole screen is used. The scrolling
- region must be at least two lines. Thus, Pt must be
- strictly less than Pb. When the scrolling region is
- set, the cursor moves to the new home position.
- Single line scrolling regions are allowed, but be
- prepared for the consequences. Most operating systems
- (including UNIX and VMS) put the cursor on a new
- (clear) line before accepting the next command. The
- result is, of course, you never see anything. Beware!
- ESC [ f As for ESC [ H.
- ESC [ g Clear tab stop at the cursor position.
- |ESC [ 0 n Transmitted BACK to host in response to an ESC [ 5 n
- | terminal status request to indicate a correctly
- | functioning terminal. See below.
- |ESC [ 3 n Transmitted BACK in response to ESC [ 5 n to indicate
- | sub-standard operation. See below.
- |ESC [ 5 n Request a status response from terminal. If terminal
- | is receiving and healthy, then the sequence ESC [ 0 n
- | is echoed back. An echo of ESC [ 0 n indicates an
- | unspecified problem. Of course no response at all...
- |ESC [ 6 n Report cursor position. Terminal responds with:
- | ESC [ LL ; CC R
- | where LL=cursor line number in ASCII decimal,
- | CC=cursor column number in ASCII decimal
- | format.
- |ESC [ c Request for terminal to identify itself. Response is:
- | ESC [ ? 1 ; x c
- | where x = 0 for VT101 or unadorned VT100,
- | 1 " VT100 with processor option,
- | 2 " " " advanced video,
- | 3 " " " (1 & 2 above)
- | 4 " " " graphics processor,
- | 5 " " " (1 & 4 above),
- | 6 " " " (2 & 4 above),
- | 7 " " " (1,2 & 4 above).
- |ESC [ 0 c Same as ESC [ c.
- |ESC Z Same as ESC [ c. For some unspecified reason this
- | escape sequence is NOT recommended by DEC.
- | Unfortunately, for compatibility reasons, this is
- | the code POP11's VED sends out during its terminal
- | identification phase.
- ESC c Resets terminal to initial state from user permanent
- memory. After a reset, keypad numeric mode is
- selected, cursor key mode and origin mode are reset,
- and the scrolling region is set to the entire screen.
- | Has exactly the same effect of typing SETUP-0 from
- | keyboard.
- -------------------------------------------------------------------------------
- |SET-UP FUNCTIONS IMPLEMENTED ON THE "STANDARD" VT101
- |------ --------- ----------- -- --- ---------- -----
- |
- |SHIFT- KEY FUNCTIONS
- |
- | While in SETUP mode, the following options are available. Capitalised
- | words are of mnemonic meaning only, and should not be taken to be Digital
- | Equipment approved or recognised terms. Most shift- functions clear the
- | screen and momentarily display the message "WAIT" in the top left corner
- | of the video display. Irrespective of previous state, the terminal is
- | always returned to SETUP A on function completion.
- |
- | Shift-A -> Enter ANSWERBACK. The answerback is a string of up to 20 ASCII
- | characters which the terminal will broadcast if either an ENQ
- | (ASCII 005) character is received, or the key combination
- | control-break is typed. The answerback entry sequence is as
- | follows: First a delimiter character is accepted, followed by up
- | to 20 characters, terminated either by entry of the 22nd
- | character (20 characters + 2 delimiters), or by second entry of
- | the delimiter character. No editing of the sequence is allowed
- | during entry, with all typed characters being included in the
- | 20 character string. Control codes, backspaces etc. are displayed
- | as diamonds during entry.
- | Shift-D -> Recall DEFAULT terminal state. The terminal is reset to a
- | factory-determined state (key-click ON, 9600 baud send and
- | receive etc.). Not useful for terminal set-up at U.N.S.W. at
- | time of writing.
- | Shift-P -> Cycle PARITY states. The terminals idea of how line parity should
- | be is cycled through the states:
- | +------------------+-------+-------+-------+-------+-------+
- | | Read chart ^->| | Mark | Space | Odd | Even | None |
- | | clockwise: |<-v | . .Parity . . |
- | +------------------+-------+-------+-------+-------+-------+
- | | 7 bits/character | 7M | 7S | 7O | 7E | 7N |
- | +------------------+-------+-------+-------+-------+-------+
- | | 8 bits/character | -- | 8N | 8E | 8O | -- |
- | +------------------+-------+-------+-------+-------+-------+
- | For reasons unknown by this party, terminals attached to UNIX
- | sites on campus tend to be set to the 7S state, whilst VMS sites
- | tend to have terminals set to the 8E state. My personal opinion
- | is that all U.N.S.W. terminal line drivers ignore parity anyway
- | so the state doesn't matter. See for yourself.
- | Shift-R -> RECALL a previously customised state saved by:
- | Shift-S -> SAVE a customised terminal state. After setting a terminal into
- | a state of which you approve, typing shift-S under SETUP B will
- | record the terminal characteristics in an internal semi-
- | permanent memory, which is recalled upon power-up, reset, and of
- | course, SETUP B shift-R.
- | Shift-T -> Resets TAB positions to the well known every-8th-column format.
- | Handy for quick recovery from a botched job of redefining tab
- | positions.
-
- TATUNG SETUP MODE
- The TATUNG setup mode is entered by typing <SHIFT><CNTL><SETUP>.
- The different features are selected with the arrow keys. The
- up and down arrows select which option to modify, and the left and
- right arrows select its new value. To leave the setup mode, just
- hit the <SETUP> key.
- Note that before you leave a particular option after changing it,
- you must press <RETURN>, otherwise to change will be discarded.
- As with the VT-101, you must type <SHIFT> S to save your changed
- options to prevent loss when the terminal is switched off.
- The most useful feature of setup is to set the terminal to 19200
- baud on VMS sites. Since VMS has auto-baudrate recognition, it
- will adjust to accomodate the higher speed, making full screen
- editors quite useful. The only problem seems to be that if you are
- typing rapidly while the terminal is receiving a lot of data, it
- will occasionally miss a keystroke. This problem does not seem to
- occur at the next speed down (9600 baud).
- NOTE: This will not work on terminals connected to the Vladimir
- switch, as this seems to only permit 2400 baud.
- -------------------------------------------------------------------------------
-