HP-UX Reference (11i v3 07/02) - 4 File Formats (vol 8)

t
terminfo(4) terminfo(4)
(ENHANCED CURSES)
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 termi-
nals 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. Other-
wise, it has destructive scrolling regions. Do not specify csr if the terminal has nondestructive 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 eliminated,
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 terminal 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 treat-
ment of untyped spaces) we have seen no terminals whose insert mode cannot be described with the single
attribute.
terminfo can describe both terminals that have an insert mode and terminals which send a simple
sequence to open a blank position on the current line. Give as smir the sequence to get into insert mode.
Give as rmir the sequence to leave insert mode. Now give as ich1 any sequence needed to be sent just
before sending the character to be inserted. Most terminals with a true insert mode will not give ich1;
terminals that send a sequence to open a screen position should give it here. (If your terminal has both,
insert mode is usually preferable to ich1. Do not give both unless the terminal requires both to be used in
combination.) If post-insert padding is needed, give this as a number of milliseconds padding in ip (a
string option). Any other sequence which may need to be sent after an insert of a single character may also
be given in ip. If your terminal needs both to be placed into an "insert mode" and a special code to precede
each inserted character, then both smir/rmir and ich1 can be given, and both will be used. The ich
capability, with one argument, n, will insert n blanks.
If padding is necessary between characters typed while not in insert mode, give this as a number of mil-
liseconds padding in rmp.
It is occasionally necessary to move around while in insert mode to delete characters on the same line (for
example, if there is a tab after the insertion position). If your terminal allows motion while in insert mode
you can give the capability mir to speed up inserting in this case. Omitting mir will affect only speed.
Some terminals (notably Datamedia) must not have mir because of the way their insert mode works.
Finally, you can specify dch1 to delete a single character, dch with one argument, n, to delete n charac-
ters, and delete mode by giving smdc and rmdc to enter and exit delete mode (any mode the terminal
HP-UX 11i Version 3: February 2007 19 Hewlett-Packard Company 503