Open System Services System Calls Reference Manual (G06.25+, H06.03+)
Files termcap(4)
:am:bl=ˆG:cl=ˆZ:co#80:cr=ˆM:do=ˆJ:le=ˆH:li#24:sf=ˆJ:
Parameterized Strings
Cursor addressing and other strings requiring parameters are described by a parameterized string
capability, with escape encodings like those of the printf() function (%x) in it, while other char-
acters are passed through unchanged. For example, to address the cursor, the cm capability is
given, using two parameters: the row and column to move to. Rows and columns are numbered
from 0 (zero) and refer to the physical screen visible to the user, not to any unseen memory. If
the terminal has memory-relative cursor addressing, that can be indicated by the analogous
CM
capability.
The % encodings have the following meanings:
%% Writes %
%d Writes value as printf() %d encoding does
%2 Writes value as printf() %2d encoding does
%3 Writes value as printf() %3d encoding does
%. Writes value as printf() %c encoding does
%+x Adds x to value, then writes %
%>xy If value > x then adds y (no output)
%r Reverses order of two parameters (no output)
%i Increments by 1 (one) (no output)
%n Exclusive ORs all parameters with 0140 (Datamedia 2500)
%B BCD (16*(value/10)) + (value%10) (no output)
%D Reverse coding (value - 2*(value%16)) (no output) (Delta Data terminal)
Consider the Hewlett-Packard 2645 terminal, which, to get to row 3 and column 12, needs to be
sent \E&a12c03Y padded for 6 milliseconds. Note that the order of the row and column coordi-
nates is reversed here and that the row and column are sent as 2-digit integers. Thus, its cm
capability is cm=6\E&%r%2c%2Y.
The Microterm ACT-IV terminal needs the current row and column sent simply encoded in
binary preceded by a ˆT, cm=ˆT%.%.. Terminals that use %. need to be able to backspace the
cursor (the le capability) and to move the cursor up one line on the screen (the up capability).
This is necessary because it is not always safe to transmit \n, ˆD, and \r, as the system can change
or discard them. (Applications using termcap must set terminal modes so that tabs are not
expanded, so \t is safe to send. This is essential for the Ann Arbor 4080 terminal.)
A final example is the Lear Siegler ADM-3a terminal, which offsets row and column by a blank
character; thus, cm=\E=%+ %+.
Row or column absolute cursor addressing can be given as single-parameter capabilities ch (hor-
izontal position absolute) and cv (vertical position absolute). Sometimes these are shorter than
the more general two-parameter sequence (as with the Hewlett-Packard 2645 terminal) and can
be used in preference to cm. If there are parameterized local motions (for example, move n posi-
tions to the right), these can be given as the DO, LE, RI, and UP capabilities with a single
parameter indicating how many positions to move. These capabilities are primarily useful for
terminals that do not have the cm capability, such as the Tektronix 4025 terminal.
527186-003 Hewlett-Packard Company 11−45