HP-UX Reference (11i v2 03/08) - 4 File Formats (vol 8)
t
terminfo(4) terminfo(4)
(ENHANCED CURSES)
uses the XON/XOFF flow-control protocol, specify xon.
If there is a way to move the cursor one position to the left (such as backspace), that capability should be
given as cub1. Similarly, sequences to move to the right, up, and down should be given as cuf1, cuu1,
and cud1, respectively. These local cursor motions must not alter the text they pass over; for example,
you would not normally use "cuf1=\s" because the space would erase the character moved over.
A very important point here is that the local cursor motions encoded in terminfo are undefined at the
left and top edges of a screen terminal. Programs should never attempt to backspace around the left
edge, unless bw is specified, and should never attempt to go up locally off the top. To scroll text up, a pro-
gram goes to the bottom left corner of the screen and sends the ind (index) string. To scroll text down, a
program goes to the top left corner of the screen and sends the ri (reverse index) string. The strings
ind and ri are undefined when not on their respective corners of the screen.
Parameterized versions of the scrolling sequences are indn and rin. These versions have the same
semantics as ind and ri, except that they take one argument and scroll the number of lines specified by
that argument. They are also undefined except at the appropriate edge of the screen.
The am capability tells whether the cursor sticks at the right edge of the screen when text is output, but
this does not necessarily apply to a cuf1 from the last column. Backward motion from the left edge of
the screen is possible only when bw is specified. In this case, cub1 will move to the right edge of the
previous row. If bw is not given, the effect is undefined. This is useful for drawing a box around the edge
of the screen, for example. If the device has switch-selectable automatic margins, am should be specified
in the terminfo source file. In this case, initialization strings should turn on this option, if possible. If
the device has a command that moves to the first column of the next line, that command can be given as
nel (newline). It does not matter if the command clears the remainder of the current line, so if the device
has no cr and lf it may still be possible to craft a working nel out of one or both of them.
These capabilities suffice to describe hardcopy and screen terminals. Thus the AT&T 5320 hardcopy ter-
minal is described as follows:
5320|att5320|AT&T 5320 hardcopy terminal,
am, hc, os,
cols#132,
bel=ˆG, cr=\r, cub1=\b, cnd1=\n,
dch1=\E[P, dl1=\E[M,
ind=\n,
while the Lear Siegler ADM-3 is described as
adm3|lsi adm3,
am, bel=ˆG, clear=ˆZ, cols#80, cr=ˆM, cub1=ˆH,
cud1=ˆJ, ind=ˆJ, lines#24,
Parameterized Strings
Cursor addressing and other strings requiring arguments are described by a argumentized string capabil-
ity with escapes in a form (%x) comparable to printf() (see printf (1)). For example, to address the cur-
sor, the cup capability is given, using two arguments: the row and column to address to. (Rows and
columns are numbered from 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 mrcup.
The argument mechanism uses a stack and special "%" codes to manipulate the stack in the manner of
Reverse Polish Notation (postfix). Typically a sequence pushes one of the arguments onto the stack and
then prints it in some format. Often more complex operations are necessary. Operations are in postfix
form with the operands in the usual order. That is, to subtract 5 from the first argument, one would use
%p1%{5}%-.
The "%" encodings have the following meanings:
%% Outputs "%".
% [[: ] flags ][width [ .precision ]][doxXs ]
As in printf(); flags are [-+#] and space.
%c Print pop() gives %c.
%p[1-9] Push the ith argument.
%P[a-z] Set dynamic variable [a-z] to pop().
HP-UX 11i Version 2: August 2003 − 14 − Hewlett-Packard Company Section 4−−325