COHERENT manpages
This page displays the COHERENT manpage for console [Console device driver].
List of available manpages
Index
console -- Device Driver Console device driver /dev/console is the device driver for the console of a COHERENT system. It is currently assigned major device number 2 and minor device number 0. /dev/console interprets escape sequences in console output to control output on the console monitor. These escape sequences include the sequences from ANSI 3.4-1977 and ANSI X3.64-1979 that deal with terminal control. Thus, they are similar to those used by the DEC VT-100 and VT-220 terminals. Escape Sequences In addition to the ASCII control characters BEL, BS, CR, FF, HT, LF, and VT, /dev/console recognizes a number of special sequences, each of which is introduced by the ASCII character ESC. You can type these on the keyboard, or write them in a file and invoke them by cating the file to the standard output. The following gives the escape sequences that /dev/console recognizes. The text in parentheses gives the ANSI mnemonic for this escape sequence. Note that in this table, ESC represents the ASCII character ESC (i.e., 0x1B). CSI stands for Control Sequence Introducer, which here consists of the character ESC followed by the character `[' (0x5B). Note, too, that this table inserts spaces between characters. This is simply for the sake of legibility; at present, no escape sequence can contain a literal space character. ESC = Enter alternate keypad mode. This escape sequence is non- standard and is slated for removal; you should avoid embedding it in scripts or programs. ESC > Exit alternate keypad mode. This escape sequence is non-standard and is slated for removal; you should avoid embedding it in scripts or programs. ESC n Print the special graphics character n. ESC 7 Save the current cursor position. This escape sequence is non- standard and is slated for removal; you should avoid embedding it in scripts or programs. ESC 8 Restore the previously saved cursor position. This escape sequence is non-standard and is slated for removal; you should avoid embedding it in scripts or programs. ESC D (IND, Index) Move the cursor down one line without changing the column position. This command moves the scrolling region text up and inserts blank lines if required. Although this escape sequence now moves the cursor down, it may not do so in the future when COHERENT supports writing systems other than left-to-right, top- to-bottom. Furthermore, this control sequence has been marked for removal from future international standards. This escape sequence has been slated for removal; you should avoid embedding it in scripts or programs. ESC E (NEL, Next Line) Move the cursor to the first column of the next line. This command move the scrolling region down and inserts blank line if required. ESC M (RI, Reverse Index) Move the cursor up one line without changing column position. As with IND, the direction of motion depends on the writing system currently in use. CSI n @ (ICH, Insert Character) Insert n characters at the current position (default, one). CSI n A (CUU, Cursor Up) Move the cursor up n rows (default, one). Stop at top of page. CSI n B (CUD, Cursor Down) Move the cursor down n rows (default, one). Stop at bottom edge of scrolling region. CSI n C (CUF, Cursor Forward) Move the cursor n columns forward (default, one). Stop at right bottom corner of scrolling region. CSI n D (CUB, Cursor Backwards) Move the cursor n columns backwards (default, one). CSI n E (CNL, Cursor Next Line) Move the cursor n rows down (default, one). Move scrolling region up and insert a blank line if required. CSI n F (CPL, Cursor Preceding Line) Move the cursor n rows up (default, one). Move the scrolling- region text down and insert a blank line if required. CSI n G (CHA, Cursor Character Absolute) Move the cursor to column n of the current line. CSI n ; m H (CUP, Cursor Position) Move the cursor to column m of row n. Position is relative to the scrolling region. CSI n I (CHT, Cursor Horizontal Tabulation) Move the cursor n tabulation stops forward (default, one). CSI c J (ED, Erase in Display) Erase display, where c is one of the following characters: 0 Erase from cursor to end of screen. 1 Erase from beginning of screen to cursor. 2 Erase the entire screen. CSI c K (EL, Erase in Line) Erase line, where c is one of the following characters: 0 Erase from cursor to end of line. 1 Erase from beginning of line to cursor. 2 Erase entire line. CSI n L (IL, Insert Line) Insert n blanks lines (default, one). CSI n M (DL, Delete Line) Delete n lines (default, one). CSI c O (EA, Erase in Area) Erase scrolling region, where c is one of the following characters: 0 Erase from cursor to end of scrolling region. 1 Erase from beginning of scrolling region to cursor. 2 Erase entire scrolling region. Reposition cursor at top left corner of scrolling region. CSI n P (DC, Delete Character) Delete n characters at the current position (default, one). CSI n S (SU, Scroll Up) Scroll the characters in the scrolling region up by n lines (default, one). The bottom of the scrolling region is cleared to blanks. CSI n T (SD, Scroll Down) Scroll the characters in the scrolling region down n lines (default, one). The top line of the scrolling region is cleared to blanks. CSI n X (ECH, Erase Character) Erase n characters at the current position (default, one). CSI n Z (CBT, Cursor Backward Tabulation) Move the cursor backwards by n tabulation stops (default, one). CSI n ` (HPA, Horizontal Position Absolute) Move the cursor to column n of the current line. CSI n a (HPR, Horizontal Position Relative) Move the cursor forward (i.e., to the right) n columns in the current line. CSI n d (VPA, Vertical Position Absolute) Move the cursor to row n of the display. CSI n e (VPR, Vertical Postition Relative) Move the cursor down n rows. CSI n ; m f (HVP, Horizontal and Vertical Position) Move the cursor to column m of row n. CSI s1 ; ... sN m (SGR, Select Graphic Rendition) Select graphics rendition on the terminal. This command takes one or more colon-separated parameters s1 through sN, each of which is one of the following strings: 0 All attributes off. 1 Bold intensity. 4 Underlining on. On color terminals, underlining rendered as white characters on a red background, in compliance with UNIX practices. 5 Blink on. 7 Reverse video. 10 Select primary font (see notes, below). 11 Select first alternative font (see notes, below). 12 Select second alternative font (see notes, below). 30 Black foreground. 31 Red foreground. 32 Green foreground. 33 Brown foreground. 34 Blue foreground. 35 Magenta foreground. 36 Cyan foreground. 37 White foreground. 40 Black background. 41 Red background. 42 Green background. 43 Brown background. 44 Blue background. 45 Magenta background. 46 Cyan background. 47 White background. For example, the following command sets the foreground color to cyan and the background to black: echo '\033[36;40m' The following codes are not standard, and are slated for modification. Do not embed these codes in scripts or programs: In the default font (font 0), /dev/console ignores control characters other than BEL, BS, CR, ESC, FF, HT, LF and VT and prints all other ASCII characters. In font 1, /dev/console prints all characters (including control characters), except ESC. In font 2, /dev/console prints every character except ESC with the high bit toggled. This provides access to the IBM graphics character set using ordinary ASCII characters. CSI n ; m r Make rows n through m of the display into the scrolling region. This is not a standard control sequence. It implements functionality included in standard sequences, and will be removed from a future console driver that implements the standard sequence. CSI c v Select cursor rendition, where c is one of the following characters: 0 Cursor visible. 1 Cursor invisible. This is not a standard sequence. It implements functionality not provided by any standard sequence. Developers are cautioned that there is no truly portable equivalent (although on many systems positioning the cursor off the screen has the same effect). CSI ? 4 h (SM, Set Mode) Enable smooth scrolling. This eliminates ``snow'' from the screen, but slows down the speed at which the console scrolls. The mode selected by the private-use parameter ?4 is not a standard mode. Note that the term ``smooth'' is somewhat misleading; it means that the driver waits for vertical retrace before it updates video memory. The reason for waiting for retrace was that the old CGA tubes were poorly designed -- the CRT logic and the main CPU were allowed simultaneous access to the video memory, with the result that direct-memory screen writes often produced static (snow). Having code wait for vertical retrace obviates the problem, but it also slows down the screen. CSI ? 4 l (RM, Reset Mode) Disable smooth scrolling. This is the default. The mode selected by the private-use parameter ?4 is not a standard mode. CSI ? 7 h (SM, Set Mode) Enable wraparound. Typing past column 80 moves the cursor to the first column of the next line, scrolling if necessary. The mode selected by the private-use parameter ?7 is not a standard mode, but is mandated by iBCS2. CSI ? 7 l (RM, Reset Mode) Disable wraparound. The cursor will not move past column 80. This is useful if the screen is being used as a block-mode interface. The mode selected by the private-use parameter ?7 is not a standard mode, but is mandaetd by iBCS2. CSI ? 8 h (SM, Set Mode) Erase in the current foreground color. CSI ? 8 l (RM, Reset Mode) Erase in the original foreground color, even if the current mode is reverse video. CSI ? 25 h (SM, Set Mode) Enable line 25. CSI ? 25 l (RM, Reset Mode) Disable line 25. CSI > 13 h (SM, Set Mode) Enable the screen saver. This is not standard. CSI > 13 l (RM, Reset Mode) Disable the screen saver. This is not standard. ESC ` (DMI, Disable Manual Input) Disable manual input. Terminal ``beeps'' (outputs <ctrl- G>) when you press a key on the keyboard. Interrupt and quit signals are still passed to the terminal process. Input may be renabled via ESC c (power up reset) or ESC b (enable manual input). ESC b (EMI, Enable Manual Input) Enable keyboard input that has been disabled by ESC `. ESC c (RIS, Reset to Initial State) Reset to power-up configuration ESC t Enter keypad-shifted mode. This is a non-standard sequence that conflicts with explicit provisions of the relevant standards. It will be removed from future versions of the console driver in favor of a sequence that does not conflict. ESC u Exit keypad-shifted mode. This is a non-standard sequence that conflicts with explicit provisions of the relevant standards. It will be removed from future versions of the console driver in favor of a sequence that does not conflict. Numeric Keypad The following describes the sequences sent by the numeric keypad. The keypad sends the following escape sequences: Key 0 Send CSI L. Key 1 Send CSI F. Key 2 Send CSI B. Key 3 Send CSI G. Key 4 Send CSI D. Key 5 Send ESC 7. Key 6 Send CSI C. Key 7 Send CSI H. Key 8 Send CSI A. Key 9 Send CSI I. Key . Send ASCII DEL. When the <shift> key is pressed or the <num-lock> key is set, the keypad sends the literal characters `0' through `9' and `.'. If the <num-lock> key is set, pressing <shift> restores the escape sequences shown above. The escape sequence ESC = sets the alternate-keypad mode. In this mode, the keypad sends the following escape sequences when the <num-lock> key is not set: Key 0 Send ESC ? p. Key 1 Send ESC ? q. Key 2 Send ESC ? r. Key 3 Send ESC ? s. Key 4 Send ESC ? t. Key 5 Send ESC ? u. Key 6 Send ESC ? v. Key 7 Send ESC ? w. Key 8 Send ESC ? x. Key 9 Send ESC ? y. Key . Send Esc ? n. The escape sequence ESC > resets this mode. Other Special Keys The following gives the escape sequences sent by the keyboard's special keys: <home> Send ``cursor home'' ( CSI H). <up> Send ``cursor up'' (CSI A). <pg up> Send CSI I. <left> Send ``cursor left'' (CSI D). <right> Send ``cursor right'' (CSI C). <end> Send CSI F. Note that this escape sequence does not do what users normally expect: to send cursor to bottom left of screen, send the escape sequence CSI 24 H. <down> Send ``cursor down'' (CSI B). <pg dn> Move cursor to previous page (CSI G). <ins> Send CSI L. Note that this escape sequence does not do what users normally expect. <del> Send ASCII DEL. F1 Send CSI M. F2 Send CSI N. F3 Send CSI O. F4 Send CSI P. F5 Send CSI Q. F6 Send CSI R. F7 Send CSI S. F8 Send CSI T. F9 Send CSI U. F10 Send CSI V. <shift>F1 Send CSI Y. <shift>F2 Send CSI Z. <shift>F3 Send CSI a. <shift>F4 Send CSI b. <shift>F5 Send CSI c. <shift>F6 Send CSI d. <shift>F7 Send CSI e. <shift>F8 Send CSI f. <shift>F9 Send CSI g. <shift>F10 Send CSI h. <ctrl>F1 Send CSI k. <ctrl>F2 Send CSI l. <ctrl>F3 Send CSI m. <ctrl>F4 Send CSI n. <ctrl>F5 Send CSI o. <ctrl>F6 Send CSI p. <ctrl>F7 Send CSI q. <ctrl>F8 Send CSI r. <ctrl>F9 Send CSI s. <ctrl>F10 Send CSI t. <ctrl><shift>F1 Send CSI w. <ctrl><shift>F2 Send CSI x. <ctrl><shift>F3 Send CSI y. <ctrl><shift>F4 Send CSI z. <ctrl><shift>F5 CSI @. <ctrl><shift>F6 CSI [. <ctrl><shift>F7 CSI \. <ctrl><shift>F8 CSI ]. <ctrl><shift>F9 CSI ^. <ctrl><shift>F10 CSI _. <alt>F1 Send CSI 1 y. <alt>F2 Send CSI 2 y. <alt>F3 Send CSI 3 y. <alt>F4 Send CSI 4 y. <alt>F5 Send CSI 5 y. <alt>F6 Send CSI 6 y. <alt>F7 Send CSI 7 y. <alt>F8 Send CSI 8 y. <alt>F9 Send CSI 9 y. <alt>F10 Send CSI 0 y. <esc> Send ASCII ESC (0x1B). <tab> Send ASCII HT. <ctrl> When combined with `A' through `_', send the corresponding ASCII control character; when combined with the <return> key, send ASCII LF; when combined with the key <backspace>, send ASCII DEL ; when combined with <alt> and <del>, issue system reset. <shift> Change alphabetic keys from lower case to upper case. If the <caps-lock> is set, shift from upper case to lower case. <alt> When combined with <ctrl> and <del>, issue a system reset. <backspace> Send ASCII BS; when combined with <ctrl>, send ASCII DEL. <return> Send ASCII CR; when combined with <ctrl>, send ASCII LF. * Send ASCII `*'. <caps-lock> Toggle ``caps lock'' mode. <num-lock> Toggle the interpretation of the numeric keypad, as described above. <scroll-lock> Send <ctrl-S> and toggle the Scroll Lock LED. - Send `-'. + Send `+'. Altering Console Configuration To change the hardware configuration of your console (i.e., to switch from a monochrome to a color console, or modify your keyboard or configuration of virtual consoles), log in as the superuser root and type the following commands: cd /etc/conf console/mkdev bin/idmkcoh -o /kernel_name where kernel_name is what you wish to name the newly built kernel. When you reboot, invoke kernel_name in the usual manner and your new configuration will have been implemented. The following tunable kernel variables affect the behavior of the console driver: CON_BEEP_SPEC This tunable kernel parameter lets you toggle whether the console can beep. If you set it to zero, the console will not beep, no matter what. By default, this is set to one, which enables beeping. SEP_SHIFT This tunable kernel variable permits each virtual-console session to have its own settings for the keyboard's shift keys. When this variable is set to one, you can have <CAPS LOCK> turned on in one screen and <NUM LOCK> in another, and the driver correctly remembers the proper shift state when you switch sessions. The default for this variable is zero -- that is, the keyboard uses the same settings for the shift keys in every virtual-console session. See Also Administering COHERENT, ASCII, device drivers, virtual consoles Notes Under COHERENT release 4.2, the codes sent by the keys F1 through F10, <pg up>, <pg dn>, <ins>, <del>, and <end> have changed from those sent under previous releases. This was done so that COHERENT can more closely conform to the standard expected by many third-party packages. If this presents a problem, you can use the COHERENT command fnkey to change the codes sent by the function. If you are using the keyboard driver vtnkb, you can remap the keyboard and (within limits) change the codes sent by some keys. For details, see the Lexicon entry vtnkb. Beginning with COHERENT release 4.2, the console uses a 25-line screen, rather than the 24-lines used in previous releases. This is to support the numerous third-party packages that assume a 25-line display. A variant form of the termcap and terminfo entries for ansipc returns the screen to 24 lines, should you need that feature. Please note that as of this writing (March 1994), the sequences CSI n m; do not work, where n is between 50 and 57. This is being worked repaired.