home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / program / termcap / termcap.man < prev    next >
Text File  |  1987-10-04  |  55KB  |  1,255 lines

  1.  
  2.  
  3.  
  4. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  5.  
  6.  
  7.  
  8. NAME
  9.      termcap - terminal capability data base
  10.  
  11. SYNOPSIS
  12.      /etc/termcap
  13.  
  14. DESCRIPTION
  15.      _✓T_✓e_✓r_✓m_✓c_✓a_✓p is a data base describing terminals, used, _✓e._✓g., by
  16.      _✓v_✓i(1) and _✓c_✓u_✓r_✓s_✓e_✓s(3X).  Terminals are described in _✓t_✓e_✓r_✓m_✓c_✓a_✓p by
  17.      giving a set of capabilities that they have and by describ-
  18.      ing how operations are performed.    Padding requirements and
  19.      initialization sequences are included in _✓t_✓e_✓r_✓m_✓c_✓a_✓p.
  20.  
  21.      Entries in _✓t_✓e_✓r_✓m_✓c_✓a_✓p consist of a number of `:'-separated
  22.      fields.  The first entry for each terminal gives the names
  23.      that are known for the terminal, separated by `|' charac-
  24.      ters.  The first name is always two characters long and is
  25.      used by older systems which store the terminal type in a
  26.      16-bit word in a system-wide data base.  The second name
  27.      given is the most common abbreviation for the terminal, the
  28.      last name given should be a long name fully identifying the
  29.      terminal, and all others are understood as synonyms for the
  30.      terminal name.  All names but the first and last should be
  31.      in lower case and contain no blanks; the last name may well
  32.      contain upper case and blanks for readability.
  33.  
  34.      Terminal names (except for the last, verbose entry) should
  35.      be chosen using the following conventions.  The particular
  36.      piece of hardware making up the terminal should have a root
  37.      name chosen, thus "hp2621".  This name should not contain
  38.      hyphens.  Modes that the hardware can be in or user prefer-
  39.      ences should be indicated by appending a hyphen and an indi-
  40.      cator of the mode.  Therefore, a "vt100" in 132-column mode
  41.      would be "vt100-w".  The following suffixes should be used
  42.      where possible:
  43.  
  44.      Suffix   Meaning                    Example
  45.      -w       Wide mode (more than 80 columns)        vt100-w
  46.      -am      With automatic margins (usually default)    vt100-am
  47.      -nam     Without automatic margins                 vt100-nam
  48.      -_✓n       Number of lines on the screen        aaa-60
  49.      -na      No arrow keys (leave them in local)    concept100-na
  50.      -_✓np      Number of pages of memory                 concept100-4p
  51.      -rv      Reverse video                concept100-rv
  52.  
  53. CAPABILITIES
  54.      The characters in the _✓N_✓o_✓t_✓e_✓s field in the table have the fol-
  55.      lowing meanings (more than one may apply to a capability):
  56.  
  57.      N     indicates numeric parameter(s)
  58.      P     indicates that padding may be specified
  59.      *     indicates that padding may be based on the number of lines affected
  60.  
  61.  
  62.  
  63. Printed 8/14/86          1 November 1985            1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  71.  
  72.  
  73.  
  74.      o     indicates capability is obsolete
  75.  
  76.      "Obsolete" capabilities have no _✓t_✓e_✓r_✓m_✓i_✓n_✓f_✓o equivalents, since
  77.      they were considered useless, or are subsumed by other capa-
  78.      bilities.    New software should not rely on them at all.
  79.  
  80.      Name  Type  Notes    Description
  81.      ae    str     (P)    End alternate character set
  82.      AL    str     (NP*)    Add _✓n new blank lines
  83.      al    str     (P*)    Add new blank line
  84.      am    bool         Terminal has automatic margins
  85.      as    str     (P)    Start alternate character set
  86.      bc    str     (o)    Backspace if not ^H
  87.      bl    str     (P)    Audible signal (bell)
  88.      bs    bool  (o)    Terminal can backspace with ^H
  89.      bt    str     (P)    Back tab
  90.      bw    bool         le (backspace) wraps from column 0 to last column
  91.      CC    str        Terminal settable command character in prototype
  92.      cd    str     (P*)    Clear to end of display
  93.      ce    str     (P)    Clear to end of line
  94.      ch    str     (NP)    Set cursor column (horizontal position)
  95.      cl    str     (P*)    Clear screen and home cursor
  96.      CM    str     (NP)    Memory-relative cursor addressing
  97.      cm    str     (NP)    Screen-relative cursor motion
  98.      co    num        Number of columns in a line (See BUGS section below)
  99.      cr    str     (P)    Carriage return
  100.      cs    str     (NP)    Change scrolling region (VT100)
  101.      ct    str     (P)    Clear all tab stops
  102.      cv    str     (NP)    Set cursor row (vertical position)
  103.      da    bool         Display may be retained above the screen
  104.      dB    num     (o)    Milliseconds of bs delay needed (default 0)
  105.      db    bool         Display may be retained below the screen
  106.      DC    str     (NP*)    Delete _✓n characters
  107.      dC    num     (o)    Milliseconds of cr delay needed (default 0)
  108.      dc    str     (P*)    Delete character
  109.      dF    num     (o)    Milliseconds of ff delay needed (default 0)
  110.      DL    str     (NP*)    Delete _✓n lines
  111.      dl    str     (P*)    Delete line
  112.      dm    str        Enter delete mode
  113.      dN    num     (o)    Milliseconds of nl delay needed (default 0)
  114.      DO    str     (NP*)    Move cursor down _✓n lines
  115.      do    str        Down one line
  116.      ds    str        Disable status line
  117.      dT    num     (o)    Milliseconds of horizontal tab delay needed (default 0)
  118.      dV    num     (o)    Milliseconds of vertical tab delay needed (default 0)
  119.      ec    str     (NP)    Erase _✓n characters
  120.      ed    str        End delete mode
  121.      ei    str        End insert mode
  122.      eo    bool         Can erase overstrikes with a blank
  123.      EP    bool  (o)    Even parity
  124.      es    bool         Escape can be used on the status line
  125.      ff    str     (P*)    Hardcopy terminal page eject
  126.  
  127.  
  128.  
  129. Printed 8/14/86          1 November 1985            2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  137.  
  138.  
  139.  
  140.      fs    str        Return from status line
  141.      gn    bool         Generic line type (_✓e._✓g. dialup, switch)
  142.      hc    bool         Hardcopy terminal
  143.      HD    bool  (o)    Half-duplex
  144.      hd    str        Half-line down (forward 1/2 linefeed)
  145.      ho    str     (P)    Home cursor
  146.      hs    bool         Has extra "status line"
  147.      hu    str        Half-line up (reverse 1/2 linefeed)
  148.      hz    bool         Cannot print ~s (Hazeltine)
  149.      i1-i3 str        Terminal initialization strings (_✓t_✓e_✓r_✓m_✓i_✓n_✓f_✓o only)
  150.      IC    str     (NP*)    Insert _✓n blank characters
  151.      ic    str     (P*)    Insert character
  152.      if    str        Name of file containing initialization string
  153.      im    str        Enter insert mode
  154.      in    bool         Insert mode distinguishes nulls
  155.      iP    str        Pathname of program for initialization (_✓t_✓e_✓r_✓m_✓i_✓n_✓f_✓o only)
  156.      ip    str     (P*)    Insert pad after character inserted
  157.      is    str        Terminal initialization string (_✓t_✓e_✓r_✓m_✓c_✓a_✓p only)
  158.      it    num        Tabs initially every _✓n positions
  159.      K1    str        Sent by keypad upper left
  160.      K2    str        Sent by keypad upper right
  161.      K3    str        Sent by keypad center
  162.      K4    str        Sent by keypad lower left
  163.      K5    str        Sent by keypad lower right
  164.      k0-k9 str        Sent by function keys 0-9
  165.      kA    str        Sent by insert-line key
  166.      ka    str        Sent by clear-all-tabs key
  167.      kb    str        Sent by backspace key
  168.      kC    str        Sent by clear-screen or erase key
  169.      kD    str        Sent by delete-character key
  170.      kd    str        Sent by down-arrow key
  171.      kE    str        Sent by clear-to-end-of-line key
  172.      ke    str        Out of "keypad transmit" mode
  173.      kF    str        Sent by scroll-forward/down key
  174.      kH    str        Sent by home-down key
  175.      kh    str        Sent by home key
  176.      kI    str        Sent by insert-character or enter-insert-mode key
  177.      kL    str        Sent by delete-line key
  178.      kl    str        Sent by left-arrow key
  179.      kM    str        Sent by insert key while in insert mode
  180.      km    bool         Has a "meta" key (shift, sets parity bit)
  181.      kN    str        Sent by next-page key
  182.      kn    num     (o)    Number of function (k0-k9) keys (default 0)
  183.      ko    str     (o)    Termcap entries for other non-function keys
  184.      kP    str        Sent by previous-page key
  185.      kR    str        Sent by scroll-backward/up key
  186.      kr    str        Sent by right-arrow key
  187.      kS    str        Sent by clear-to-end-of-screen key
  188.      ks    str        Put terminal in "keypad transmit" mode
  189.      kT    str        Sent by set-tab key
  190.      kt    str        Sent by clear-tab key
  191.      ku    str        Sent by up-arrow key
  192.  
  193.  
  194.  
  195. Printed 8/14/86          1 November 1985            3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  203.  
  204.  
  205.  
  206.      l0-l9 str        Labels on function keys if not "f_✓n"
  207.      LC    bool  (o)    Lower-case only
  208.      LE    str     (NP)    Move cursor left _✓n positions
  209.      le    str     (P)    Move cursor left one position
  210.      li    num        Number of lines on screen or page (See BUGS section below)
  211.      ll    str        Last line, first column
  212.      lm    num        Lines of memory if > li (0 means varies)
  213.      ma    str     (o)    Arrow key map (used by _✓v_✓i version 2 only)
  214.      mb    str        Turn on blinking attribute
  215.      md    str        Turn on bold (extra bright) attribute
  216.      me    str        Turn off all attributes
  217.      mh    str        Turn on half-bright attribute
  218.      mi    bool         Safe to move while in insert mode
  219.      mk    str        Turn on blank attribute (characters invisible)
  220.      ml    str     (o)    Memory lock on above cursor
  221.      mm    str        Turn on "meta mode" (8th bit)
  222.      mo    str        Turn off "meta mode"
  223.      mp    str        Turn on protected attribute
  224.      mr    str        Turn on reverse-video attibute
  225.      ms    bool         Safe to move in standout modes
  226.      mu    str     (o)    Memory unlock (turn off memory lock)
  227.      nc    bool  (o)    No correctly-working cr (Datamedia 2500, Hazeltine 2000)
  228.      nd    str        Non-destructive space (cursor right)
  229.      NL    bool  (o)    \n is newline, not line feed
  230.      nl    str     (o)    Newline character if not \n
  231.      ns    bool  (o)    Terminal is a CRT but doesn't scroll
  232.      nw    str     (P)    Newline (behaves like cr followed by do)
  233.      OP    bool  (o)    Odd parity
  234.      os    bool         Terminal overstrikes
  235.      pb    num        Lowest baud where delays are required
  236.      pc    str        Pad character (default NUL)
  237.      pf    str        Turn off the printer
  238.      pk    str        Program function key _✓n to type string _✓s (_✓t_✓e_✓r_✓m_✓i_✓n_✓f_✓o only)
  239.      pl    str        Program function key _✓n to execute string _✓s (_✓t_✓e_✓r_✓m_✓i_✓n_✓f_✓o only)
  240.      pO    str     (N)    Turn on the printer for _✓n bytes
  241.      po    str        Turn on the printer
  242.      ps    str        Print contents of the screen
  243.      pt    bool  (o)    Has hardware tabs (may need to be set with is)
  244.      px    str        Program function key _✓n to transmit string _✓s (_✓t_✓e_✓r_✓m_✓i_✓n_✓f_✓o only)
  245.      r1-r3 str        Reset terminal completely to sane modes (_✓t_✓e_✓r_✓m_✓i_✓n_✓f_✓o only)
  246.      rc    str     (P)    Restore cursor to position of last sc
  247.      rf    str        Name of file containing reset codes
  248.      RI    str     (NP)    Move cursor right _✓n positions
  249.      rp    str     (NP*)    Repeat character _✓c _✓n times
  250.      rs    str        Reset terminal completely to sane modes (_✓t_✓e_✓r_✓m_✓c_✓a_✓p only)
  251.      sa    str     (NP)    Define the video attributes
  252.      sc    str     (P)    Save cursor position
  253.      se    str        End standout mode
  254.      SF    str     (NP*)    Scroll forward _✓n lines
  255.      sf    str     (P)    Scroll text up
  256.      sg    num        Number of garbage chars left by so or se (default 0)
  257.      so    str        Begin standout mode
  258.  
  259.  
  260.  
  261. Printed 8/14/86          1 November 1985            4
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  269.  
  270.  
  271.  
  272.      SR    str     (NP*)    Scroll backward _✓n lines
  273.      sr    str     (P)    Scroll text down
  274.      st    str        Set a tab in all rows, current column
  275.      ta    str     (P)    Tab to next 8-position hardware tab stop
  276.      tc    str        Entry of similar terminal - must be last
  277.      te    str        String to end programs that use _✓t_✓e_✓r_✓m_✓c_✓a_✓p
  278.      ti    str        String to begin programs that use _✓t_✓e_✓r_✓m_✓c_✓a_✓p
  279.      ts    str     (N)    Go to status line, column _✓n
  280.      UC    bool  (o)    Upper-case only
  281.      uc    str        Underscore one character and move past it
  282.      ue    str        End underscore mode
  283.      ug    num        Number of garbage chars left by us or ue (default 0)
  284.      ul    bool         Underline character overstrikes
  285.      UP    str     (NP*)    Move cursor up _✓n lines
  286.      up    str        Upline (cursor up)
  287.      us    str        Start underscore mode
  288.      vb    str        Visible bell (must not move cursor)
  289.      ve    str        Make cursor appear normal (undo vs/vi)
  290.      vi    str        Make cursor invisible
  291.      vs    str        Make cursor very visible
  292.      vt    num        Virtual terminal number (not supported on all systems)
  293.      wi    str     (N)    Set current window
  294.      ws    num        Number of columns in status line
  295.      xb    bool         Beehive (f1=ESC, f2=^C)
  296.      xn    bool         Newline ignored after 80 cols (Concept)
  297.      xo    bool         Terminal uses xoff/xon (DC3/DC1) handshaking
  298.      xr    bool  (o)    Return acts like ce cr nl (Delta Data)
  299.      xs    bool         Standout not erased by overwriting (Hewlett-Packard)
  300.      xt    bool         Tabs ruin, magic so char (Teleray 1061)
  301.      xx    bool  (o)    Tektronix 4025 insert-line
  302.  
  303.      A Sample Entry
  304.  
  305.      The following entry, which describes the Concept-100, is
  306.      among the more complex entries in the _✓t_✓e_✓r_✓m_✓c_✓a_✓p file as of
  307.      this writing.
  308.  
  309.      ca|concept100|c100|concept|c104|concept100-4p|HDS Concept-100:\
  310.          :al=3*\E^R:am:bl=^G:cd=16*\E^C:ce=16\E^U:cl=2*^L:cm=\Ea%+ %+ :\
  311.          :co#80:.cr=9^M:db:dc=16\E^A:dl=3*\E^B:do=^J:ei=\E\200:eo:im=\E^P:in:\
  312.          :ip=16*:is=\EU\Ef\E7\E5\E8\El\ENH\EK\E\200\Eo&\200\Eo\47\E:k1=\E5:\
  313.          :k2=\E6:k3=\E7:kb=^h:kd=\E<:ke=\Ex:kh=\E?:kl=\E>:kr=\E=:ks=\EX:\
  314.          :ku=\E;:le=^H:li#24:mb=\EC:me=\EN\200:mh=\EE:mi:mk=\EH:mp=\EI:\
  315.          :mr=\ED:nd=\E=:pb#9600:rp=0.2*\Er%.%+ :se=\Ed\Ee:sf=^J:so=\EE\ED:\
  316.          :.ta=8\t:te=\Ev    \200\200\200\200\200\200\Ep\r\n:\
  317.          :ti=\EU\Ev  8p\Ep\r:ue=\Eg:ul:up=\E;:us=\EG:\
  318.          :vb=\Ek\200\200\200\200\200\200\200\200\200\200\200\200\200\200\EK:\
  319.          :ve=\Ew:vs=\EW:vt#8:xn:\
  320.          :bs:cr=^M:dC#9:dT#8:nl=^J:ta=^I:pt:
  321.  
  322.      Entries may continue onto multiple lines by giving a \ as
  323.      the last character of a line, and empty fields may be
  324.  
  325.  
  326.  
  327. Printed 8/14/86          1 November 1985            5
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  335.  
  336.  
  337.  
  338.      included for readability (here between the last field on a
  339.      line and the first field on the next).  Comments may be
  340.      included on lines beginning with "#".
  341.  
  342.      Types of Capabilities
  343.  
  344.      Capabilities in _✓t_✓e_✓r_✓m_✓c_✓a_✓p are of three types: Boolean capabil-
  345.      ities, which indicate particular features that the terminal
  346.      has; numeric capabilities, giving the size of the display or
  347.      the size of other attributes; and string capabilities, which
  348.      give character sequences that can be used to perform partic-
  349.      ular terminal operations.    All capabilities have two-letter
  350.      codes.  For instance, the fact that the Concept has
  351.      _✓a_✓u_✓t_✓o_✓m_✓a_✓t_✓i_✓c _✓m_✓a_✓r_✓g_✓i_✓n_✓s (_✓i._✓e., an automatic return and linefeed
  352.      when the end of a line is reached) is indicated by the
  353.      Boolean capability am.  Hence the description of the Concept
  354.      includes am.
  355.  
  356.      Numeric capabilities are followed by the character `#' then
  357.      the value.  In the example above co, which indicates the
  358.      number of columns the display has, gives the value `80' for
  359.      the Concept.
  360.  
  361.      Finally, string-valued capabilities, such as ce (clear-to-
  362.      end-of-line sequence) are given by the two-letter code, an
  363.      `=', then a string ending at the next following `:'.  A
  364.      delay in milliseconds may appear after the `=' in such a
  365.      capability, which causes padding characters to be supplied
  366.      by _✓t_✓p_✓u_✓t_✓s after the remainder of the string is sent to pro-
  367.      vide this delay.  The delay can be either a number, _✓e._✓g.
  368.      `20', or a number followed by an `*', _✓i._✓e., `3*'.    An `*'
  369.      indicates that the padding required is proportional to the
  370.      number of lines affected by the operation, and the amount
  371.      given is the per-affected-line padding required.  (In the
  372.      case of insert-character, the factor is still the number of
  373.      _✓l_✓i_✓n_✓e_✓s affected; this is always 1 unless the terminal has in
  374.      and the software uses it.) When an `*' is specified, it is
  375.      sometimes useful to give a delay of the form `3.5' to
  376.      specify a delay per line to tenths of milliseconds.  (Only
  377.      one decimal place is allowed.)
  378.  
  379.      A number of escape sequences are provided in the string-
  380.      valued capabilities for easy encoding of control characters
  381.      there.  \E maps to an ESC character, ^X maps to a control-X
  382.      for any appropriate X, and the sequences \n \r \t \b \f map
  383.      to linefeed, return, tab, backspace, and formfeed, respec-
  384.      tively.  Finally, characters may be given as three octal
  385.      digits after a \, and the characters ^ and \ may be given as
  386.      \^ and \\.  If it is necessary to place a : in a capability
  387.      it must be escaped in octal as \072.  If it is necessary to
  388.      place a NUL character in a string capability it must be
  389.      encoded as \200.  (The routines that deal with _✓t_✓e_✓r_✓m_✓c_✓a_✓p use C
  390.  
  391.  
  392.  
  393. Printed 8/14/86          1 November 1985            6
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  401.  
  402.  
  403.  
  404.      strings and strip the high bits of the output very late, so
  405.      that a \200 comes out as a \000 would.)
  406.  
  407.      Sometimes individual capabilities must be commented out.  To
  408.      do this, put a period before the capability name.    For exam-
  409.      ple, see the first cr and ta in the example above.
  410.  
  411.      Preparing Descriptions
  412.  
  413.      We now outline how to prepare descriptions of terminals.
  414.      The most effective way to prepare a terminal description is
  415.      by imitating the description of a similar terminal in
  416.      _✓t_✓e_✓r_✓m_✓c_✓a_✓p and to build up a description gradually, using par-
  417.      tial descriptions with _✓v_✓i to check that they are correct.
  418.      Be aware that a very unusual terminal may expose deficien-
  419.      cies in the ability of the _✓t_✓e_✓r_✓m_✓c_✓a_✓p file to describe it or
  420.      bugs in _✓v_✓i.  To easily test a new terminal description you
  421.      can set the environment variable TERMCAP to the absolute
  422.      pathname of a file containing the description you are work-
  423.      ing on and programs will look there rather than in
  424.      /_✓e_✓t_✓c/_✓t_✓e_✓r_✓m_✓c_✓a_✓p.  TERMCAP can also be set to the _✓t_✓e_✓r_✓m_✓c_✓a_✓p entry
  425.      itself to avoid reading the file when starting up a program.
  426.  
  427.      To get the padding for insert-line right (if the terminal
  428.      manufacturer did not document it), a severe test is to use
  429.      _✓v_✓i to edit /_✓e_✓t_✓c/_✓p_✓a_✓s_✓s_✓w_✓d at 9600 baud, delete roughly 16 lines
  430.      from the middle of the screen, then hit the `u' key several
  431.      times quickly.  If the display messes up, more padding is
  432.      usually needed.  A similar test can be used for insert-
  433.      character.
  434.  
  435.      Basic Capabilities
  436.  
  437.      The number of columns on each line of the display is given
  438.      by the co numeric capability.  If the display is a CRT, then
  439.      the number of lines on the screen is given by the li capa-
  440.      bility.  If the display wraps around to the beginning of the
  441.      next line when the cursor reaches the right margin, then it
  442.      should have the am capability.  If the terminal can clear
  443.      its screen, the code to do this is given by the cl string
  444.      capability.  If the terminal overstrikes (rather than clear-
  445.      ing the position when a character is overwritten), it should
  446.      have the os capability.  If the terminal is a printing ter-
  447.      minal, with no soft copy unit, give it both hc and os.  (os
  448.      applies to storage scope terminals, such as the Tektronix
  449.      4010 series, as well as to hard copy and APL terminals.) If
  450.      there is a code to move the cursor to the left edge of the
  451.      current row, give this as cr.  (Normally this will be
  452.      carriage-return, ^M.) If there is a code to produce an audi-
  453.      ble signal (bell, beep, _✓e_✓t_✓c.), give this as bl.
  454.  
  455.  
  456.  
  457.  
  458.  
  459. Printed 8/14/86          1 November 1985            7
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  467.  
  468.  
  469.  
  470.      If there is a code (such as backspace) to move the cursor
  471.      one position to the left, that capability should be given as
  472.      le.  Similarly, codes to move to the right, up, and down
  473.      should be given as nd, up, and do, respectively.  These
  474.      _✓l_✓o_✓c_✓a_✓l _✓c_✓u_✓r_✓s_✓o_✓r _✓m_✓o_✓t_✓i_✓o_✓n_✓s should not alter the text they pass
  475.      over; for example, you would not normally use "nd= " unless
  476.      the terminal has the os capability, because the space would
  477.      erase the character moved over.
  478.  
  479.      A very important point here is that the local cursor motions
  480.      encoded in _✓t_✓e_✓r_✓m_✓c_✓a_✓p have undefined behavior at the left and
  481.      top edges of a CRT display.  Programs should never attempt
  482.      to backspace around the left edge, unless bw is given, and
  483.      never attempt to go up off the top using local cursor
  484.      motions.
  485.  
  486.      In order to scroll text up, a program goes to the bottom
  487.      left corner of the screen and sends the sf (index) string.
  488.      To scroll text down, a program goes to the top left corner
  489.      of the screen and sends the sr (reverse index) string.  The
  490.      strings sf and sr have undefined behavior when not on their
  491.      respective corners of the screen.    Parameterized versions of
  492.      the scrolling sequences are SF and SR, which have the same
  493.      semantics as sf and sr except that they take one parameter
  494.      and scroll that many lines.  They also have undefined
  495.      behavior except at the appropriate corner of the screen.
  496.  
  497.      The am capability tells whether the cursor sticks at the
  498.      right edge of the screen when text is output there, but this
  499.      does not necessarily apply to nd from the last column.
  500.      Leftward local motion is defined from the left edge only
  501.      when bw is given; then an le from the left edge will move to
  502.      the right edge of the previous row.  This is useful for
  503.      drawing a box around the edge of the screen, for example.
  504.      If the terminal has switch-selectable automatic margins, the
  505.      _✓t_✓e_✓r_✓m_✓c_✓a_✓p description usually assumes that this feature is on,
  506.      _✓i._✓e., am.    If the terminal has a command that moves to the
  507.      first column of the next line, that command can be given as
  508.      nw (newline).  It is permissible for this to clear the
  509.      remainder of the current line, so if the terminal has no
  510.      correctly-working CR and LF it may still be possible to
  511.      craft a working nw out of one or both of them.
  512.  
  513.      These capabilities suffice to describe hardcopy and "glass-
  514.      tty" terminals.  Thus the Teletype model 33 is described as
  515.  
  516.          T3|tty33|33|tty|Teletype model 33:\
  517.              :bl=^G:co#72:cr=^M:do=^J:hc:os:
  518.  
  519.      and the Lear Siegler ADM-3 is described as
  520.  
  521.  
  522.  
  523.  
  524.  
  525. Printed 8/14/86          1 November 1985            8
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  533.  
  534.  
  535.  
  536.          l3|adm3|3|LSI ADM-3:\
  537.              :am:bl=^G:cl=^Z:co#80:cr=^M:do=^J:le=^H:li#24:sf=^J:
  538.  
  539.      Parameterized Strings
  540.  
  541.      Cursor addressing and other strings requiring parameters are
  542.      described by a parameterized string capability, with
  543.      _✓p_✓r_✓i_✓n_✓t_✓f(3S)-like escapes %x in it, while other characters are
  544.      passed through unchanged.    For example, to address the cur-
  545.      sor the cm capability is given, using two parameters: the
  546.      row and column to move to.  (Rows and columns are numbered
  547.      from zero and refer to the physical screen visible to the
  548.      user, not to any unseen memory.  If the terminal has
  549.      memory-relative cursor addressing, that can be indicated by
  550.      an analogous CM capability.)
  551.  
  552.      The % encodings have the following meanings:
  553.  
  554.       %%   output `%'
  555.       %d   output value as in _✓p_✓r_✓i_✓n_✓t_✓f %d
  556.       %2   output value as in _✓p_✓r_✓i_✓n_✓t_✓f %2d
  557.       %3   output value as in _✓p_✓r_✓i_✓n_✓t_✓f %3d
  558.       %.   output value as in _✓p_✓r_✓i_✓n_✓t_✓f %c
  559.       %+_✓x  add _✓x to value, then do %.
  560.       %>_✓x_✓y if value > _✓x then add _✓y, no output
  561.       %r   reverse order of two parameters, no output
  562.       %i   increment by one, no output
  563.       %n   exclusive-or all parameters with 0140 (Datamedia 2500)
  564.       %B   BCD (16*(value/10)) + (value%10), no output
  565.       %D   Reverse coding (value - 2*(value%16)), no output (Delta Data)
  566.  
  567.      Consider the Hewlett-Packard 2645, which, to get to row 3
  568.      and column 12, needs to be sent "\E&a12c03Y" padded for 6
  569.      milliseconds.  Note that the order of the row and column
  570.      coordinates is reversed here and that the row and column are
  571.      sent as two-digit integers.  Thus its cm capability is
  572.      "cm=6\E&%r%2c%2Y".
  573.  
  574.      The Microterm ACT-IV needs the current row and column sent
  575.      simply encoded in binary preceded by a ^T, "cm=^T%.%.".
  576.      Terminals that use "%." need to be able to backspace the
  577.      cursor (le) and to move the cursor up one line on the screen
  578.      (up).  This is necessary because it is not always safe to
  579.      transmit \n, ^D, and \r, as the system may change or discard
  580.      them.  (Programs using _✓t_✓e_✓r_✓m_✓c_✓a_✓p must set terminal modes so
  581.      that tabs are not expanded, so \t is safe to send.  This
  582.      turns out to be essential for the Ann Arbor 4080.)
  583.  
  584.      A final example is the Lear Siegler ADM-3a, which offsets
  585.      row and column by a blank character, thus "cm=\E=%+ %+ ".
  586.  
  587.  
  588.  
  589.  
  590.  
  591. Printed 8/14/86          1 November 1985            9
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  599.  
  600.  
  601.  
  602.      Row or column absolute cursor addressing can be given as
  603.      single parameter capabilities ch (horizontal position abso-
  604.      lute) and cv (vertical position absolute).  Sometimes these
  605.      are shorter than the more general two-parameter sequence (as
  606.      with the Hewlett-Packard 2645) and can be used in preference
  607.      to cm.  If there are parameterized local motions (_✓e._✓g., move
  608.      _✓n positions to the right) these can be given as DO, LE, RI,
  609.      and UP with a single parameter indicating how many positions
  610.      to move.  These are primarily useful if the terminal does
  611.      not have cm, such as the Tektronix 4025.
  612.  
  613.      Cursor Motions
  614.  
  615.      If the terminal has a fast way to home the cursor (to the
  616.      very upper left corner of the screen), this can be given as
  617.      ho.  Similarly, a fast way of getting to the lower left-hand
  618.      corner can be given as ll; this may involve going up with up
  619.      from the home position, but a program should never do this
  620.      itself (unless ll does), because it can make no assumption
  621.      about the effect of moving up from the home position.  Note
  622.      that the home position is the same as cursor address (0,0):
  623.      to the top left corner of the screen, not of memory.
  624.      (Therefore, the "\EH" sequence on Hewlett-Packard terminals
  625.      cannot be used for ho.)
  626.  
  627.      Area Clears
  628.  
  629.      If the terminal can clear from the current position to the
  630.      end of the line, leaving the cursor where it is, this should
  631.      be given as ce.  If the terminal can clear from the current
  632.      position to the end of the display, this should be given as
  633.      cd.  cd must only be invoked from the first column of a
  634.      line.  (Therefore, it can be simulated by a request to
  635.      delete a large number of lines, if a true cd is not avail-
  636.      able.)
  637.  
  638.      Insert/Delete Line
  639.  
  640.      If the terminal can open a new blank line before the line
  641.      containing the cursor, this should be given as al; this must
  642.      be invoked only from the first position of a line.  The cur-
  643.      sor must then appear at the left of the newly blank line.
  644.      If the terminal can delete the line that the cursor is on,
  645.      this should be given as dl; this must only be used from the
  646.      first position on the line to be deleted.    Versions of al
  647.      and dl which take a single parameter and insert or delete
  648.      that many lines can be given as AL and DL.  If the terminal
  649.      has a settable scrolling region (like the VT100), the com-
  650.      mand to set this can be described with the cs capability,
  651.      which takes two parameters: the top and bottom lines of the
  652.      scrolling region.    The cursor position is, alas, undefined
  653.      after using this command.    It is possible to get the effect
  654.  
  655.  
  656.  
  657. Printed 8/14/86          1 November 1985               10
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  665.  
  666.  
  667.  
  668.      of insert or delete line using this command - the sc and rc
  669.      (save and restore cursor) commands are also useful.  Insert-
  670.      ing lines at the top or bottom of the screen can also be
  671.      done using sr or sf on many terminals without a true
  672.      insert/delete line, and is often faster even on terminals
  673.      with those features.
  674.  
  675.      If the terminal has the ability to define a window as part
  676.      of memory which all commands affect, it should be given as
  677.      the parameterized string wi.  The four parameters are the
  678.      starting and ending lines in memory and the starting and
  679.      ending columns in memory, in that order.  (This _✓t_✓e_✓r_✓m_✓i_✓n_✓f_✓o
  680.      capability is described for completeness.    It is unlikely
  681.      that any _✓t_✓e_✓r_✓m_✓c_✓a_✓p-using program will support it.)
  682.  
  683.      If the terminal can retain display memory above the screen,
  684.      then the da capability should be given; if display memory
  685.      can be retained below, then db should be given.  These indi-
  686.      cate that deleting a line or scrolling may bring non-blank
  687.      lines up from below or that scrolling back with sr may bring
  688.      down non-blank lines.
  689.  
  690.      Insert/Delete Character
  691.  
  692.      There are two basic kinds of intelligent terminals with
  693.      respect to insert/delete character that can be described
  694.      using _✓t_✓e_✓r_✓m_✓c_✓a_✓p.  The most common insert/delete character
  695.      operations affect only the characters on the current line
  696.      and shift characters off the end of the line rigidly.  Other
  697.      terminals, such as the Concept-100 and the Perkin Elmer Owl,
  698.      make a distinction between typed and untyped blanks on the
  699.      screen, shifting upon an insert or delete only to an untyped
  700.      blank on the screen which is either eliminated or expanded
  701.      to two untyped blanks.  You can determine the kind of termi-
  702.      nal you have by clearing the screen then typing text
  703.      separated by cursor motions.  Type "abc    def" using local
  704.      cursor motions (not spaces) between the "abc" and the "def".
  705.      Then position the cursor before the "abc" and put the termi-
  706.      nal in insert mode.  If typing characters causes the rest of
  707.      the line to shift rigidly and characters to fall off the
  708.      end, then your terminal does not distinguish between blanks
  709.      and untyped positions.  If the "abc" shifts over to the
  710.      "def" which then move together around the end of the current
  711.      line and onto the next as you insert, then you have the
  712.      second type of terminal and should give the capability in,
  713.      which stands for "insert null".  While these are two logi-
  714.      cally separate attributes (one line _✓v_✓s. multi-line insert
  715.      mode, and special treatment of untyped spaces), we have seen
  716.      no terminals whose insert mode cannot be described with the
  717.      single attribute.
  718.  
  719.  
  720.  
  721.  
  722.  
  723. Printed 8/14/86          1 November 1985               11
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  731.  
  732.  
  733.  
  734.      _✓T_✓e_✓r_✓m_✓c_✓a_✓p can describe both terminals that have an insert mode
  735.      and terminals that send a simple sequence to open a blank
  736.      position on the current line.  Give as im the sequence to
  737.      get into insert mode.  Give as ei the sequence to leave
  738.      insert mode.  Now give as ic any sequence that needs to be
  739.      sent just before each character to be inserted.  Most termi-
  740.      nals with a true insert mode will not give ic; terminals
  741.      that use a sequence to open a screen position should give it
  742.      here.  (If your terminal has both, insert mode is usually
  743.      preferable to ic.    Do not give both unless the terminal
  744.      actually requires both to be used in combination.) If post-
  745.      insert padding is needed, give this as a number of mil-
  746.      liseconds in ip (a string option).  Any other sequence that
  747.      may need to be sent after insertion of a single character
  748.      can also be given in ip.  If your terminal needs to be
  749.      placed into an `insert mode' and needs a special code
  750.      preceding each inserted character, then both im/ei and ic
  751.      can be given, and both will be used.  The IC capability,
  752.      with one parameter _✓n, will repeat the effects of ic _✓n times.
  753.  
  754.      It is occasionally necessary to move around while in insert
  755.      mode to delete characters on the same line (_✓e._✓g., if there
  756.      is a tab after the insertion position).  If your terminal
  757.      allows motion while in insert mode, you can give the capa-
  758.      bility mi to speed up inserting in this case.  Omitting mi
  759.      will affect only speed.  Some terminals (notably
  760.      Datamedia's) must not have mi because of the way their
  761.      insert mode works.
  762.  
  763.      Finally, you can specify dc to delete a single character, DC
  764.      with one parameter _✓n to delete _✓n characters, and delete mode
  765.      by giving dm and ed to enter and exit delete mode (which is
  766.      any mode the terminal needs to be placed in for dc to work).
  767.  
  768.      Highlighting, Underlining, and Visible Bells
  769.  
  770.      If your terminal has one or more kinds of display attri-
  771.      butes, these can be represented in a number of different
  772.      ways.  You should choose one display form as _✓s_✓t_✓a_✓n_✓d_✓o_✓u_✓t _✓m_✓o_✓d_✓e,
  773.      representing a good high-contrast, easy-on-the-eyes format
  774.      for highlighting error messages and other attention getters.
  775.      (If you have a choice, reverse video plus half-bright is
  776.      good, or reverse video alone.) The sequences to enter and
  777.      exit standout mode are given as so and se, respectively.  If
  778.      the code to change into or out of standout mode leaves one
  779.      or even two blank spaces or garbage characters on the
  780.      screen, as the TVI 912 and Teleray 1061 do, then sg should
  781.      be given to tell how many characters are left.
  782.  
  783.      Codes to begin underlining and end underlining can be given
  784.      as us and ue, respectively.  Underline mode change garbage
  785.      is specified by ug, similar to sg.  If the terminal has a
  786.  
  787.  
  788.  
  789. Printed 8/14/86          1 November 1985               12
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  797.  
  798.  
  799.  
  800.      code to underline the current character and move the cursor
  801.      one position to the right, such as the Microterm Mime, this
  802.      can be given as uc.
  803.  
  804.      Other capabilities to enter various highlighting modes
  805.      include mb (blinking), md (bold or extra bright), mh (dim or
  806.      half-bright), mk (blanking or invisible text), mp (pro-
  807.      tected), mr (reverse video), me (turn off _✓a_✓l_✓l attribute
  808.      modes), as (enter alternate character set mode), and ae
  809.      (exit alternate character set mode).  Turning on any of
  810.      these modes singly may or may not turn off other modes.
  811.  
  812.      If there is a sequence to set arbitrary combinations of
  813.      mode, this should be given as sa (set attributes), taking 9
  814.      parameters.  Each parameter is either 0 or 1, as the
  815.      corresponding attributes is on or off.  The 9 parameters
  816.      are, in order: standout, underline, reverse, blink, dim,
  817.      bold, blank, protect, and alternate character set.  Not all
  818.      modes need be supported by sa, only those for which
  819.      corresponding attribute commands exist.  (It is unlikely
  820.      that a _✓t_✓e_✓r_✓m_✓c_✓a_✓p-using program will support this capability,
  821.      which is defined for compatibility with _✓t_✓e_✓r_✓m_✓i_✓n_✓f_✓o.)
  822.  
  823.      Terminals with the "magic cookie" glitches (sg and ug),
  824.      rather than maintaining extra attribute bits for each char-
  825.      acter cell, instead deposit special "cookies", or "garbage
  826.      characters", when they receive mode-setting sequences, which
  827.      affect the display algorithm.
  828.  
  829.      Some terminals, such as the Hewlett-Packard 2621, automati-
  830.      cally leave standout mode when they move to a new line or
  831.      when the cursor is addressed.  Programs using standout mode
  832.      should exit standout mode on such terminals before moving
  833.      the cursor or sending a newline.  On terminals where this is
  834.      not a problem, the ms capability should be present to say
  835.      that this overhead is unnecessary.
  836.  
  837.      If the terminal has a way of flashing the screen to indicate
  838.      an error quietly (a bell replacement), this can be given as
  839.      vb; it must not move the cursor.
  840.  
  841.      If the cursor needs to be made more visible than normal when
  842.      it is not on the bottom line (to change, for example, a
  843.      non-blinking underline into an easier-to-find block or
  844.      blinking underline), give this sequence as vs.  If there is
  845.      a way to make the cursor completely invisible, give that as
  846.      vi.  The capability ve, which undoes the effects of both of
  847.      these modes, should also be given.
  848.  
  849.      If your terminal correctly displays underlined characters
  850.      (with no special codes needed) even though it does not over-
  851.      strike, then you should give the capability ul.  If
  852.  
  853.  
  854.  
  855. Printed 8/14/86          1 November 1985               13
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  863.  
  864.  
  865.  
  866.      overstrikes are erasable with a blank, this should be indi-
  867.      cated by giving eo.
  868.  
  869.      Keypad
  870.  
  871.      If the terminal has a keypad that transmits codes when the
  872.      keys are pressed, this information can be given.  Note that
  873.      it is not possible to handle terminals where the keypad only
  874.      works in local mode (this applies, for example, to the
  875.      unshifted Hewlett-Packard 2621 keys).  If the keypad can be
  876.      set to transmit or not transmit, give these codes as ks and
  877.      ke.  Otherwise the keypad is assumed to always transmit.
  878.      The codes sent by the left-arrow, right-arrow, up-arrow,
  879.      down-arrow, and home keys can be given as kl, kr, ku, kd,
  880.      and kh, respectively.  If there are function keys such as
  881.      f0, f1, ..., f9, the codes they send can be given as k0, k1,
  882.      k9.  If these keys have labels other than the default f0
  883.      through f9, the labels can be given as l0, l1, l9.  The
  884.      codes transmitted by certain other special keys can be
  885.      given: kH (home down), kb (backspace), ka (clear all tabs),
  886.      kt (clear the tab stop in this column), kC (clear screen or
  887.      erase), kD (delete character), kL (delete line), kM (exit
  888.      insert mode), kE (clear to end of line), kS (clear to end of
  889.      screen), kI (insert character or enter insert mode), kA
  890.      (insert line), kN (next page), kP (previous page), kF
  891.      (scroll forward/down), kR (scroll backward/up), and kT (set
  892.      a tab stop in this column).  In addition, if the keypad has
  893.      a 3 by 3 array of keys including the four arrow keys, then
  894.      the other five keys can be given as K1, K2, K3, K4, and K5.
  895.      These keys are useful when the effects of a 3 by 3 direc-
  896.      tional pad are needed.  The obsolete ko capability formerly
  897.      used to describe "other" function keys has been completely
  898.      supplanted by the above capabilities.
  899.  
  900.      The ma entry is also used to indicate arrow keys on termi-
  901.      nals that have single-character arrow keys.  It is obsolete
  902.      but still in use in version 2 of _✓v_✓i which must be run on
  903.      some minicomputers due to memory limitations.  This field is
  904.      redundant with kl, kr, ku, kd, and kh.  It consists of
  905.      groups of two characters.    In each group, the first charac-
  906.      ter is what an arrow key sends, and the second character is
  907.      the corresponding _✓v_✓i command.  These commands are h for kl,
  908.      j for kd, k for ku, l for kr, and H for kh.  For example,
  909.      the Mime would have "ma=^Hh^Kj^Zk^Xl" indicating arrow keys
  910.      left (^H), down (^K), up (^Z), and right (^X).  (There is no
  911.      home key on the Mime.)
  912.  
  913.      Tabs and Initialization
  914.  
  915.      If the terminal needs to be in a special mode when running a
  916.      program that uses these capabilities, the codes to enter and
  917.      exit this mode can be given as ti and te.    This arises, for
  918.  
  919.  
  920.  
  921. Printed 8/14/86          1 November 1985               14
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  929.  
  930.  
  931.  
  932.      example, from terminals like the Concept with more than one
  933.      page of memory.  If the terminal has only memory-relative
  934.      cursor addressing and not screen-relative cursor addressing,
  935.      a screen-sized window must be fixed into the display for
  936.      cursor addressing to work properly.  This is also used for
  937.      the Tektronix 4025, where ti sets the command character to
  938.      be the one used by _✓t_✓e_✓r_✓m_✓c_✓a_✓p.
  939.  
  940.      Other capabilities include is, an initialization string for
  941.      the terminal, and if, the name of a file containing long
  942.      initialization strings.  These strings are expected to set
  943.      the terminal into modes consistent with the rest of the
  944.      _✓t_✓e_✓r_✓m_✓c_✓a_✓p description.  They are normally sent to the terminal
  945.      by the _✓t_✓s_✓e_✓t program each time the user logs in.  They will
  946.      be printed in the following order: is; setting tabs using ct
  947.      and st; and finally if.  (_✓T_✓e_✓r_✓m_✓i_✓n_✓f_✓o uses i1-i2 instead of is
  948.      and runs the program iP and prints i3 after the other ini-
  949.      tializations.) A pair of sequences that does a harder reset
  950.      from a totally unknown state can be analogously given as rs
  951.      and if.  These strings are output by the _✓r_✓e_✓s_✓e_✓t program,
  952.      which is used when the terminal gets into a wedged state.
  953.      (_✓T_✓e_✓r_✓m_✓i_✓n_✓f_✓o uses r1-r3 instead of rs.) Commands are normally
  954.      placed in rs and rf only if they produce annoying effects on
  955.      the screen and are not necessary when logging in.    For exam-
  956.      ple, the command to set the VT100 into 80-column mode would
  957.      normally be part of is, but it causes an annoying glitch of
  958.      the screen and is not normally needed since the terminal is
  959.      usually already in 80-column mode.
  960.  
  961.      If the terminal has hardware tabs, the command to advance to
  962.      the next tab stop can be given as ta (usually ^I).  A "back-
  963.      tab" command which moves leftward to the previous tab stop
  964.      can be given as bt.  By convention, if the terminal driver
  965.      modes indicate that tab stops are being expanded by the com-
  966.      puter rather than being sent to the terminal, programs
  967.      should not use ta or bt even if they are present, since the
  968.      user may not have the tab stops properly set.  If the termi-
  969.      nal has hardware tabs that are initially set every _✓n posi-
  970.      tions when the terminal is powered up, then the numeric
  971.      parameter it is given, showing the number of positions
  972.      between tab stops.  This is normally used by the _✓t_✓s_✓e_✓t com-
  973.      mand to determine whether to set the driver mode for
  974.      hardware tab expansion, and whether to set the tab stops.
  975.      If the terminal has tab stops that can be saved in nonvola-
  976.      tile memory, the _✓t_✓e_✓r_✓m_✓c_✓a_✓p description can assume that they
  977.      are properly set.
  978.  
  979.      If there are commands to set and clear tab stops, they can
  980.      be given as ct (clear all tab stops) and st (set a tab stop
  981.      in the current column of every row).  If a more complex
  982.      sequence is needed to set the tabs than can be described by
  983.      this, the sequence can be placed in is or if.
  984.  
  985.  
  986.  
  987. Printed 8/14/86          1 November 1985               15
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  995.  
  996.  
  997.  
  998.      Delays
  999.  
  1000.      Certain capabilities control padding in the terminal driver.
  1001.      These are primarily needed by hardcopy terminals and are
  1002.      used by the _✓t_✓s_✓e_✓t program to set terminal driver modes
  1003.      appropriately.  Delays embedded in the capabilities cr, sf,
  1004.      le, ff, and ta will cause the appropriate delay bits to be
  1005.      set in the terminal driver.  If pb (padding baud rate) is
  1006.      given, these values can be ignored at baud rates below the
  1007.      value of pb.  For 4.2BSD _✓t_✓s_✓e_✓t, the delays are given as
  1008.      numeric capabilities dC, dN, dB, dF, and dT instead.
  1009.  
  1010.      Miscellaneous
  1011.  
  1012.      If the terminal requires other than a NUL (zero) character
  1013.      as a pad, this can be given as pc.  Only the first character
  1014.      of the pc string is used.
  1015.  
  1016.      If the terminal has commands to save and restore the posi-
  1017.      tion of the cursor, give them as sc and rc.
  1018.  
  1019.      If the terminal has an extra "status line" that is not nor-
  1020.      mally used by software, this fact can be indicated.  If the
  1021.      status line is viewed as an extra line below the bottom
  1022.      line, then the capability hs should be given.  Special
  1023.      strings to go to a position in the status line and to return
  1024.      from the status line can be given as ts and fs.  (fs must
  1025.      leave the cursor position in the same place that it was
  1026.      before ts.  If necessary, the sc and rc strings can be
  1027.      included in ts and fs to get this effect.) The capability ts
  1028.      takes one parameter, which is the column number of the
  1029.      status line to which the cursor is to be moved.  If escape
  1030.      sequences and other special commands such as tab work while
  1031.      in the status line, the flag es can be given.  A string that
  1032.      turns off the status line (or otherwise erases its contents)
  1033.      should be given as ds.  The status line is normally assumed
  1034.      to be the same width as the rest of the screen, _✓i._✓e., co.
  1035.      If the status line is a different width (possibly because
  1036.      the terminal does not allow an entire line to be loaded),
  1037.      then its width in columns can be indicated with the numeric
  1038.      parameter ws.
  1039.  
  1040.      If the terminal can move up or down half a line, this can be
  1041.      indicated with hu (half-line up) and hd (half-line down).
  1042.      This is primarily useful for superscripts and subscripts on
  1043.      hardcopy terminals.  If a hardcopy terminal can eject to the
  1044.      next page (form feed), give this as ff (usually ^L).
  1045.  
  1046.      If there is a command to repeat a given character a given
  1047.      number of times (to save time transmitting a large number of
  1048.      identical characters), this can be indicated with the
  1049.      parameterized string rp.  The first parameter is the
  1050.  
  1051.  
  1052.  
  1053. Printed 8/14/86          1 November 1985               16
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  1061.  
  1062.  
  1063.  
  1064.      character to be repeated and the second is the number of
  1065.      times to repeat it.  (This is a _✓t_✓e_✓r_✓m_✓i_✓n_✓f_✓o feature that is
  1066.      unlikely to be supported by a program that uses _✓t_✓e_✓r_✓m_✓c_✓a_✓p.)
  1067.  
  1068.      If the terminal has a settable command character, such as
  1069.      the Tektronix 4025, this can be indicated with CC.  A proto-
  1070.      type command character is chosen which is used in all capa-
  1071.      bilities.    This character is given in the CC capability to
  1072.      identify it.  The following convention is supported on some
  1073.      UNIX systems: The environment is to be searched for a CC
  1074.      variable, and if found, all occurrences of the prototype
  1075.      character are replaced by the character in the environment
  1076.      variable.    This use of the CC environment variable is a very
  1077.      bad idea, as it conflicts with _✓m_✓a_✓k_✓e(1).
  1078.  
  1079.      Terminal descriptions that do not represent a specific kind
  1080.      of known terminal, such as _✓s_✓w_✓i_✓t_✓c_✓h, _✓d_✓i_✓a_✓l_✓u_✓p, _✓p_✓a_✓t_✓c_✓h, and _✓n_✓e_✓t_✓-
  1081.      _✓w_✓o_✓r_✓k, should include the gn (generic) capability so that
  1082.      programs can complain that they do not know how to talk to
  1083.      the terminal.  (This capability does not apply to _✓v_✓i_✓r_✓t_✓u_✓a_✓l
  1084.      terminal descriptions for which the escape sequences are
  1085.      known.)
  1086.  
  1087.      If the terminal uses xoff/xon (DC3/DC1) handshaking for flow
  1088.      control, give xo.    Padding information should still be
  1089.      included so that routines can make better decisions about
  1090.      costs, but actual pad characters will not be transmitted.
  1091.  
  1092.      If the terminal has a "meta key" which acts as a shift key,
  1093.      setting the 8th bit of any character transmitted, then this
  1094.      fact can be indicated with km.  Otherwise, software will
  1095.      assume that the 8th bit is parity and it will usually be
  1096.      cleared.  If strings exist to turn this "meta mode" on and
  1097.      off, they can be given as mm and mo.
  1098.  
  1099.      If the terminal has more lines of memory than will fit on
  1100.      the screen at once, the number of lines of memory can be
  1101.      indicated with lm.  An explicit value of 0 indicates that
  1102.      the number of lines is not fixed, but that there is still
  1103.      more memory than fits on the screen.
  1104.  
  1105.      If the terminal is one of those supported by the UNIX system
  1106.      virtual terminal protocol, the terminal number can be given
  1107.      as vt.
  1108.  
  1109.      Media copy strings which control an auxiliary printer con-
  1110.      nected to the terminal can be given as ps: print the con-
  1111.      tents of the screen; pf: turn off the printer; and po: turn
  1112.      on the printer.  When the printer is on, all text sent to
  1113.      the terminal will be sent to the printer.    It is undefined
  1114.      whether the text is also displayed on the terminal screen
  1115.      when the printer is on.  A variation pO takes one parameter
  1116.  
  1117.  
  1118.  
  1119. Printed 8/14/86          1 November 1985               17
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  1127.  
  1128.  
  1129.  
  1130.      and leaves the printer on for as many characters as the
  1131.      value of the parameter, then turns the printer off.  The
  1132.      parameter should not exceed 255.  All text, including pf, is
  1133.      transparently passed to the printer while pO is in effect.
  1134.  
  1135.      Strings to program function keys can be given as pk, pl, and
  1136.      px.  Each of these strings takes two parameters: the func-
  1137.      tion key number to program (from 0 to 9) and the string to
  1138.      program it with.  Function key numbers out of this range may
  1139.      program undefined keys in a terminal-dependent manner.  The
  1140.      differences among the capabilities are that pk causes press-
  1141.      ing the given key to be the same as the user typing the
  1142.      given string; pl causes the string to be executed by the
  1143.      terminal in local mode; and px causes the string to be
  1144.      transmitted to the computer.  Unfortunately, due to lack of
  1145.      a definition for string parameters in _✓t_✓e_✓r_✓m_✓c_✓a_✓p, only _✓t_✓e_✓r_✓m_✓i_✓n_✓f_✓o
  1146.      supports these capabilities.
  1147.  
  1148.      Glitches and Braindamage
  1149.  
  1150.      Hazeltine terminals, which do not allow `~' characters to be
  1151.      displayed, should indicate hz.
  1152.  
  1153.      The nc capability, now obsolete, formerly indicated
  1154.      Datamedia terminals, which echo \r \n for carriage return
  1155.      then ignore a following linefeed.
  1156.  
  1157.      Terminals that ignore a linefeed immediately after an am
  1158.      wrap, such as the Concept, should indicate xn.
  1159.  
  1160.      If ce is required to get rid of standout (instead of merely
  1161.      writing normal text on top of it), xs should be given.
  1162.  
  1163.      Teleray terminals, where tabs turn all characters moved over
  1164.      to blanks, should indicate xt (destructive tabs).    This
  1165.      glitch is also taken to mean that it is not possible to
  1166.      position the cursor on top of a "magic cookie", and that to
  1167.      erase standout mode it is necessary to use delete and insert
  1168.      line.
  1169.  
  1170.      The Beehive Superbee, which is unable to correctly transmit
  1171.      the ESC or ^C characters, has xb, indicating that the "f1"
  1172.      key is used for ESC and "f2" for ^C.  (Only certain Super-
  1173.      bees have this problem, depending on the ROM.)
  1174.  
  1175.      Other specific terminal problems may be corrected by adding
  1176.      more capabilities of the form x_✓x.
  1177.  
  1178.      Similar Terminals
  1179.  
  1180.      If there are two very similar terminals, one can be defined
  1181.      as being just like the other with certain exceptions.  The
  1182.  
  1183.  
  1184.  
  1185. Printed 8/14/86          1 November 1985               18
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. TERMCAP(5)        UNIX Programmer's Manual           TERMCAP(5)
  1193.  
  1194.  
  1195.  
  1196.      string capability tc can be given with the name of the simi-
  1197.      lar terminal.  This capability must be _✓l_✓a_✓s_✓t, and the com-
  1198.      bined length of the entries must not exceed 1024.    The capa-
  1199.      bilities given before tc override those in the terminal type
  1200.      invoked by tc.  A capability can be canceled by placing xx@
  1201.      to the left of the tc invocation, where _✓x_✓x is the capabil-
  1202.      ity.  For example, the entry
  1203.  
  1204.       hn|2621-nl:ks@:ke@:tc=2621:
  1205.  
  1206.      defines a "2621-nl" that does not have the ks or ke capabil-
  1207.      ities, hence does not turn on the function key labels when
  1208.      in visual mode.  This is useful for different modes for a
  1209.      terminal, or for different user preferences.
  1210.  
  1211. AUTHOR
  1212.      William Joy
  1213.      Mark Horton added underlining and keypad support
  1214.  
  1215. FILES
  1216.      /etc/termcap   file containing terminal descriptions
  1217.  
  1218. SEE ALSO
  1219.      ex(1), more(1), tset(1), ul(1), vi(1), curses(3X),
  1220.      printf(3S), term(7).
  1221.  
  1222. CAVEATS AND BUGS
  1223.      Note: _✓t_✓e_✓r_✓m_✓c_✓a_✓p was replaced by _✓t_✓e_✓r_✓m_✓i_✓n_✓f_✓o in UNIX System V
  1224.      Release 2.0.  The transition will be relatively painless if
  1225.      capabilities flagged as "obsolete" are avoided.
  1226.  
  1227.      Lines and columns are now stored by the kernel as well as in
  1228.      the termcap entry.  Most programs now use the kernel infor-
  1229.      mation primarily; the information in this file is used only
  1230.      if the kernel does not have any information.
  1231.  
  1232.      _✓V_✓i allows only 256 characters for string capabilities, and
  1233.      the routines in _✓t_✓e_✓r_✓m_✓l_✓i_✓b(3) do not check for overflow of this
  1234.      buffer.  The total length of a single entry (excluding only
  1235.      escaped newlines) may not exceed 1024.
  1236.  
  1237.      Not all programs support all entries.
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251. Printed 8/14/86          1 November 1985               19
  1252.  
  1253.  
  1254.  
  1255.