terminfo.4 (2010 09)
t
terminfo(4) terminfo(4)
(ENHANCED CURSES)
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
character. 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 capa-
bilities 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
device 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 posi-
tion 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 from the first position on the line to be deleted. Versions of il1 and dl1 which take a single
argument and insert or delete that many lines can be given as il and dl.
If the terminal has a settable destructive scrolling region (like the VT100) the command to set this can be
described with the csr capability, which takes two arguments: the top and bottom lines of the scrolling
region. The cursor position is, alas, undefined after using this command. It is possible to get the effect of
insert or delete line using this command — the sc and rc (save and restore cursor) commands are also
useful. Inserting lines at the top or bottom of the screen can also be done using ri or ind on many ter-
minals without a true insert/delete line, and is often faster even on terminals with those features.
To determine whether a terminal has destructive scrolling regions or nondestructive scrolling regions,
create a scrolling region in the middle of the screen, place data on the bottom line of the scrolling region,
move the cursor to the top line of the scrolling region, and do a reverse index (ri) followed by a delete
line (dl1) or index (ind). If the data that was originally on the bottom line of the scrolling region was
restored into the scrolling region by the dl1 or ind, then the terminal has nondestructive scrolling
regions. Otherwise, it has destructive scrolling regions. Do not specify csr if the terminal has nondes-
tructive scrolling regions, unless ind, ri, indn, rin, dl, and dl1 all simulate destructive scrolling.
18 Hewlett-Packard Company − 18 − HP-UX 11i Version 3: September 2010