Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Files termcap(4)
string capability, it must be encoded as \200. (The routines that deal with termcap use C strings
and strip the high bits off the output very late, so that \200 has the same result as \000.)
In the termcap file, individual capabilities must sometimes be commented out. To do this, put a .
(dot) before the capability name. For example, see the first cr and ta capabilities in the preced-
ing example.
Basic Capabilities
The number of columns on each line of the terminal display is given by the co numeric capabil-
ity. If the display is a CRT, then the number of lines on the screen is given by the li capability. If
the display wraps around to the beginning of the next line when the cursor reaches the right mar-
gin, then indicate this with the am capability. If the terminal can clear its screen, indicate this
with the cl string capability. If the terminal overstrikes (rather than clearing the position when a
character is overwritten), indicate this with the os capability. If the terminal is a printing termi-
nal, with no soft copy unit, indicate this with both the hc and os capabilities. (os applies to
storage scope terminals, such as the Tektronix 4010 series, as well as to hard-copy and APL ter-
minals.) If there is a code to move the cursor to the left edge of the current row, indicate this with
the cr capability. (Normally this is carriage return, ˆM.) If there is a code to produce an audible
signal (bell, beep, and so forth), indicate this with the bl capability.
If there is a code (such as a backspace) to move the cursor one position to the left, indicate this
with the le capability. Similarly, codes to move to the right, up, and down should be indicated
with the nd, up, and do capabilities, respectively. These local cursor motions should not alter the
text they pass over; for example, you would not normally use nd= unless the terminal has the os
capability, because the space would erase the character moved over.
Note that the local cursor motions encoded in termcap have undefined behavior at the left and
top edges of a CRT display. Applications should never attempt to backspace around the left
edge, unless bw is given, and never attempt to go up off the top using local cursor motions.
To scroll text up, an application goes to the bottom left corner of the screen and sends the string
given by the sf (index) capability. To scroll text down, an application goes to the top left corner
of the screen and sends the string given by the sr (reverse index) capability. The strings given by
sf and sr have undefined behavior when not on their respective corners of the screen. Parameter-
ized versions of the scrolling sequences are the SF and SR capabilities, which have the same
semantics as sf and sr except that they take one parameter and scroll that many lines. They also
have undefined behavior except at the appropriate corner of the screen.
The am capability
indicates whether the cursor sticks at the right edge of the screen when text is
output there, but this action does not necessarily apply to the action of the nd capability from the
last column. Leftward local motion is defined from the left edge only when the bw capability is
given; then the action of the le capability from the left edge moves to the right edge of the previ-
ous row. This is useful for drawing a box around the edge of the screen, for example. If the ter-
minal has switch-selectable automatic margins, the termcap description usually assumes that
this feature is on (that is, assumes the am capability). If the terminal has a command that moves
to the first column of the next line, that command can be given as the nw (newline) capability. It
is permissible for this action to clear the remainder of the current line, so if the terminal has no
correctly working CR and LF, it is still possible to create a working nw capability out of one or
both of them.
These capabilities suffice to describe hard-copy and "glass-tty" terminals. Thus, the Teletype
model 33 is described as follows:
T3 |tty33 | 33 |tty | Teletype model 33:\
:bl=ˆG:co#72:cr=ˆM:do=ˆJ:hc:os:
and the Lear Siegler ADM-3 terminal is described as follows:
l3|adm3|3|LSIADM-3:\
527186-023 Hewlett-Packard Company 11−57