

termcap               Technical Information               termcap




Terminal description language


termcap  is  a   language  for  describing  terminals  and  their
capabilities.   Terminal descriptions are  collected in  the file
/etc/termcap and are read  by ttggeetteenntt and its related programs to
ensure that  output to a particular terminal is  in a format that
that terminal can understand.

A terminal description written in tteerrmmccaapp consists of a series of
fields, which are separated from each other by colons `:'.  Every
line in  the description,  with the  exception of the  last line,
must end in a  backslash `\'.  Tab characters are ignored.  Lines
that begin  with a `#' are comments.   A tteerrmmccaapp description must
not exceed 1,024 characters.

The first field  names the terminal.  Several different names may
be used,  each separated by a vertical bar  `|'; each name given,
however, must be unique within the file /eettcc/tteerrmmccaapp.  By conven-
tion, the  first listed must be two  characters long.  The second
name is  the name by  which the terminal is  most commonly known;
this name  may contain  no blanks in  it.  Other versions  of the
name may  follow.  By  convention, the  last version is  the full
name of  the terminal; here,  spaces may be  used for legibility.
Any of  these may be used  to name your terminal  to the COHERENT
system.  For  example, the name field for  the VT-100 terminal is
as follows:


        d1|vt100|vt-100|pt100|pt-100|dec vt100:\


Note that the names are  separated by vertical bars `|', that the
field ends with a colon, and that the line ends with a backslash.
Using any of these names in an eexxppoorrtt command will  make the cor-
rect terminal description  available to programs that need to use
it.

The remaining  fields in the  entry describe the  capabilities of
the  terminal.  Each  capability field  consists of  a two-letter
code, and  may include  additional information.  There  are three
types of capability:

_B_o_o_l_e_a_n
     This indicates whether or not a terminal has a specific fea-
     ture.  If  the field is present, the  terminal is assumed to
     have the  feature; if it is absend,  the terminal is assumed
     not to have that feature.  For example, the field

             aamm:

     is present, tteerrmmccaapp  assumes that the terminal has automatic
     margins, whereas  if that field is  not present, the program
     using termcap assumes that the terminal does not have them.


COHERENT Lexicon                                           Page 1




termcap               Technical Information               termcap




_N_u_m_e_r_i_c
     This gives the size of some aspect of the terminal.  Numeric
     capability fields  have the  capability code, followed  by a
     `#' and a number.  For example, the entry

             ccoo#8800:

     means that the terminal screen is 80 columns wide.

_S_t_r_i_n_g _c_a_p_a_b_i_l_i_t_i_e_s
     These give a  sequence of characters that trigger a terminal
     operation.  These fields  consist of the capability code, an
     equal sign `=', and the string.

     Strings often include  escape sequences.  A ``\EE'' indicates
     an <EESSCC> character;  a control character is indicated with a
     carat `^' plus the appropriate letter; and the sequences \bb,
     \ff, \nn,  \rr, and \tt are,  respectively, backspace, formfeed,
     newline, <rreettuurrnn>, and tab.

     An  integer or  an integer  followed by  an asterisk  in the
     string (e.g., `_i_n_t*')  indicates that execution of the func-
     tion should  be delayed by  _i_n_t milliseconds; this  delay is
     termed _p_a_d_d_i_n_g.   Thus, deletion  on lines on  the Microterm
     Mime-2A is coded as:

             dl=20*^W:

     ddll is the capability  code for _d_e_l_e_t_e, the equal sign intro-
     duces the  deletion sequence,  2200* indicates that  each line
     deletion should  be delayed by  20 milliseconds, and  ^WW in-
     dicates that the line-deletion code on the Mime-2A is <ccttrrll-
     WW>.

     The asterisk indicates  that the padding required is propor-
     tional to the number of lines affected by the operation.  In
     the above example, the deletion of four lines on the Mime-2A
     generates a  total of 80 milliseconds of  padding; if no as-
     terisk were  present, however, the padding  would be only 20
     milliseconds, no matter  how many lines were deleted.  Also,
     when an  asterisk is  used, the number  may be given  to one
     decimal place, to show tenths of a millisecond of padding.

     Note that with  string capabilities, characters may be given
     as a  backslash followed  by the  three octal digits  of the
     character's ASCII code.  Thus, a colon in a capability field
     may  be given  by \007722.   To put a  null character  into the
     string, use  \220000, because termcap strips  the high bit from
     each character.

     Finally,  the literal  characters `^' and  `\' are  given by
     ``\^'' and ``\\''.




COHERENT Lexicon                                           Page 2




termcap               Technical Information               termcap



***** Capability Codes *****

The following  table lists tteerrmmccaapp's capability  codes.  TTyyppee in-
dicates whether  the code is boolean, numeric,  or string; an am-
persand `&'  indicates that this capability  may include padding,
and an ampersand plus an asterisk ``&*'' indicates that it may be
used with the asterisk padding function described above.

_N_a_m_e      _T_y_p_e      _D_e_f_i_n_i_t_i_o_n

aaee        string&   End alternate set of characters
aall        string&*  Add blank line
aamm        boolean   Automatic margins
aass        string&   Start alternate set of characters
bbcc        string    Backspace character, if not ^HH
bbss        boolean   Backspace character is ^HH
bbtt        string&   Backtab
bbww        boolean   Backspace wraps from column 0
                    to last column
CCCC        string    Command character in prototype
                    if it can be set at terminal
ccdd        string&*  Clear to end of display
ccee        string&   Clear line
cchh        string&   Horizontal cursor motion
ccll        string&*  Clear screen
ccmm        string&   Cursor motion, both vertical and
                    horizontal
ccoo        number&   Number of columns
ccrr        string&*  <rreettuurrnn>; default ^MM
ccss        string&   Change scrolling region (DEC
                    VT100 only); resembles ccmm
ccvv        string&   Vertical cursor motion
ddaa        boolean&  Display above may be retained
ddBB        number    Milliseconds of delay needed by bbss
ddbb        boolean   Display below may be retained
ddCC        number    Milliseconds of delay needed by ccrr
ddcc        string&*  Delete a character
ddFF        number    Milliseconds of delay needed byffff
ddll        string&*  Delete a line
ddmm        string    Enter delete mode
ddNN        number    Milliseconds of delay needed by nnll
ddoo        string    Move down one line
ddTT        number    Milliseconds of delay needed by tab
eedd        string    Leave delete mode
eeii        string    Leave insert mode; use :eeii=:
                    if this string is the same as iicc
eeoo        string    Erase overstrikes with a blank
ffff        string&*  Eject hardcopy terminal page;
                    default ^LL
hhcc        boolean   Hardcopy terminal
hhdd        string    Move half-line down, i.e., forward
                    1/2 line feed)
hhoo        string    Move cursor to home position; use
                    if ccmm is not set
hhuu        string    Move half-line up, i.e., reverse


COHERENT Lexicon                                           Page 3




termcap               Technical Information               termcap



                    1/2 line feed
hhzz        string    Cannot print tilde `~' (Hazeltine
                    terminals only)
iicc        string&   Insert a character
iiff        string    Name of the file that contains iiss
iimm        string    Begin insert mode; use :iimm=:
                    if iicc has not been set
iinn        boolean   Nulls are distinguished in display
iipp        string&*  Insert padding after each
                    character listed
iiss        string    Initialize terminal
kk00-kk99     string    Codes sent by function keys 0-9
kkbb        string    Code sent by backspace key
kkdd        string    Code sent by down-arrow key
kkee        string    Leave ``keypad transmit'' mode
kkhh        string    Code sent by home key
kkll        string    Code sent by left-arrow key
kknn        number    No. of function keys; default is 10
kkoo        string    Entries for for all other
                    non-function keys
kkrr        string    Code sent by right-arrow key
kkss        string    Begin ``keypad transmit'' mode
kkuu        string    Code sent by up-arrow key
ll00-ll99     string    Function keys labels if not f0-f9
llii        number    Number of lines
llll        string    Move cursor to first column of
                    last line; use if ccmm is not set
mmii        boolean   Cursor may be safely moved while
                    in insert mode
mmll        string    Turn on memory lock for area of
                    screen above cursor
mmss        boolean   Cursor may be safely moved while
                    in standout or underline mode
mmuu        string    Turn off memory lock
nncc        boolean   <rreettuurrnn> does not work
nndd        string    Move cursor right non-destructively
nnll        string&*  Newline character; default is \nn.  _O_b_s_o_l_e_t_e
nnss        boolean   Terminal is CRT, but does not scroll
ooss        boolean   Terminal can overstrike
ppcc        string    Pad character any character other than null
pptt        boolean   Terminal's tabs set by hardware;
                    may need to be set with iiss
ssee        string    Exit standout mode
ssff        string&   Scroll forward
ssgg        number    Blank characters left by ssoo or ssee
ssoo        string    Enter standout mode
ssrr        string&   Reverse scroll
ttaa        string&   Tab character other than ^II,
                    or used with character padding
ttcc        string    Similar terminal--must be
                    last field in entry
ttee        string    End a program that uses ccmm
ttii        string    Begin a program that uses ccmm
uucc        string    Underscore character and skip it
uuee        string    Leave underscore mode


COHERENT Lexicon                                           Page 4




termcap               Technical Information               termcap



uugg        number    Blank characters left by uuss or uuee
uull        boolean   Terminal underlines but does not overstrike
uupp        string    Move up one line
uuss        string    Begin underscore mode
vvbb        string    Visible bell; may not move cursor
vvee        string    Exit open/visual mode
vvss        string    Begin open/visual mode
xxbb        boolean   Beehive terminal (f1=<eesscc>,
                    f2=<ccrrttll-CC>)
xxnn        boolean   Newline is ignored after wrap
xxrr        boolean   <rreettuurrnn> behaves like ccee \rr \nn
xxss        boolean   Standout mode is not erased by writing over it
xxtt        boolean   Tabs are destructive

The following is the  tteerrmmccaapp description of the Zenith Z-19 ter-
minal.  The meaning of each field will be described:


kb|h19|heath|h19b|heathkit|heath-19|z19|zenith|heathkit h19:\
     :al=1*\EL:am:bs:cd=\EJ:ce=\EK:cl=\EE:cm=\EY%+ %+ :\
     :co#80:dc=\EN:dl=1*\EM:do=\EB:ei=\EO:ho=\EH:\
     :im=\E@:li#24:mi:nd=\EC:as=\EF:ae=\EG:ms:pt:\
     :sr=\EI:se=\Eq:so=\Ep:up=\EA:vs=\Ex4:ve=\Ey4:\
     :kb=^h:ku=\EA:kd=\EB:kl=\ED:kr=\EC:kh=\EH:kn#8:\
     :k1=\ES:k2=\ET:k3=\EU:k4=\EV:k5=\EW:\
     :l6=blue:l7=red:l8=white:k6=\EP:k7=\EQ:k8=\ER:


The first field, which occupies line 1, gives the various aliases
for  this  terminal.   The  Heathkit  H-19,  which  appears  most
prominently, was the home-kit version of the commercially sold Z-
19.  The remaining fields mean the following:

:aall=11*\EELL:  <eesscc>LL adds new blank line; use
            one millisecond for each line added
:aamm:        Terminal has automatic margins
:bbss:        Backspace character is <ccttrrll>-HH (the default)
:ccdd=\EEJJ:    <eesscc>JJ clears to end of display
:ccee=\EEKK:    <eesscc>KK clears to end of line
:ccll=\EEEE:    <eesscc>EE clears screen
:ccmm=\EEYY%+ %+ :Cursor motion (described later)
:ccoo#8800:     Screen has 80 columns
:ddcc=\EENN:\   <eesscc>NN deletes a character
            (backslash indicates end of a line)
:ddll=11*\EEMM:  <eesscc>MM deletes a line
:ddoo=\EEBB:    <eesscc>BB moves cursor down one line
:eeii=\EEOO:    <eesscc>OO exits from insert mode
:hhoo=\EEHH:    <eesscc>HH moves cursor to home position
:iimm=\EE@:    <eesscc>@ begins insert mode (note that
            iicc is set)
:llii#2244:     Terminal has 24 lines
:mmii:        Cursor may be moved safely while terminal
            is in insert mode
:nndd=\EECC:    <eesscc>CC moves cursor right non-destructively
:aass=\EEFF:    <eesscc>FF begins set of alternate characters


COHERENT Lexicon                                           Page 5




termcap               Technical Information               termcap



:aaee=\EEGG:\   <eesscc>GG ends set of alternate characters
:mmss:        Cursor may be moved safely while terminal
            is in standout and underline mode
:pptt:        Terminal has hardware tabs
:ssrr=\EEII:    <eesscc>II reverse-scrolls the screen
:ssee=\EEqq:    <eesscc>qq exits standout mode
:ssoo=\EEpp:    <eesscc>pp begins standout mode
:uupp=\EEAA:    <eesscc>AA moves the cursor up one line
:vvss=\EExx44:   <eesscc>xx begins visual mode; insert
            4 milliseconds of padding
            when visual mode is begun
:vvee=\EEyy44:\  <eesscc>yy ends visual mode; insert
            4 milliseconds of padding when visual
            mode is ended
:kkbb=^hh:     Backspace key sends <CCttrrll>-HH
:kkuu=\EEAA:    Up-arrow key sends <eesscc>AA
:kkdd=\EEBB:    Down-arrow key sends <eesscc>BB
:kkll=\EEDD:    Left-arrow key sends <eesscc>DD
:kkrr=\EECC:    Right-arrow key sends <eesscc>CC
:kkhh=\EEHH:    Home key sends <eesscc>HH
:kknn#88:\     There are eight other keys on the
            keyboard
:kk11=\EESS:    Other key 1 sends <eesscc>SS
:kk22=\EETT:    Other key 2 sends <eesscc>TT
:kk33=\EEUU:    Other key 3 sends <eesscc>UU
:kk44=\EEVV:    Other key 4 sends <eesscc>VV
:kk55=\EEWW:\   Other key 5 sends <eesscc>WW
:ll66=bblluuee:   Other key 6 is labeled ``blue''
:ll77=rreedd:    Other key 7 is labeled ``red''
:ll88=wwhhiittee:  Other key 8 is labeled ``white''
:kk66=\EEPP:    Other key 6 sends <eesscc>PP
:kk77=\EEQQ:    Other key 7 sends <eesscc>QQ
:kk88=\EERR:    Other key 8 sends <eesscc>RR

Note that the  last field did _n_o_t end with  a backslash; this in-
dicated to  the COHERENT system that  the tteerrmmccaapp description was
finished.

A terminal  description does not  have to be  nearly so detailed.
If  you wish  to use  a new terminal,  first check  the following
table to see  if it already appears by tteerrmmccaapp.   If it does not,
check the terminal's documentation to see if it mimics a terminal
that  is  already  in  /eettcc/tteerrmmccaapp,  and use  that  description,
modifying it if necessary and changing the name to suit your ter-
minal.   If you  must create an  entirely new  description, first
prepare  a  skeleton  file  that  contains  the  following  basic
elements: number  of lines, number of  columns, backspace, cursor
motion, line delete,  clear screen, move cursor to home position,
newline, move cursor  up a line, and non-destructive right space.
For  example, the  following is the  tteerrmmccaapp description  for the
Lear-Siegler ADM-3A terminal:






COHERENT Lexicon                                           Page 6




termcap               Technical Information               termcap



la|adm3a|3a|lsi adm3a:\
     :am:bs:cd=^W:ce=^X:cm=\E=%+ %+ :cl=^Z:co#80:ho=^^:li#24:\
     :nd=^L:up=^K:


Once you  have installed  and debugged the  skeleton description,
add  details gradually  until every  feature  of the  terminal is
described.

***** Cursor Motion *****

The cursor motion  characteristic contains pprriinnttff-like escape se-
quences  not used  elsewhere.  These encode  the line  and column
positions of the  cursor, whereas other characters are passed un-
changed.  If the ccmm string  is considered as a function, then its
arguments are the  line and the column to which  the cursor is to
move; the % codes have the following meanings:

%dd   Decimal number, as in printf.  The origin is 0.

%22   Two-digit decimal number.  The same as %22dd in printf.

%33   Three-digit decimal number.  The same as %33dd in printf.

%.   Single byte.  The same as %cc in printf.

%+_n  Add n to the current position value.  n may be either a num-
     ber or a character.

%>_n_m  If the  current position  value is  greater than  _n+_m; then
     there is no output.

%rr   Reverse  order of line  and column, giving  column first and
     then line.  No output.

%ii   Increment line and column.

%%   Give a % sign in the string.

%nn   Exclusive or line  and column with 0140 (Datamedia 2500 ter-
     minal only).

%BB   Binary coded decimal (16 * (_n/10))+(_n%10).  No output.

%DD   Reverse  coding (_n-(22*(_n%1166)).   No output (Delta  Data ter-
     minal only).

To send  the cursor to  line 3, column 12  on the Hewlett-Packard
2645,  the  terminal  must be  sent  <eesscc>&aa1122cc0033YY  padded for  6
milliseconds.  Note  that the column is given  first and then the
line, and that the line and  column are given as two digits each.
Thus, the cm capability for the Hewlett-Packard 2645 is given by:





COHERENT Lexicon                                           Page 7




termcap               Technical Information               termcap



     :cm=6\E&%r%2c%2Y:


The Microterm ACT-IV  needs the current position sent preceded by
a <CCttrrll-TT>, with the line and column encoded in binary:


     :cm=^T%.%.:


Terminals that use %. must be able to backspace the cursor (bbss or
bbcc) and to move the cursor  up one line on the screen (uupp).  This
is because transmitting \tt, \nn, \rr, or <ccttrrll-DD> may have undesir-
able consequences or be ignored by the system.

***** Similar Terminals *****

If your system uses two  similar terminals, one can be defined as
resembling the other, with certain exceptions.  The code tc names
the similar  terminal.  This  field must  be last in  the tteerrmmccaapp
entry, and  the combined length of the  two entries cannot exceed
1,024  characters.  Capabilities given  first over-ride  those in
the similar  terminal, and  capabilities in the  similar terminal
can be cancelled by xxxx@ where xx is the capability.  For example,
the entry


     hn|2621nl|HP 2621nl:ks@:ke@:tc=2621


defines a Hewlett-Packard 2621 terminal that does not have the ks
and ke  capabilities, and thus  cannot turn on  the function keys
when in visual mode.

***** Initialization *****

A  terminal  initialization  string  may  be  given with  the  is
capability; if the string is too long, it may be read from a file
given by the  if code.  Usually, these strings set  the tabs on a
terminal with  settable tabs.   If both is  and if are  given, is
will be  printed first to clear  the tabs, then the  tabs will be
set from the file specified by if.  The Hewlett-Packard 2626 has:


     :is=\E&j@\r\E3\r:if=/usr/lib/tabset/stdcrt:


***** Terminals Supported *****

The   following   table   lists   the  terminals   described   in
/eettcc/tteerrmmccaapp, and an abbreviated name for each.

_N_a_m_e           _T_e_r_m_i_n_a_l

aacctt55           Microterm Act V


COHERENT Lexicon                                           Page 8




termcap               Technical Information               termcap



aaddmm33aa          Lear-Siegler ADM3A
aaddmm3311          Lear-Siegler ADM31
aannssiippcc         AT COHERENT console
ccoohhiibbmm         PC COHERENT console
ddooss            DOS 3.1 ANSI.SIS
hh11551100          Hazeltine 1510
hh1199            Heathkit H-19
hh1199aa           Heathkit H-19 in ANSI
mmiimmee11          Microterm Mime1
mmiimmee22aa         Microterm Mime2a
mmiimmee33aa         Microterm Mime3a
qqvvtt110022         Qume QVT-102
qquummee55          Qume Sprint 5
ttvvii991122         Televideo 920
ttvvii992200         Televideo 920
ttvvii992255         Televideo 925
vvtt5522           DEC VT-52
vvtt110000          DEC VT-100
vvtt110000nn         DEC VT-100 without initialization
vvtt110000ss         DEC VT-100, 132 columns, 14 lines
vvtt110000ww         DEC VT-100, 132 columns, 24 lines
wwyy5500           Wyse 50

***** Files *****

/eettcc/tteerrmmccaapp

***** See Also *****

modemcap, technical information, terminal-independent operations



























COHERENT Lexicon                                           Page 9


