terminfo.4 (2010 09)

t
terminfo(4) terminfo(4)
(ENHANCED CURSES)
tparm()
Argument Attribute Escape Sequence
none \E[0m
p1 standout \E[0;4;7m
p2 underline \E[0;3m
p3 reverse \E[0;4m
p4 blink \E[0;5m
p5 dim \E[0;7m
p6 bold \E[0;3;4m
p7 invis \E[0;8m
p8 protect not available
p9 altcharset ˆO (off) ˆN (on)
Note that each escape sequence requires a 0 to turn off other modes before turning on its own mode. Also
note that, as suggested above, standout is set up to be the combination of reverse and dim. Also, because
this terminal has no bold mode, bold is set up as the combination of reverse and underline. In addition, to
allow combinations, such as underline+blink, the sequence to use would be \E[0;3;5m. The terminal
doesn’t have protect mode, either, but that cannot be simulated in any way, so p8 is ignored. The
altcharset mode is different in that it is either ˆO or ˆN, depending on whether it is off or on. If all
modes were to be turned on, the sequence would be:
\E[0;3;4;5;7;8mˆN
Now look at when different sequences are output. For example, ;3 is output when either p2 or p6 is
true, that is, if either underline or bold modes are turned on. Writing out the above sequences, along
with their dependencies, gives the following:
Sequence When to Output terminfo Translation
\E[0 always \E[0
;3 if p2 or p6 %?%p2%p6%|%t;3%;
;4 if p1 or p3 or p6 %?%p1%p3%|%p6%|%t;4%;
;5 if p4 %?%p4%t;5%;
;7 if p1 or p5 %?%p1%p5%|%t;7%;
;8 if p7 %?%p7%t;8%;
m always m
^N or ˆO if p9, ˆN; else ˆO %?%p9%tˆN%eˆO%;
Putting this all together into the sgr sequence gives:
sgr=\E[0%?%p2%p6%|%t;3%;%?%p1%p3%|%p6%
|%t;4%;%?%p5%t;5%;%?%p1%p5%
|%t;7%;%?%p7%t;8%;m%?%p9%tˆN%eˆO%;,
Remember that sgr and sgr0 must always be specified.
Keypad
If the device has a keypad that transmits sequences when the keys are pressed, this information can also
be specified. Note that it is not possible to handle devices where the keypad only works in local (this
applies, for example, to the unshifted Hewlett-Packard 2621 keys). If the keypad can be set to transmit
or not transmit, specify these sequences as smkx and rmkx. Otherwise the keypad is assumed to always
transmit.
The sequences sent by the left arrow, right arrow, up arrow, down arrow, and home keys can be given as
kcub1, kcuf1, kcuu1, kcud1 and khome, respectively. If there are function keys such as f0, f1, ...,
f63, the sequences they send can be specified as kf0, kf1, ..., kf63. If the first 11 keys have labels
other than the default f0 through f10, the labels can be given as lf0, lf1, ..., lf10.
The codes transmitted by certain other special keys can be given: kll (home down), kbs (backspace),
ktbc (clear all tabs), kctab (clear the tab stop in this column), kclr (clear screen or erase key), kdch1
(delete character), kdl1 (delete line), krmir (exit insert mode), kel (clear to end of line), ked (clear to
end of screen), kich1 (insert character or enter insert mode), kil1 (insert line), knp (next page), kpp
(previous page), kind (scroll forward/down), kri (scroll backward/up), khts (set a tab stop in this
column). In addition, if the keypad has a 3 by 3 array of keys including the four arrow keys, the other
five keys can be given as ka1, ka3, kb2, kc1, and kc3. These keys are useful when the effects of a 3
by 3 directional pad are needed. Further keys are defined above in the capabilities list.
HP-UX 11i Version 3: September 2010 21 Hewlett-Packard Company 21