HP-UX Reference (11i v3 07/02) - 4 File Formats (vol 8)
t
terminfo(4) terminfo(4)
(ENHANCED CURSES)
%? c
1
%t b
1
%e c
2
%t b
2
%e c
3
%t b
3
%e c
4
%t b
4
%e b
5
%;
c
i
are conditions; b
i
are bodies.
If the "-" flag is used with "%[doxXs]", then a colon must be placed between the "%" and the "-"to
differentiate the flag from the binary "%-" operator. For example: "%:-16.16s".
Consider the Hewlett-Packard 2645, 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 rows and columns is inverted here, and that the row
and column are zero-padded as two digits. Thus, its cup capability is:
cup=\E&a%p2%2.2dc%p1%2.2dY$<6>
The Micro-Term ACT-IV needs the current row and column sent preceded by a ˆT, with the row and
column simply encoded in binary:
cup=ˆT%p1%c%p2%c
Devices that use "%c" need to be able to backspace the cursor (cub1), and to move the cursor up one line on
the screen (cuu1). This is necessary because it is not always safe to transmit \n, ˆD, and \r, as the sys-
tem may change or discard them. (The library functions dealing with terminfo set tty modes so that tabs
are never expanded, so \t is safe to send. This turns out to be essential for the Ann Arbor 4080.)
A final example is the LSI ADM-3a, which uses row and column offset by a blank character, thus:
cup=\E=%p1%’\s’%+%c%p2%’\s’%+%c
After sending "\E=", this pushes the first argument, pushes the ASCII decimal value for a space (32), adds
them (pushing the sum on the stack in place of the two previous values), and outputs that value as a char-
acter. Then the same is done for the second argument. More complex arithmetic is possible using the
stack.
Cursor Motions
If the terminal has a fast way to home the cursor (to very upper left corner of screen) then this can be given
as home; similarly a fast way of getting to the lower left-hand corner can be given as ll; this may involve
going up with cuu1 from the home position, but a program should never do this itself (unless ll does)
because it can make no assumption about the effect of moving up from the home position. Note that the
home position is the same as addressing to (0,0): to the top left corner of the screen, not of memory. (Thus,
the \EH sequence on Hewlett-Packard terminals cannot be used for home without losing some of the other
features on the terminal.)
If the device has row or column absolute-cursor addressing, these can be given as single argument capabili-
ties hpa (horizontal position absolute) and vpa (vertical position absolute). Sometimes these are shorter
than the more general two-argument sequence (as with the Hewlett-Packard 2645) and can be used in
preference to cup. If there are argumentized local motions (such as "move n spaces to the right"), these can
be given as cud, cub, cuf, and cuu with a single argument indicating how many spaces to move. These
are primarily useful if the device does not have cup, such as the Tektronix 4025.
If the device needs to be in a special mode when running a program that uses these capabilities, the codes
to enter and exit this mode can be given as smcup and rmcup. This arises, for example, from terminals,
such as the Concept, with more than one page of memory. If the device has only memory relative cursor
addressing and not screen relative cursor addressing, a one screen-sized window must be fixed into the dev-
ice for cursor addressing to work properly. This is also used for the Tektronix 4025, where smcup sets the
command character to be the one used by terminfo. If the rmcup sequence will not restore the screen
after an smcup sequence is output (to the state prior to outputting smcup), specify nrrmc.
Area Clears
If the terminal can clear from the current position to the end of the line, leaving the cursor where it is, this
should be given as el. If the terminal can clear from the beginning of the line to the current position
inclusive, leaving the cursor where it is, this should be given as el1. If the terminal can clear from the
current position to the end of the display, then this should be given as ed. ed is only defined from the
first column of a line. (Thus, it can be simulated by a request to delete a large number of lines, if a true ed
is not available.)
Insert/Delete Line
If the terminal can open a new blank line before the line where the cursor is, this should be given as il1;
this is done only from the first position of a line. The cursor must then appear on the newly blank line. If
the terminal can delete the line which the cursor is on, then this should be given as dl1; this is done only
502 Hewlett-Packard Company − 18 − HP-UX 11i Version 3: February 2007