This document details the control functions implemented by the Minix virtual
console driver.

The screen consists of 25 lines and 80 columns.  The top left hand character
position is designated as line 1, column 1.

1) ISO 646 (aka ASCII) control codes.
   ----------------------------------

The following ISO 646 control codes are implemented.  All other characters,
apart from those listed in 4, and including all supplementary characters
(those with bit 8 set) behave as graphic characters.

 Name   Encoding                         Synopsis

 NUL  ^@             Null, no effect.
 BEL  ^G             Bell, sound the internal speaker for a short period.
  BS  ^H             Backspace, move cursor left one column.
  HT  ^I             Horizontal tabulation, advance cursor to next tab stop.
                     Tab stops are positioned in columns congruent to 1
                     modulo 8.
  LF  ^J             Line feed, move cursor to following line, scroll screen
                     forward one line if already on last line.  If newline
                     mode is enabled (achievable using an ioctl) the cursor
                     will be positioned on the first column.  ISO 646 and
                     ISO 6429 discourage the use of new line mode.  It will
                     eventually be removed from these standards.
  CR  ^M             Carriage return, move cursor back to column one.
 ESC  ^[             Escape, start of an extended control sequence, see 2.

2) ISO 6429 (aka ANSI) escape sequences.
   -------------------------------------

The following ISO 6429 control functions are implemented.  Except where
explicitly stated the behavior of a command that results in the cursor being
positioned outside of the screen should be considered to be unspecified.  In
the encodings n, n1, and n2 denote optional numeric character strings, and ...
indicates optional repetition.

 Name   Encoding                         Synopsis

  RI  ESC M          Reverse index, moves cursor to preceding line.  If
                     already on the first line this implementation chooses to
                     scroll backwards one line.
 DCS  ESC P          Device control string, start of device dependent control
                     control string, see 3.
  ST  ESC \          String terminator, end of a device control string, see 3.
 RIS  ESC c          Reset to initial state, set display to its power on
                     state.  [The use of this function by normal applications
                     is discouraged.]
 ICH  ESC [n@        Insert character, inserts n blank characters at cursor,
                     following and current characters are moved right
                     (default 1).
 CUU  ESC [nA        Cursor up, move cursor up n lines (default 1).
 CUD  ESC [nB        Cursor down, move cursor down n lines (default 1).
 CUF  ESC [nC        Cursor forward, move cursor right n columns (default 1).
 CUB  ESC [nD        Cursor backward, move cursor left n columns (default 1).
 CUP  ESC [n1;n2H    Cursor position, moves cursor to row n1, column n2
                     (default 1, 1).
  ED  ESC [nJ        Erase in display, clears screen (default 0).
                         n=0, from cursor to bottom of screen.
                         n=1, from top of screen to cursor.
                         n=2, entire screen.
  EL  ESC [nK        Erase in line, clears line (default 0).
                         n=0, from cursor to end of line.
                         n=1, from start of line to cursor.
                         n=2, entire line.
  IL  ESC [nL        Insert line, inserts n blank lines at cursor, following
                     and current lines are moved down (default 1).
  DL  ESC [nM        Delete line, deletes n lines starting from the cursor,
                     following lines are moved up (default 1).
 DCH  ESC [nP        Delete character, deletes n characters starting from the
                     cursor, following characters are moved left (default 1).
 SGR  ESC [n1;n2...m Select graphic rendition, enables graphic rendition
                     aspects n1, n2, ... (default 0).  The implementation of
                     particular rendition aspects, is dependent upon the
                     display used.  In particular color displays do not
                     perform underlining, and monochrome displays can not
                     display color.
                         n=0, default rendition, cancels the effect of any
                         preceding SGR commands.  [The use of this function by
                         normal applications is weakly discouraged.]
                         n=1, bold, increased intensity.
                         n=4, underlined.
                         n=5, slowly blinking.
                         n=7, negative image, reverse video.
                         n=22, normal intensity.
                         n=24, not underlined.
                         n=25, steady, not blinking.
                         n=27, positive image, normal video.
                         n=30-37, foreground color.
                         n=39, default foreground color.
                         n=40-47, background color.
                         n=49, default background color.
                     The colors are as follows, black, red, green, yellow,
                     blue, magenta, cyan, white.

3) Device specific device control strings.
   ---------------------------------------

The following device control functions are defined by the Minix virtual
console driver.

 Name   Encoding                         Synopsis

      DCS linewrap.on ST       Turn line wrap on, placing a character in
                               column 80 will cause the cursor to be
                               positioned in column 1 of the following line.
      DCS linewrap.off ST      Turn line wrap off, placing a character in
                               column 80 will cause subsequent characters not
                               to be displayed.
      DCS snow.on ST           Turn snow on, allow snow to appear on a CGA
                               display.
      DCS snow.off ST          Turn snow off, prevent snow from appearing on a
                               CGA display.
      DCS softscroll.on ST     Turn soft scrolling on, a slow method of
                               scrolling the screen is used that allows
                               non-standard display hardware to be used.
      DCS softscroll.off ST    Turn soft scrolling off, a fast method of
                               scrolling the screen is used.
      DCS cursor.on ST         Turn the cursor on, the cursor will be visible.
      DCS cursor.off ST        Turn the cursor off, the cursor will not be
                               visible.
      DCS rendition.set ST     The default rendition is set to be the same as
                               the current rendition.  [The use of this
                               function by normal applications is
                               discouraged.]
      DCS rendition.reset ST   The default rendition is set to its power on
                               value.  [The use of this function by normal
                               applications is discouraged.]
      DCS keyboard.pc ST       Select standard PC keyboard layout.
      DCS keyboard.olivetti ST Select Olivetti keyboard layout.
      DCS keyboard.dutch ST    Select Dutch keyboard layout.
      DCS keyboard.extended ST Select extended keyboard layout.

4) Non-standard (backward compatible) control codes.
   -------------------------------------------------

The following control codes are provided for backwards compatibility with the
standard Minix console driver.  [The use of these functions is discouraged.]

 Name   Encoding                         Synopsis

      ^K             Move cursor to preceding line.
      ^L             Move cursor right one column.
      ^N             Move cursor right one column.
