HP-UX Reference (11i v2 03/08) - 4 File Formats (vol 8)
t
terminfo(4) terminfo(4)
(ENHANCED CURSES)
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.
If the terminal has the ability to define a window as part of memory, which all commands affect, it should
be given as the argumentized string wind. The four arguments are the starting and ending lines in
memory and the starting and ending columns in memory, in that order.
If the terminal can retain display memory above, then the da capability should be given; if display
memory can be retained below, then db should be given. These indicate that deleting a line or scrolling
a full screen may bring nonblank lines up from below or that scrolling back with ri may bring down
nonblank lines.
Insert/Delete Character
There are two basic kinds of intelligent terminals with respect to insert/delete character operations which
can be described using terminfo. The most common insert/delete character operations affect only the
characters on the current line and shift characters off the end of the line rigidly. Other terminals, such as
the Concept 100 and the Perkin-Elmer Owl, make a distinction between typed and untyped blanks on the
screen, shifting upon an insert or delete only to an untyped blank on the screen which is either elim-
inated, or expanded to two untyped blanks. You can determine the kind of terminal you have by clearing
the screen and then typing text separated by cursor motions. Type "abc def" using local cursor motions
(not spaces) between the abc and the def. Then position the cursor before the abc and put the termi-
nal in insert mode. If typing characters causes the rest of the line to shift rigidly and characters to fall off
the end, then your terminal does not distinguish between blanks and untyped positions. If the abc shifts
over to the def which then move together around the end of the current line and onto the next as you
insert, you have the second type of terminal, and should give the capability in, which stands for "insert
null". While these are two logically separate attributes (one line versus multiline insert mode, and special
treatment of untyped spaces) we have seen no terminals whose insert mode cannot be described with the
HP-UX 11i Version 2: August 2003 − 16 − Hewlett-Packard Company Section 4−−327