AVC(4) — UNIX Programmer’s Manual
NAME
avc − Acorn Video Console terminal emulation
DESCRIPTION
This manual page describes the emulated terminal interface provided as part of the more general VC (Video Console) interface in RISC iX; for an overview of the latter, see vc(4). The emulated terminal interface is here referred to by the term ‘AVC’.
COMPARISON WITH VT220
The AVC interface has been designed to be largely compatible with the Digital Equipment Corporation’s VT220 terminal, particularly in respect of display behaviour, although there are also a number of extensions, for example in display control and keyboard coding options. The interface is therefore now defined as a set of differences with respect to the DEC VT220 terminal definition. The reference for the VT220 used is the document ‘VT220 Programmer Reference Manual’, published by Digital Equipment Corporation (ref. EK-VT220-RM-002). The following table summarises the main areas in which the two terminal interfaces differ from a programmer’s standpoint. In other areas the AVC terminal is either compatible or has a superset of the VT220’s facilities (e.g. with the AVC terminal, keyboard auto-repeat timing parameters are adjustable from the Set-Up screen, whereas on the VT220 they are fixed). Finally, some differences arise from the basic display parameters: in particular, note that for all commands sent to the terminal where a row and/or column on the screen is specified, the AVC terminal will accept numbers for these according to the currently selected screen size; screen sizes differ between the VT220’s modes and the AVC terminal’s modes, and for the AVC terminal, are constrained in accordance with the configured monitor type.
| Parameter | VT220 | AVC |
| Screen | 24 rows X 80 columns | 20 rows X 80 columns |
| sizes | 24 rows X 132 columns | 24 rows X 80 columns |
| 25 rows X 80 columns | ||
| 30 rows X 80 columns | ||
| 30 rows X 100 columns | ||
| 37 rows X 100 columns | ||
| 32 rows X 96 columns | ||
| 45 rows X 144 columns | ||
| Screen size | by DECCOLM command or | from Set-Up screen or |
| selection | from Set-Up screen | by control sequence |
| Emulation | selectable from VT200 | fixed at VT200 7-bit |
| modes | (7/8 bit)/VT100/VT52 | for output; VT200 or |
| AVC modes can be | ||
| selected for keyboard | ||
| input coding | ||
| Operating | 3: Set-Up, on-line or | 2: Set-Up or on-line |
| states | local | |
| Local echo | not available | |
| mode | ||
| ‘Display | supported using set- | not available |
| controls’ | up screen option | |
| Editing | generate control | key legends differ. |
| keys block | sequences | In VT200 mode these |
| keys are inoperative | ||
| or special purpose. | ||
| In AVC mode, they send | ||
| AVC-specific control | ||
| sequences or cause | ||
| special actions. | ||
| Cursor keys | generate control | generate adjustable |
| sequences | sequences or have | |
| special actions | ||
| Numeric | has standard keys | as VT220 except ‘+’ |
| keypad | key: VT220 has ‘,’. | |
| In VT200 keyboard mode | ||
| this key sends ‘+’ in | ||
| keypad numeric mode, | ||
| SS3 ‘l’ (as VT220) in | ||
| keypad application | ||
| mode. | ||
| PF1-PF4 | above numeric pad | In VT200 keyboard mode |
| keys | generate control | the ‘/’, ‘∗’ and ‘#’ |
| sequences | keys on the numeric | |
| pad send PF2-4 codes; | ||
| Alt + ‘+’ on numeric | ||
| pad sends PF1 code. | ||
| In AVC keyboard mode | ||
| the numeric pad sends | ||
| either symbol codes | ||
| (Num Lock on) or AVC- | ||
| specific control | ||
| sequences. | ||
| Function | F1-F5 special actions | When keyboard is in |
| keys | F6-F20 send control | VT200 mode, only F3 |
| sequences | has special action | |
| (enters Set-Up menu). | ||
| VT220 keys F13-F20 are | ||
| emulated by pressing | ||
| Ctrl + F3-F10. The | ||
| AVC keyboard mode | ||
| provides a distinct | ||
| set of codes for keys | ||
| F1-F12; there are no | ||
| special actions. | ||
| Keyboard | keyboard lockable by | keyboard cannot be |
| lock | various conditions | locked at all |
| Received | ||
| codes: | ||
| ENQ | generates answerback | ignored |
| message | ||
| BS | always stops at left | if enabled, BS at |
| margin | left margin moves | |
| to end of previous | ||
| line | ||
| DC1 | flow-control action | ignored |
| DC3 | (XON/XOFF): lock/ | ignored |
| unlock keyboard | ||
| SUB | cancels an incomplete | cancels sequence but |
| command sequence and | does not cause any | |
| causes display of a | character to be | |
| reverse question mark | displayed | |
| DEL | is ignored when | displays 96th char- |
| received | acter in current set | |
| (this is blank in all | ||
| character sets except | ||
| ISO Latin 1) | ||
| Compatibil- | selectable by command | fixed at VT200/7-bit. |
| ity level | The DECSCL command is | |
| ignored. | ||
| Character | ASCII (code ‘B’), DEC | |
| set desig- | supplemental (‘<’) and | |
| nation | DEC special graphics | |
| (’0’) are available. | ||
| The ISO Latin 1 char- | ||
| acter set is provided | ||
| as an extension, using | ||
| code ‘I’. National | ||
| character set mode and | ||
| the various national | ||
| sets are unavailable. | ||
| Character | Individual characters | not supported; the |
| attributes | on the screen may be | selective erasure |
| (DECSCA) | protected against | commands are accepted |
| deletion by DECSEL/ | but erase all the | |
| DECSED selective | characters in the | |
| erasure commands | specified area. | |
| Selectable | ||
| modes: | ||
| KAM | keyboard lock/unlock | ignored |
| SRM | send/receive mode | ignored |
| DECANM | ANSI/VT52 mode | ignored: VT200 mode |
| DECPFF | print form feed mode | ignored |
| DECPEX | print extend mode | ignored |
| DECSCLM | smooth/jump scroll | ignored: jump scroll |
| DECCOLM | 80/132 column modes | ignored: (variable) |
| DECNRCM | national character | ignored: multinational |
| set mode | ||
| Character | controls character | range of renditions |
| rendition | display properties | supported varies with |
| screen mode and type | ||
| of monitor | ||
| Printing | output of screen data | print screen is not |
| to local printer | supported: all modes, | |
| commands etc. related | ||
| to it are ignored. | ||
| User- | DECUDK command allows | not supported: ignored |
| definable | Shift+(F6-F20) to | |
| keys | send user-defined | |
| character sequences | ||
| Down-line- | DECDLD command allows | not supported: ignored |
| loadable | soft character set | |
| characters | to be defined | |
| Report | DA and DSR commands | not supported: ignored |
| status | request terminal | |
| commands | status information | |
| Identifi- | DECID commands | not supported: ignored |
| cation | request terminal ID | |
| Terminal | DECSTR, RIS commands | not supported: ignored |
| reset | ||
| Test | DECTST and DECALN | not supported: ignored |
| commands |
CHARACTER SET CONTROL
The AVC interface is compatible with the DEC VT220 in respect of the way that the available character fonts are mapped onto display (i.e. output) character codes (albeit with some changes in regard to which character fonts are actually available).
There are two stages of character mapping: display code set (i.e. printing characters received in the stream of bytes sent to the terminal) to graphic set, and graphic set to character font.
Display codes: GL stands for the 96 character positions in the left hand graphics part of the total 256 display code range; GR is the right hand part. GL is character codes 32..127, GR is codes 160..255.
Display code to graphic set mapping: at any one time the group of 96 code positions represented by GL is mapped to one four graphic sets named G0..G3. Similarly, GR is also mapped to one of these four graphic sets. Each graphic set has an associated ASCII character used to identify it: G0 has ’(’, G1 has ’)’, G2 has ’∗’ and G3 ’+’.
Character fonts: the AVC emulation currently supports four distinct character fonts (sets of actual displayed character patterns). Each character font has an associated ASCII character which identifies it. The four supported sets are: US ASCII (code ’B’), DEC Supplemental graphics (code ’<’), DEC Special graphics (code ’0’) and ISO Latin 1 (code ’I’). The last of these is unique to the AVC interface and is not supported by the VT200.
The default state of the mappings is shown below.
Display code set to graphic set:
GL (32..127) mapped to G0
GR (160..255) mapped to G3
Graphic set to character font:
G0 mapped to US ASCII
G1 mapped to DEC Special graphics
G2 mapped to DEC Supplemental graphics
G3 mapped to ISO Latin 1
There are a number of control codes available which affect the state of this, either temporarily (just for one graphic character) or permanently, i.e. until another permanent change is made.
To change a display code set to graphic set mapping:
SI (ASCII 15, ‘^O’):map GL to G0 (permanent)
SO (ASCII 14, ‘^N’):map GL to G1 (permanent)
SS2 (sequence ESC N):map GL to G2 (for 1 char)
SS3 (sequence ESC O):map GL to G3 (for 1 char)
LS2 (sequence ESC n):map GL to G2 (permanent)
LS3 (sequence ESC o):map GL to G3 (permanent)
LS1R (sequence ESC ~):map GR to G1 (permanent)
LS2R (sequence ESC }):map GR to G2 (permanent)
LS3R (sequence ESC }):map GR to G3 (permanent)
Apart from there being no way to map GR to G0, all mapping combinations are possible (e.g. GL and GR might both map to G1).
To change one of the graphic set to character font mappings, there is a general escape sequence format:
ESC <graphic-set-code> <character-font-code>
e.g.
ESC ( 0map G0 to the DEC special graphics font
ESC + Imap G3 to the ISO Latin 1 font
TERMINAL OUTPUT CODES
This section describes those commands implemented by the terminal emulation which are not standard VT220 commands. In the following summary, each element of a command’s byte-sequence is shown separated from the next by white space. The meta-syntax of individual elements in the descriptions is:
"x" any single ASCII printing character x
> ; ? ASCII literal characters (just these 3 common ones) standing for themselves
ESC, LF, etc. standard 7-bit ASCII code names
CSI the 8-bit ASCII standard Control Sequence Introducer, normally sent in 7-bit compatibility form as the two bytes: ESC "["
n, x1, z’ etc. symbolic names for parameters to the the command. These may be numeric or non-numeric (the description of each command indicates which). Numeric parameters are sent as a sequence of decimal digits (as ASCII ‘0’..‘9’), with the most significant digit first. Numeric parameters are separated from each other by a semicolon (;) in the sequence of bytes.
0, 1, 32, etc. literal numeric parameters
The extra commands, along with their byte-stream syntax, are described below.
Write Set-Up parameter(s)
CSI > n ; v "p"
CSI > n1 ; v1 ; n2 ; v2 .... "p"
This command accepts a sequence of one or more numeric (name,value) pairs, each pair defining the Set-Up parameter to be changed and the value to set it to. The codes for n and v are as defined for the VCIOC{G,S}PARAM ioctl commands (see vc(4)). If the number of numeric parameters in the control sequence is not even (i.e. if there is a spare n at the end of the sequence) the whole command is ignored. If any given Set-Up parameter number or value code is out of the acceptable range, that pair is ignored, but any other pairs in the sequence are still processed.
Define screen element colour set(s)
CSI > b ; d ; c ; ic ; n1 ; b1 ; n2 ; b2 ; n3 ; b3 "S"
CSI > b ; d ; c ; ic ; n1 ; b1 ; n2 ; b2 ; n3 ; b3 ; b’ ; d’ ; c’ ; ic’ ; n1’ ; b1’ ; n2’ ; b2’ ; n3’ ; b3’ "S"
This command is used to define the current set or both sets of screen element colours. Its effect is basically the same as the ioctl command VCIOCSTEXTCOLOURS, explained in vc(4), except that this command can optionally define only one set of colours rather than both sets. Each parameter is numeric, a number in the range 0..8191 representing a physical colour value built by adding up:
r(0..15) ∗ 1- red level
+g(0..15) ∗ 16- green level
+b(0..15) ∗ 256- blue level
+s(0 or 1) ∗ 4096- supremacy bit
Supremacy is normally only used if the screen display is being mixed with an external video signal (using suitable hardware). If the supremacy bit for the colour of particular screen element is set, it indicates that all pixels from the computer which are part of this screen element (and hence are displayed in the specified colour) take precedence in the composite picture over pixels at the same screen positions from the external source. If the supremacy bit is clear for a particular element, the pixels of the externally generated video picture will appear instead of those of that element.
The parameters are interpreted as:
b,b’ border colour
d,d’ display colour (background)
c,c’ normal cursor colour
ic,ic’ colour of cursor when it is positioned over a character displayed in inverse polarity
n1,n1’ normal text colour 1
b1,b1’ bold text colour 1
n2,n2’ normal text colour 2
b2,b2’ bold text colour 2
n3,n3’ normal text colour 3
b3,b3’ bold text colour 3
There must be exactly 10 or 20 parameters. In the first case the current colour set (i.e. that for the current screen polarity) is redefined. In the latter case both sets are redefined: first the ‘normal’ (nominally white-on-black) set, then the ‘inverse’ (nominally black-on-white) set.
Define single screen element colour
CSI > n ; r ; g ; b "T"
CSI > n ; r ; g ; b ; s "T"
This command allows an individual screen element’s colour to be defined independently of the other elements. The parameters (all numeric) are:
n the element code number + 1, i.e. 1..10 for the border colour .. bold text colour 3 (see above and <dev/vcioctl.h>). 0 here is treated as meaning 1.
r,g,b decimal numbers in the range 0..15, representing respectively the red, green and blue levels of the colour to be used for the given element.
s the supremacy bit: 0 or 1. It and its preceding ‘;’ may together be omitted, in which case it defaults to 0.
Apart from the s bit all parameters must be supplied, and all must lie in the appropriate range, otherwise the whole command is ignored.
Select text colour pair
CSI > 11 "m"select text colour pair 1
CSI > 12 "m"select text colour pair 2
CSI > 13 "m"select text colour pair 3
CSI > 0 "m"select default text colour pair (pair 1)
CSI 0 "m"reset all graphics attributes
At any one time one of three pairs of colours (for normal text and bold text) will be selected. By default pair 1 is selected; in this case text displayed with normal intensity will appear with normal text colour 1, and text in bold intensity will appear with bold text colour 1. Selecting text colour pair 2 means that normal text colour 2 and bold text colour 2 will be used instead, and similarly for text colour pair 3. Thus up to 6 different text colours may be used (visible on-screen simultaneously) provided that the monitor type is suitable (i.e. not high-resolution monochrome) and a mode other than 80x20 or 80x25 is in use - those modes use only 1 bit per pixel and hence only 1 text colour (normal text colour 1) can be displayed.
The default text colour pair setting (text colour pair 1) may be restored using the fourth command format above. It is also restored by use of the "All attributes off" rendition code (0) to the ANSI-defined SGR (Select Graphics Rendition) control sequence; an example of this is shown as the last command format above.
Designate ISO Latin 1 character set
ESC "(" "I" designate ISO Latin 1 set as G0
ESC ")" "I" designate ISO Latin 1 set as G1
ESC "∗" "I" designate ISO Latin 1 set as G2
ESC "+" "I" designate ISO Latin 1 set as G3
This command group is an extension of the normal "Designate hard character set" commands supported by the VT220. It should be noted that the initial, default character set assignment is as follows:
G0: ASCII
G1: DEC Special graphics
G2: DEC Supplemental (multi-language)
G3: ISO Latin 1
Display 96th character of character set
DEL
The VT200 and compatible terminals normally ignore the DEL code (ASCII 127) when received. However in order to display the last character of the ISO Latin 1 character set (which has 96 elements rather than 95), the AVC terminal treats a received DEL code as a printing character. The three other character sets have blanks in this character position, so only if the ISO Latin 1 character set is in use can sending a DEL be distinguished from sending a space code (SP, ASCII 32); however it should be noted that for various reasons processing a DEL is slower than processing SP, so DEL should normally be sent only if the ISO Latin 1 y-umlaut character is to be displayed.
Set 8-column tabs
CSI > 8 "g"
This command extends the normal VT220 tabulation control facilities by providing the means to set tab stops at every 8th column with a single command rather than requiring a sequence of cursor movements interleaved with "set single tab" commands. This is convenient because it is common practice to set tabs at every 8th column.
TERMINAL INPUT CODES
This section describes the codes generated by the keys on the keyboard in the various possible modes of keyboard operation. The Set-Up menu allows separate control of two groups of special keys: one group is comprised of the 12 function keys, the 6 key editing block and the numeric key pad; the other group contains just the 4 cursor keys. The Set-Up menu field labelled ‘Keyboard mode’ has two possible settings, VT200 and AVC, affecting the main group of special keys. The menu field labelled ‘Cursor keys’ has a total of 8 different possible settings: these affect the behaviour of the 4 cursor movement keys. The two groups of keys and their mode settings are described below.
Keyboard mode: VT200
In VT200 mode the main group of special keys are defined to emulate (approximately) the behaviour of the special keys on a VT220 keyboard. Since there is not a one-to-one correspondence in key positions and names, this emulation falls some way short of providing full compatibility. The keys behave as follows:
| VT220 keyboard | AVC keyboard | Notes / transmitted codes |
| F1 ‘Hold Screen’ | - | can use ‘Scroll Lock’ |
| F2 ‘Print Screen’ | - | printing not supported |
| F3 ‘Set-Up’ | F3 ‘Set-Up’ | enters Set-Up menu |
| F4 ‘Data/Talk’ | - | inapplicable |
| F5 ‘Break’ | - | inapplicable |
| F6 | F6 | ( CSI 17 "~" ) |
| F7 | F7 | ( CSI 18 "~" ) |
| F8 | F8 | ( CSI 19 "~" ) |
| F9 | F9 | ( CSI 20 "~" ) |
| F10 | F10 | ( CSI 21 "~" ) |
| F11 | F11 | ( CSI 23 "~" ) |
| F12 | F12 | ( CSI 24 "~" ) |
| F13 | Ctrl + F3 | ( CSI 25 "~" ) |
| F14 | Ctrl + F4 | ( CSI 26 "~" ) |
| F15 | Ctrl + F5 | ( CSI 28 "~" ) |
| F16 | Ctrl + F6 | ( CSI 29 "~" ) |
| F17 | Ctrl + F7 | ( CSI 31 "~" ) |
| F18 | Ctrl + F8 | ( CSI 32 "~" ) |
| F19 | Ctrl + F9 | ( CSI 33 "~" ) |
| F20 | Ctrl + F10 | ( CSI 34 "~" ) |
| Shift + F6-F20 | - | soft keys not supported |
| ‘Find’ | - | not supported |
| ‘Insert Here’ | - | not supported |
| ‘Remove’ | - | not supported |
| ‘Select’ | - | not supported |
| ‘Prev Screen’ | - | not supported |
| ‘Next Screen’ | - | not supported |
| pad 0 | pad 0 | ( "0" or ESC "O" "p" ) |
| pad 1 | pad 1 | ( "1" or ESC "O" "q" ) |
| pad 2 | pad 2 | ( "2" or ESC "O" "r" ) |
| pad 3 | pad 3 | ( "3" or ESC "O" "s" ) |
| pad 4 | pad 4 | ( "4" or ESC "O" "t" ) |
| pad 5 | pad 5 | ( "5" or ESC "O" "u" ) |
| pad 6 | pad 6 | ( "6" or ESC "O" "v" ) |
| pad 7 | pad 7 | ( "7" or ESC "O" "w" ) |
| pad 8 | pad 8 | ( "8" or ESC "O" "x" ) |
| pad 9 | pad 9 | ( "9" or ESC "O" "y" ) |
| pad ‘.’ | pad ‘.’ | ( "." or ESC "O" "n" ) |
| pad ‘Enter’ | pad ‘Enter’ | ( CR or ESC "O" "M" ) |
| pad ‘,’ | pad ‘+’ | ( "+" or ESC "O" "l" ) |
| pad ‘-’ | pad ‘-’ | ( "-" or ESC "O" "m" ) |
| PF1 | Alt + pad ‘/’ | ( ESC "O" "P" ) |
| PF2 | pad ‘/’ | ( ESC "O" "Q" ) |
| PF3 | pad ‘∗’ | ( ESC "O" "R" ) |
| PF4 | pad ‘#’ | ( ESC "O" "S" ) |
Keyboard mode: AVC
The alternative and recommended keyboard mode is AVC mode. In this mode, use of the special keys will (in general) generate a control sequence which encodes not only the identity of the key which was pressed but also the state of the three modification keys marked ‘Shift’, ‘Ctrl’ and ‘Alt’. Thus an application can extend the accessible keyboard range (if desired) by providing different interpretations for a given special key according to the modifications applied. The general form of the transmitted AVC special key control sequence is:
CSI key mod
where CSI stands for the ANSI Control Sequence Introducer transmitted as ESC "[", key is a 2 digit number representing the basic key which was pressed, and mod is a single ASCII character in the range ‘s’ to ‘z’ inclusive, which encodes the state of the modifier keys. The key and modifier encodings are listed below, and are also available for use in C programs in the file <dev/vcio.h>. In the following table, the codes generated by the cursor keys in AVC mode are included for convenience (although cursor key effects are also described separately in the section below). The notes explain the cases where pressing a key does not cause a standard AVC special key sequence to be sent.
| Key | Code | Notes |
| F1 | 41 | |
| F2 | 42 | |
| F3 | 43 | |
| F4 | 44 | |
| F5 | 45 | |
| F6 | 46 | |
| F7 | 47 | |
| F8 | 48 | |
| F9 | 49 | |
| F10 | 50 | |
| F11 | 51 | |
| F12 | 52 | |
| Insert | 61 | |
| Home | 62 | |
| Page Up | 63 | |
| Delete | 64 | With no mod, just sends ASCII DEL code. |
| Copy | 65 | Code sent code if copy cursor inactive. |
| Page Down | 66 | |
| Cursor Up | 71 | Cursor keys in AVC mode; if the Alt key |
| Cursor Down | 72 | is pressed, cursor keys cause the copy |
| Cursor Left | 73 | cursor to move, so only Shift and Ctrl |
| Cursor Right | 74 | modification is ever reported. |
| pad 0 | 80 | .. |
| pad 1 | 81 | .. |
| pad 2 | 82 | .. |
| pad 3 | 83 | .. |
| pad 4 | 84 | For all the numeric keypad keys, the |
| pad 5 | 85 | normal symbolic code (or CR, in the |
| pad 6 | 86 | case of the ‘Enter’ key) is sent when |
| pad 7 | 87 | Num Lock is in force and the Num Lock |
| pad 8 | 88 | LED is lit. Num Lock is toggled by |
| pad 9 | 89 | pressing the key, as with Caps Lock. |
| pad ‘.’ | 90 | If Num Lock is off (LED not lit) the |
| pad ‘Enter’ | 91 | AVC special control sequence is sent, |
| pad ‘+’ | 92 | using the codes listed here. |
| pad ‘-’ | 93 | .. |
| pad ‘#’ | 94 | .. |
| pad ‘∗’ | 95 | .. |
| pad ‘/’ | 96 | .. |
The state of the three modification keys is encoded according to the following table:
| Alt | Ctrl | Shift | Mod |
| Up | Up | Up | ‘s’ |
| Up | Up | Down | ‘t’ |
| Up | Down | Up | ‘u’ |
| Up | Down | Down | ‘v’ |
| Down | Up | Up | ‘w’ |
| Down | Up | Down | ‘x’ |
| Down | Down | Up | ‘y’ |
| Down | Down | Down | ‘z’ |
Cursor key modes
There is a wide range of functionality available from the cursor keys. This is described under each possible mode selectable from the Set-Up screen or by program control. In all cursor key modes, pressing the Alt key with a cursor key causes ‘cursor copy’ action as described in the next section on COPY mode.
Cursor keys: COPY mode
COPY mode gives access to a very useful mechanism, called ‘cursor copy action’. This allows you to copy any text which is visible on the screen, as if it were being typed in, but without having to re-type all of the individual characters. Instead a ‘copy cursor’ is moved around the screen using the cursor keys, until it is over the start of the text to be copied as input. Then by pressing the key marked ‘Copy’ (located in the group of 6 keys above the cursor keys) individual characters, words or whole lines may be copied as input to whatever command interpreter or program is reading from the keyboard at the time.
The copy cursor appears as soon as one of the cursor keys is pressed, and is shown as an inverse video block. Once it has appeared, pressing a cursor key by itself will steer the copy cursor by one step in the direction marked on the key (note that when an edge of the screen is reached the copy cursor ‘wraps round’ to the opposite edge). If Shift is pressed along with the up-arrow or down-arrow keys, the cursor will move up or down faster - by four lines rather than one. Pressing Ctrl with either of these keys causes the copy cursor to jump to the top or bottom of the screen. For the left-arrow and right-arrow keys, pressing Shift with the key makes it move alternately by words (sequences of non-blank characters) and spaces (sequences of blank characters); pressing Ctrl with the key moves the copy cursor to the left or right edge of the screen.
When you have reached the point on the screen where you want to start from, text may be copied by pressing the Copy key. Each time it is pressed (or it autorepeats), the space or visible character under the copy cursor is sent as an input character as if it had been typed (it will normally appear wherever on the screen the ordinary cursor is) and the copy cursor moves right to the next position. If you want to copy more than just a few characters, a faster method than just allowing the Copy key to autorepeat is to press Shift or Ctrl along with it. When you press Shift+Copy, all the characters up to the next blank are copied (if the copy cursor started on a non-blank character), or one space is copied and all further blank characters are skipped up to the next non-blank (if it started on a blank character). Alternatively, pressing Ctrl+Copy causes all characters up to and including the last non-blank character on the line to be copied. At any time when the copy cursor is visible on the screen, you can type any other key on the keyboard as normal; you can also move the copy cursor around between presses of the Copy key. Thus you can for example make a correction to a previous line you have typed, by copying the first, correct part of it using say Shift+Copy for each word, then typing in the correct word at the point where there was a mistake, skipping the mistake using the right-arrow cursor key (possibly with Shift), and copying the remainder with Ctrl+Copy.
The copy cursor will normally disappear from the screen when you press Return; this is convenient in many situations where input is being entered a line at a time, for example command input to a shell. If you would like to remove the copy cursor at any other point, you can do so by pressing the key combination Alt+Ctrl+Shift+Copy. If on the other hand you do not want the copy cursor to be removed when you type Return, you can hold down the Shift key while you press Return: the line you have typed will be entered in the normal way, but the copy cursor will remain at the same point where you left it (although if the screen scrolls up, and the line the copy cursor was on disappears off the top, it will move down onto the new top line in the same column).
All this explanation may make using COPY mode sound rather complicated, however it is in fact easier to learn, ‘by doing’, than it is to explain, and readily becomes a natural extension of one’s normal use of the keyboard.
Cursor keys: AVC mode
With the cursor keys in AVC mode, the cursor keys generate the standard AVC sequences as listed in the section Keyboard mode: AVC, if pressed alone or with the Shift and/or Ctrl keys. Use of the Alt key in conjunction with a cursor key will not send any code; instead it causes copy cursor motion as described under COPY mode.
Cursor keys: VT200 mode
In this mode the cursor keys generate exactly the same codes as the cursor keys on a VT220 or VT200-compatible terminal. These are:
| Key | Normal mode | Application mode |
| Cursor Up | CSI "A" | ESC "O" "A" |
| Cursor Down | CSI "B" | ESC "O" "B" |
| Cursor Left | CSI "C" | ESC "O" "C" |
| Cursor Right | CSI "D" | ESC "O" "D" |
(Note: CSI is sent as two bytes: ESC "[")
The codes generated by the cursor keys in this mode are not affected by the state of the Shift or Ctrl keys. However, as for all other modes, if the Alt key is pressed in conjunction with a cursor key, it does not transmit any code but gives copy cursor effects as modified by the state of the Shift and Ctrl keys.
Cursor keys: EMACS mode
EMACS and similar screen editing programs (including micro-EMACS and JOVE) use by default a particular set of keyboard control sequences for cursor motion, i.e. to move the editing cursor up, down, left and right. Various sequences can be used to move vertically by single lines, by screenfuls, or to the top or bottom of the buffer within which you are editing, and horizontally by single character positions, whole words, or to either end of the current line. Normally you would have to type these sequences by pressing various combinations of the ‘Esc’ key, some of the alphabetic keys, and the Ctrl key. For example, to scroll back up the buffer by a screenful of text, you would press Esc then ‘V’, to move forward by one character position you would press the combination Ctrl + ‘F’, etc. However, when cursor keys are set to EMACS mode (or COPY/EMACS mode) the same effects are achieved (i.e the same control sequences are sent) by using the cursor keys on your keyboard, in conjunction with the Shift or Ctrl keys for some effects. If you use an editor of this type, you may well find this to be more convenient than the standard key sequences. The effects are as follows:
| Key | On its own | With Ctrl | With Shift |
| Up | up a line | top of buffer | up a screenful |
| Down | down a line | end of buffer | down a screenful |
| Left | char left | start of line | previous word |
| Right | char right | end of line | next word |
As usual, pressing the Alt key in conjunction with the cursor keys will cause copy cursor motion as modified by the state of Ctrl and Shift keys, and the Copy key can be used to copy screen characters as input to the program.
Cursor keys: COPY/EMACS mode
As its name suggests, this mode is a combination of the COPY and EMACS modes of cursor key action. EMACS and similar programs send a special control sequence to the terminal when they start (‘select cursor keys application mode’) which normally causes it to send a slightly different set of control sequences for the cursor keys. When the editor exits (or is paused temporarily) it sends another control sequence to change back to normal mode. By this means the Video Console interface can detect that a screen editor (or some other program which handles the keyboard specially) is running, and this ability is used in COPY/EMACS mode to cause automatic switching between COPY mode normally, e.g. when you are typing commands to a shell, and EMACS mode, when the appropriate special control sequence is received. So if you find that you use cursor copy action quite a lot, but like to use the cursor keys for moving around when using a screen editor, setting the cursor keys mode to COPY/EMACS should suit you.
Cursor keys: COPY/VI mode
This is a mode similar to COPY/EMACS mode but intended for users of the ‘vi’ editor. This editor uses a set of keyboard commands for editing cursor motion different from those used by EMACS-like screen editors. The general pattern of cursor motion (i.e. the variations effected by use of the Shift and Ctrl keys) is similar to that of EMACS. In COPY/VI mode the special character sequences are generated only when the cursor keys have been put into application state; in normal mode COPY action is in effect.
Cursor keys: COPY/AVC mode
This mode is like COPY/EMACS mode except that when the cursor keys have been switched to ‘application’ state by a suitable program, they transmit the standard AVC control sequences rather than the EMACS editing cursor motion command sequences. In ‘normal’ state the cursor keys give cursor copy motion effects without requiring the Alt key to be pressed, as for plain COPY mode.
Cursor keys: COPY/VT200 mode
This mode is a combination of the COPY and VT200 modes in that when the cursor keys are in ‘normal’ state, they give copy cursor motion effects, whereas in ‘application’ state they generate the standard VT200 application mode cursor sequences as defined under VT200 mode.
SEE ALSO
VT220 Programmer Reference Manual
4th Berkeley Distribution — Revision 1.2 of 27/11/90