|
Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!
File Formats terminfo(4)
NAME
terminfo - terminal and printer capability database
SYNOPSIS
/usr/share/lib/terminfo/?/*
DESCRIPTION
The terminfo database describes the capabilities of devices
such as terminals and printers. Devices are described in
terminfo source files by specifying a set of capabilities,
by quantifying certain aspects of the device, and by speci-
fying character sequences that affect particular results.
This database is often used by screen oriented applications
such as vi and curses-based programs, as well as by some
system commands such as ls and more. This usage allows them
to work with a variety of devices without changes to the
programs.
terminfo descriptions are located in the directory pointed
to by the environment variable TERMINFO or in
/usr/share/lib/terminfo. terminfo descriptions are generated
by tic(1M).
terminfo source files consist of one or more device descrip-
tions. Each description consists of a header (beginning in
column 1) and one or more lines that list the features for
that particular device. Every line in a terminfo source file
must end in a comma (,). Every line in a terminfo source
file except the header must be indented with one or more
white spaces (either spaces or tabs).
Entries in terminfo source files consist of a number of
comma-separated fields. White space after each comma is
ignored. Embedded commas must be escaped by using a
backslash. Each device entry has the following format:
alias1 | alias2 | ... | aliasn | fullname,
capability1, capability2,
.
.
.
capabilityn,
The first line, commonly referred to as the header line,
must begin in column one and must contain at least two
aliases separated by vertical bars. The last field in the
header line must be the long name of the device and it may
contain any string. Alias names must be unique in the ter-
minfo database and they must conform to system file naming
conventions. See tic(1M). They cannot, for example, contain
white space or slashes.
SunOS 5.10 Last change: 9 Jul 1996 1
File Formats terminfo(4)
Every device must be assigned a name, such as "vt100". Dev-
ice names (except the long name) should be chosen using the
following conventions. The name should not contain hyphens
because hyphens are reserved for use when adding suffixes
that indicate special modes.
These special modes may be modes that the hardware can be
in, or user preferences. To assign a special mode to a par-
ticular device, append a suffix consisting of a hyphen and
an indicator of the mode to the device name. For example,
the -w suffix means "wide mode". When specified, it allows
for a width of 132 columns instead of the standard 80
columns. Therefore, if you want to use a "vt100" device set
to wide mode, name the device "vt100-w". Use the following
suffixes where possible.
Suffix Meaning Example
-w Wide mode (more than 80 columns) 5410-w
-am With auto. margins (usually vt100-am
default)
-nam Without automatic margins vt100-nam
-n Number of lines on the screen 2300-40
-na No arrow keys (leave them in local) c100-na
-np Number of pages of memory c100-4p
-rv Reverse video 4415-rv
The terminfo reference manual page is organized in two sec-
tions:
o PART 1: DEVICE CAPABILITIES
o PART 2: PRINTER CAPABILITIES
PART 1: DEVICE CAPABILITIES
Capabilities in terminfo are of three types: Boolean capa-
bilities (which show that a device has or does not have a
particular feature), numeric capabilities (which quantify
particular features of a device), and string capabilities
(which provide sequences that can be used to perform partic-
ular operations on devices).
In the following table, a Variable is the name by which a C
programmer accesses a capability (at the terminfo level). A
Capname is the short name for a capability specified in the
terminfo source file. It is used by a person updating the
source file and by the tput command. A Termcap Code is a
two-letter sequence that corresponds to the termcap capabil-
ity name. (Note that termcap is no longer supported.)
SunOS 5.10 Last change: 9 Jul 1996 2
File Formats terminfo(4)
Capability names have no real length limit, but an informal
limit of five characters has been adopted to keep them
short. Whenever possible, capability names are chosen to be
the same as or similar to those specified by the ANSI
X3.64-1979 standard. Semantics are also intended to match
those of the ANSI standard.
All string capabilities listed below may have padding speci-
fied, with the exception of those used for input. Input
capabilities, listed under the Strings section in the fol-
lowing tables, have names beginning with key_. The #i symbol
in the description field of the following tables refers to
the ith parameter.
Booleans
________________________________________________________________
Cap- Termcap
Variable name Code Description
________________________________________________________________
auto_left_margin bw bw cub1 wraps from column 0 to
last column
auto_right_margin am am Terminal has automatic margins
back_color_erase bce be Screen erased with background
color
can_change ccc cc Terminal can re-define existing
color
ceol_standout_glitch xhp xs Standout not erased by
overwriting (hp)
col_addr_glitch xhpa YA Only positive motion
for hpa/mhpa caps
cpi_changes_res cpix YF Changing character pitch
changes resolution
cr_cancels_micro_mode crxm YB Using cr turns off micro mode
dest_tabs_magic_smso xt xt Destructive tabs, magic
smso char (t1061)
eat_newline_glitch xenl xn Newline ignored after
80 columns (Concept)
erase_overstrike eo eo Can erase overstrikes with a
blank
generic_type gn gn Generic line type
(for example, dialup, switch)
hard_copy hc hc Hardcopy terminal
hard_cursor chts HC Cursor is hard to see
has_meta_key km km Has a meta key (shift,
sets parity bit)
has_print_wheel daisy YC Printer needs operator
to change character set
has_status_line hs hs Has extra "status line"
hue_lightness_saturation hls hl Terminal uses only HLS
color notation (Tektronix)
insert_null_glitch in in Insert mode distinguishes nulls
SunOS 5.10 Last change: 9 Jul 1996 3
File Formats terminfo(4)
lpi_changes_res lpix YG Changing line pitch
changes resolution
memory_above da da Display may be retained
above the screen
memory_below db db Display may be retained
below the screen
move_insert_mode mir mi Safe to move while in insert
mode
move_standout_mode msgr ms Safe to move in standout modes
needs_xon_xoff nxon nx Padding won't work,
xon/xoff required
no_esc_ctlc xsb xb Beehive (f1=escape, f2=ctrl C)
no_pad_char npc NP Pad character doesn't exist
non_dest_scroll_region ndscr ND Scrolling region
is nondestructive
non_rev_rmcup nrrmc NR smcup does not reverse rmcup
over_strike os os Terminal overstrikes
on hard-copy terminal
prtr_silent mc5i 5i Printer won't echo on screen
row_addr_glitch xvpa YD Only positive motion
for vpa/mvpa caps
semi_auto_right_margin sam YE Printing in last column causes
cr
status_line_esc_ok eslok es Escape can be used on
the status line
tilde_glitch hz hz Hazeltine; can't print tilde (~)
transparent_underline ul ul Underline character overstrikes
xon_xoff xon xo Terminal uses xon/xoff
handshaking
Numbers
________________________________________________________________
Cap- Termcap
Variable name Code Description
________________________________________________________________
bit_image_entwining bitwin Yo Number of passes for each
bit-map row
bit_image_type bitype Yp Type of bit image device
buffer_capacity bufsz Ya Number of bytes buffered
before printing
buttons btns BT Number of buttons on the mouse
columns cols co Number of columns in a line
dot_horz_spacing spinh Yc Spacing of dots horizontally
in dots per inch
dot_vert_spacing spinv Yb Spacing of pins vertically
in pins per inch
init_tabs it it Tabs initially every # spaces
label_height lh lh Number of rows in each label
label_width lw lw Number of columns in each label
lines lines li Number of lines on a screen or
a page
SunOS 5.10 Last change: 9 Jul 1996 4
File Formats terminfo(4)
lines_of_memory lm lm Lines of memory if > lines;
0 means varies
max_attributes ma ma Maximum combined video attributes
terminal can display
magic_cookie_glitch xmc sg Number of blank characters
left by smso or rmso
max_colors colors Co Maximum number of colors
on the screen
max_micro_address maddr Yd Maximum value in
micro_..._address
max_micro_jump mjump Ye Maximum value in parm_..._micro
max_pairs pairs pa Maximum number of
color-pairs on the screen
maximum_windows Wnum MW Maximum number of definable windows
micro_char_size mcs Yf Character step size when
in micro mode
micro_line_size mls Yg Line step size when in micro mode
no_color_video ncv NC Video attributes that
can't be used with colors
num_labels nlab Nl Number of labels on screen
number_of_pins npins Yh Number of pins in print-head
output_res_char orc Yi Horizontal resolution in
units per character
output_res_line orl Yj Vertical resolution in units per
line
output_res_horz_inch orhi Yk Horizontal resolution in
units per inch
output_res_vert_inch orvi Yl Vertical resolution in
units per inch
padding_baud_rate pb pb Lowest baud rate
print_rate cps Ym Print rate in characters per second
where padding needed
virtual_terminal vt vt Virtual terminal number (system)
wide_char_size widcs Yn Character step size when
in double wide mode
width_status_line wsl ws Number of columns in status line
Strings
________________________________________________________________
Cap- Termcap
Variable name Code Description
________________________________________________________________
acs_chars acsc ac Graphic charset pairs aAbBcC
alt_scancode_esc scesa S8 Alternate escape for
scancode emulation
(default is for vt100)
back_tab cbt bt Back tab
bell bel bl Audible signal (bell)
bit_image_carriage_return bicr Yv Move to beginning of
same row (use tparm)
bit_image_newline binel Zz Move to next row of
SunOS 5.10 Last change: 9 Jul 1996 5
File Formats terminfo(4)
the bit image (use tparm)
bit_image_repeat birep Zy Repeat bit-image cell
#1 #2 times (use tparm)
carriage_return cr cr Carriage return
change_char_pitch cpi ZA Change number of
characters per inch
change_line_pitch lpi ZB Change number of lines per inch
change_res_horz chr ZC Change horizontal resolution
change_res_vert cvr ZD Change vertical resolution
change_scroll_region csr cs Change to lines #1
through #2 (vt100)
char_padding rmp rP Like ip but when in replace
mode
char_set_names csnm Zy List of character set names
clear_all_tabs tbc ct Clear all tab stops
clear_margins mgc MC Clear all margins
(top, bottom, and sides)
clear_screen clear cl Clear screen and home cursor
clr_bol el1 cb Clear to beginning of
line, inclusive
clr_eol el ce Clear to end of line
clr_eos ed cd Clear to end of display
code_set_init csin ci Init sequence
for multiple codesets
color_names colornm Yw Give name for color #1
column_address hpa ch Horizontal position
command_character cmdch CC Terminal settable cmd
character in prototype
create_window cwin CW Define win #1 to go
from #2,#3to #4,#5
cursor_address cup cm Move to row #1 col #2
cursor_down cud1 do Down one line
cursor_home home ho Home cursor (if no cup)
cursor_invisible civis vi Make cursor invisible
cursor_left cub1 le Move left one space.
cursor_mem_address mrcup CM Memory relative cursor
addressing
cursor_normal cnorm ve Make cursor appear
normal (undo vs/vi)
cursor_right cuf1 nd Non-destructive space
(cursor or carriage right)
cursor_to_ll ll ll Last line, first
column (if no cup)
cursor_up cuu1 up Upline (cursor up)
cursor_visible cvvis vs Make cursor very visible
define_bit_image_region defbi Yx Define rectangular bit-
image region (use tparm)
define_char defc ZE Define a character in
a character set
delete_character dch1 dc Delete character
delete_line dl1 dl Delete line
device_type devt dv Indicate language/
SunOS 5.10 Last change: 9 Jul 1996 6
File Formats terminfo(4)
codeset support
dial_phone dial DI Dial phone number #1
dis_status_line dsl ds Disable status line
display_clock dclk DK Display time-of-day clock
display_pc_char dispc S1 Display PC character
down_half_line hd hd Half-line down (forward
1/2 linefeed)
ena_acs enacs eA Enable alternate character set
end_bit_image_region endbi Yy End a bit-image region
(use tparm)
enter_alt_charset_mode smacs as Start alternate character set
enter_am_mode smam SA Turn on automatic margins
enter_blink_mode blink mb Turn on blinking
enter_bold_mode bold md Turn on bold (extra
bright) mode
enter_ca_mode smcup ti String to begin programs
that use cup
enter_delete_mode smdc dm Delete mode (enter)
enter_dim_mode dim mh Turn on half-bright mode
enter_doublewide_mode swidm ZF Enable double wide printing
enter_draft_quality sdrfq ZG Set draft quality print mode
enter_insert_mode smir im Insert mode (enter)
enter_italics_mode sitm ZH Enable italics
enter_leftward_mode slm ZI Enable leftward carriage
motion
enter_micro_mode smicm ZJ Enable micro motion
capabilities
enter_near_letter_quality snlq ZK Set near-letter quality print
enter_normal_quality snrmq ZL Set normal quality
enter_pc_charset_mode smpch S2 Enter PC character display mode
enter_protected_mode prot mp Turn on protected mode
enter_reverse_mode rev mr Turn on reverse video mode
enter_scancode_mode smsc S4 Enter PC scancode mode
enter_scancode_mode smsc S4 Enter PC scancode mode
enter_secure_mode invis mk Turn on blank mode
(characters invisible)
enter_shadow_mode sshm ZM Enable shadow printing
enter_standout_mode smso so Begin standout mode
enter_subscript_mode ssubm ZN Enable subscript printing
enter_superscript_mode ssupm ZO Enable superscript printing
enter_underline_mode smul us Start underscore mode
enter_upward_mode sum ZP Enable upward carriage motion
mode
enter_xon_mode smxon SX Turn on xon/xoff handshaking
erase_chars ech ec Erase #1 characters
exit_alt_charset_mode rmacs ae End alternate character set
exit_am_mode rmam RA Turn off automatic margins
exit_attribute_mode sgr0 me Turn off all attributes
exit_ca_mode rmcup te String to end programs
that use cup
exit_delete_mode rmdc ed End delete mode
exit_doublewide_mode rwidm ZQ Disable double wide printing
SunOS 5.10 Last change: 9 Jul 1996 7
File Formats terminfo(4)
exit_insert_mode rmir ei End insert mode
exit_italics_mode ritm ZR Disable italics
exit_leftward_mode rlm ZS Enable rightward (normal)
carriage motion
exit_micro_mode rmicm ZT Disable micro motion
capabilities
exit_pc_charset_mode rmpch S3 Disable PC character
display mode
exit_scancode_mode rmsc S5 Disable PC scancode mode
exit_shadow_mode rshm ZU Disable shadow printing
exit_standout_mode rmso se End standout mode
exit_subscript_mode rsubm ZV Disable subscript printing
exit_superscript_mode rsupm ZW Disable superscript printing
exit_underline_mode rmul ue End underscore mode
exit_upward_mode rum ZX Enable downward (normal)
carriage motion
exit_xon_mode rmxon RX Turn off xon/xoff handshaking
fixed_pause pause PA Pause for 2-3 seconds
flash_hook hook fh Flash the switch hook
flash_screen flash vb Visible bell (may
not move cursor)
form_feed ff ff Hardcopy terminal page eject
from_status_line fsl fs Return from status line
get_mouse getm Gm Curses should get button events
goto_window wingo WG Go to window #1
hangup hup HU Hang-up phone
init_1string is1 i1 Terminal or printer
initialization string
init_2string is2 is Terminal or printer
initialization string
init_3string is3 i3 Terminal or printer
initialization string
init_file if if Name of initialization file
init_prog iprog iP Path name of program
for initialization
initialize_color initc Ic Initialize the
definition of color
initialize_pair initp Ip Initialize color-pair
insert_character ich1 ic Insert character
insert_line il1 al Add new blank line
insert_padding ip ip Insert pad after
character inserted
key_Strings
The ``key_'' strings are sent by specific keys. The ``key_''
descriptions include the macro, defined in <curses.h>, for
the code returned by the curses routine getch when the key
is pressed (see curs_getch(3CURSES)).
________________________________________________________________
Cap- Termcap
Variable name Code Description
SunOS 5.10 Last change: 9 Jul 1996 8
File Formats terminfo(4)
________________________________________________________________
key_a1 ka1 K1 KEY_A1, upper left of keypad
key_a3 ka3 K3 KEY_A3, upper right of keypad
key_b2 kb2 K2 KEY_B2, center of keypad
key_backspace kbs kb KEY_BACKSPACE, sent by
backspace key
key_beg kbeg @1 KEY_BEG, sent by beg(inning) key
key_btab kcbt kB KEY_BTAB, sent by back-tab key
key_c1 kc1 K4 KEY_C1, lower left of keypad
key_c3 kc3 K5 KEY_C3, lower right of keypad
key_cancel kcan @2 KEY_CANCEL, sent by cancel key
key_catab ktbc ka KEY_CATAB, sent by
clear-all-tabs key
key_clear kclr kC KEY_CLEAR, sent by
clear-screen or erase key
key_close kclo @3 KEY_CLOSE, sent by close key
key_command kcmd @4 KEY_COMMAND, sent by
cmd (command) key
key_copy kcpy @5 KEY_COPY, sent by copy key
key_create kcrt @6 KEY_CREATE, sent by create key
key_ctab kctab kt KEY_CTAB, sent by clear-tab key
key_dc kdch1 kD KEY_DC, sent by delete-character
key
key_dl kdl1 kL KEY_DL, sent by delete-line key
key_down kcud1 kd KEY_DOWN, sent by terminal
down-arrow key
key_eic krmir kM KEY_EIC, sent by rmir or smir in
insert mode
key_end kend @7 KEY_END, sent by end key
key_enter kent @8 KEY_ENTER, sent by enter/send
key
key_eol kel kE KEY_EOL, sent by
clear-to-end-of-line key
key_eos ked kS KEY_EOS, sent by
clear-to-end-of-screen key
key_exit kext @9 KEY_EXIT, sent by exit key
key_f0 kf0 k0 KEY_F(0), sent by function key f0
key_f1 kf1 k1 KEY_F(1), sent by function key f1
key_f2 kf2 k2 KEY_F(2), sent by function key f2
key_f3 kf3 k3 KEY_F(3), sent by function key f3
key_fB kf4 k4 KEY_F(4), sent by function key fB
key_f5 kf5 k5 KEY_F(5), sent by function key f5
key_f6 kf6 k6 KEY_F(6), sent by function key f6
key_f7 kf7 k7 KEY_F(7), sent by function key f7
key_f8 kf8 k8 KEY_F(8), sent by function key f8
key_f9 kf9 k9 KEY_F(9), sent by function key f9
key_f10 kf10 k; KEY_F(10), sent by function key
f10
key_f11 kf11 F1 KEY_F(11), sent by function key
f11
SunOS 5.10 Last change: 9 Jul 1996 9
File Formats terminfo(4)
key_f12 kf12 F2 KEY_F(12), sent by function key
f12
key_f13 kf13 F3 KEY_F(13), sent by function key
f13
key_f14 kf14 F4 KEY_F(14), sent by function key
f14
key_f15 kf15 F5 KEY_F(15), sent by function key
f15
key_f16 kf16 F6 KEY_F(16), sent by function key
f16
key_f17 kf17 F7 KEY_F(17), sent by function key
f17
key_f18 kf18 F8 KEY_F(18), sent by function key
f18
key_f19 kf19 F9 KEY_F(19), sent by function key
f19
key_f20 kf20 FA KEY_F(20), sent by function key
f20
key_f21 kf21 FB KEY_F(21), sent by function key
f21
key_f22 kf22 FC KEY_F(22), sent by function key
f22
key_f23 kf23 FD KEY_F(23), sent by function key
f23
key_f24 kf24 FE KEY_F(24), sent by function key
f24
key_f25 kf25 FF KEY_F(25), sent by function key
f25
key_f26 kf26 FG KEY_F(26), sent by function key
f26
key_f27 kf27 FH KEY_F(27), sent by function key
f27
key_f28 kf28 FI KEY_F(28), sent by function key
f28
key_f29 kf29 FJ KEY_F(29), sent by function key
f29
key_f30 kf30 FK KEY_F(30), sent by function key
f30
key_f31 kf31 FL KEY_F(31), sent by function key
f31
key_f32 kf32 FM KEY_F(32), sent by function key
f32
key_f33 kf33 FN KEY_F(13), sent by function key
f13
key_f34 kf34 FO KEY_F(34), sent by function key
f34
key_f35 kf35 FP KEY_F(35), sent by function key
f35
key_f36 kf36 FQ KEY_F(36), sent by function key
f36
key_f37 kf37 FR KEY_F(37), sent by function key
f37
SunOS 5.10 Last change: 9 Jul 1996 10
File Formats terminfo(4)
key_f38 kf38 FS KEY_F(38), sent by function key
f38
key_f39 kf39 FT KEY_F(39), sent by function key
f39
key_fB0 kf40 FU KEY_F(40), sent by function key
fB0
key_fB1 kf41 FV KEY_F(41), sent by function key
fB1
key_fB2 kf42 FW KEY_F(42), sent by function key
fB2
key_fB3 kf43 FX KEY_F(43), sent by function key
fB3
key_fB4 kf44 FY KEY_F(44), sent by function key
fB4
key_fB5 kf45 FZ KEY_F(45), sent by function key
fB5
key_fB6 kf46 Fa KEY_F(46), sent by function key
fB6
key_fB7 kf47 Fb KEY_F(47), sent by function key
fB7
key_fB8 kf48 Fc KEY_F(48), sent by function key
fB8
key_fB9 kf49 Fd KEY_F(49), sent by function key
fB9
key_f50 kf50 Fe KEY_F(50), sent by function key
f50
key_f51 kf51 Ff KEY_F(51), sent by function key
f51
key_f52 kf52 Fg KEY_F(52), sent by function key
f52
key_f53 kf53 Fh KEY_F(53), sent by function key
f53
key_f54 kf54 Fi KEY_F(54), sent by function key
f54
key_f55 kf55 Fj KEY_F(55), sent by function key
f55
key_f56 kf56 Fk KEY_F(56), sent by function key
f56
key_f57 kf57 Fl KEY_F(57), sent by function key
f57
key_f58 kf58 Fm KEY_F(58), sent by function key
f58
key_f59 kf59 Fn KEY_F(59), sent by function key
f59
key_f60 kf60 Fo KEY_F(60), sent by function key
f60
key_f61 kf61 Fp KEY_F(61), sent by function key
f61
key_f62 kf62 Fq KEY_F(62), sent by function key
f62
key_f63 kf63 Fr KEY_F(63), sent by function key
f63
SunOS 5.10 Last change: 9 Jul 1996 11
File Formats terminfo(4)
key_find kfnd @0 KEY_FIND, sent by find key
key_help khlp %1 KEY_HELP, sent by help key
key_home khome kh KEY_HOME, sent by home key
key_ic kich1 kI KEY_IC, sent by ins-char/enter
ins-mode key
key_il kil1 kA KEY_IL, sent by insert-line key
key_left kcub1 kl KEY_LEFT, sent by
terminal left-arrow key
key_ll kll kH KEY_LL, sent by home-down key
key_mark kmrk %2 KEY_MARK, sent by
key_message kmsg %3 KEY_MESSAGE, sent by message key
key_mouse kmous Km 0631, Mouse event has occured
key_move kmov %4 KEY_MOVE, sent by move key
key_next knxt %5 KEY_NEXT, sent by next-object
key
key_npage knp kN KEY_NPAGE, sent by next-page
key
key_open kopn %6 KEY_OPEN, sent by open key
key_options kopt %7 KEY_OPTIONS, sent by options
key
key_ppage kpp kP KEY_PPAGE, sent by
previous-page key
key_previous kprv %8 KEY_PREVIOUS, sent by
previous-object key
key_print kprt %9 KEY_PRINT, sent by
print or copy key
key_redo krdo %0 KEY_REDO, sent by redo key
key_reference kref &1 KEY_REFERENCE, sent by
reference key
key_refresh krfr &2 KEY_REFRESH, sent by
refresh key
key_replace krpl &3 KEY_REPLACE, sent by
replace key
key_restart krst &4 KEY_RESTART, sent by
restart key
key_resume kres &5 KEY_RESUME, sent by resume key
key_right kcuf1 kr KEY_RIGHT, sent by terminal
right-arrow key
key_save ksav &6 KEY_SAVE, sent by save key
key_sbeg kBEG &9 KEY_SBEG, sent by
shifted beginning key
key_scancel kCAN &0 KEY_SCANCEL, sent by
shifted cancel key
key_scommand kCMD *1 KEY_SCOMMAND, sent by
shifted command key
key_scopy kCPY *2 KEY_SCOPY, sent by
shifted copy key
key_screate kCRT *3 KEY_SCREATE, sent by
shifted create key
key_sdc kDC *4 KEY_SDC, sent by
shifted delete-char key
key_sdl kDL *5 KEY_SDL, sent by
SunOS 5.10 Last change: 9 Jul 1996 12
File Formats terminfo(4)
shifted delete-line key
key_select kslt *6 KEY_SELECT, sent by
select key
key_send kEND *7 KEY_SEND, sent by
shifted end key
key_seol kEOL *8 KEY_SEOL, sent by
shifted clear-line key
key_sexit kEXT *9 KEY_SEXIT, sent by
shifted exit key
key_sf kind kF KEY_SF, sent by
scroll-forward/down key
key_sfind kFND *0 KEY_SFIND, sent by
shifted find key
key_shelp kHLP #1 KEY_SHELP, sent by
shifted help key
key_shome kHOM #2 KEY_SHOME, sent by
shifted home key
key_sic kIC #3 KEY_SIC, sent by
shifted input key
key_sleft kLFT #4 KEY_SLEFT, sent by
shifted left-arrow key
key_smessage kMSG %a KEY_SMESSAGE, sent by
shifted message key
key_smove kMOV %b KEY_SMOVE, sent by
shifted move key
key_snext kNXT %c KEY_SNEXT, sent by
shifted next key
key_soptions kOPT %d KEY_SOPTIONS, sent by
shifted options key
key_sprevious kPRV %e KEY_SPREVIOUS, sent by
shifted prev key
key_sprint kPRT %f KEY_SPRINT, sent by
shifted print key
key_sr kri kR KEY_SR, sent by
scroll-backward/up key
key_sredo kRDO %g KEY_SREDO, sent by
shifted redo key
key_sreplace kRPL %h KEY_SREPLACE, sent by
shifted replace key
key_sright kRIT %i KEY_SRIGHT, sent by shifted
right-arrow key
key_srsume kRES %j KEY_SRSUME, sent by
shifted resume key
key_ssave kSAV !1 KEY_SSAVE, sent by
shifted save key
key_ssuspend kSPD !2 KEY_SSUSPEND, sent by
shifted suspend key
key_stab khts kT KEY_STAB, sent by
set-tab key
key_sundo kUND !3 KEY_SUNDO, sent by
shifted undo key
key_suspend kspd &7 KEY_SUSPEND, sent by
SunOS 5.10 Last change: 9 Jul 1996 13
File Formats terminfo(4)
suspend key
key_undo kund &8 KEY_UNDO, sent by undo key
key_up kcuu1 ku KEY_UP, sent by
terminal up-arrow key
keypad_local rmkx ke Out of
``keypad-transmit'' mode
keypad_xmit smkx ks Put terminal in
``keypad-transmit'' mode
lab_f0 lf0 l0 Labels on function key
f0 if not f0
lab_f1 lf1 l1 Labels on function key
f1 if not f1
lab_f2 lf2 l2 Labels on function key
f2 if not f2
lab_f3 lf3 l3 Labels on function key
f3 if not f3
lab_fB lfB l4 Labels on function key
fB if not fB
lab_f5 lf5 l5 Labels on function key
f5 if not f5
lab_f6 lf6 l6 Labels on function key
f6 if not f6
lab_f7 lf7 l7 Labels on function key
f7 if not f7
lab_f8 lf8 l8 Labels on function key
f8 if not f8
lab_f9 lf9 l9 Labels on function key
f9 if not f9
lab_f10 lf10 la Labels on function key
f10 if not f10
label_format fln Lf Label format
label_off rmln LF Turn off soft labels
label_on smln LO Turn on soft labels
meta_off rmm mo Turn off "meta mode"
meta_on smm mm Turn on "meta mode" (8th bit)
micro_column_address mhpa ZY Like column_address
for micro adjustment
micro_down mcud1 ZZ Like cursor_down
for micro adjustment
micro_left mcub1 Za Like cursor_left
for micro adjustment
micro_right mcuf1 Zb Like cursor_right
for micro adjustment
micro_row_address mvpa Zc Like row_address
for micro adjustment
micro_up mcuu1 Zd Like cursor_up
for micro adjustment
mouse_info minfo Mi Mouse status information
newline nel nw Newline (behaves like
cr followed by lf)
order_of_pins porder Ze Matches software bits
to print-head pins
SunOS 5.10 Last change: 9 Jul 1996 14
File Formats terminfo(4)
orig_colors oc oc Set all color(-pair)s
to the original ones
orig_pair op op Set default color-pair
to the original one
pad_char pad pc Pad character (rather than null)
parm_dch dch DC Delete #1 chars
parm_delete_line dl DL Delete #1 lines
parm_down_cursor cud DO Move down #1 lines
parm_down_micro mcud Zf Like parm_down_cursor
for micro adjust
parm_ich ich IC Insert #1 blank chars
parm_index indn SF Scroll forward #1 lines
parm_insert_line il AL Add #1 new blank lines
parm_left_cursor cub LE Move cursor left #1 spaces
parm_left_micro mcub Zg Like parm_left_cursor
for micro adjust
parm_right_cursor cuf RI Move right #1 spaces
parm_right_micro mcuf Zh Like parm_right_cursor
for micro adjust
parm_rindex rin SR Scroll backward #1 lines
parm_up_cursor cuu UP Move cursor up #1 lines
parm_up_micro mcuu Zi Like parm_up_cursor
for micro adjust
pc_term_options pctrm S6 PC terminal options
pkey_key pfkey pk Prog funct key #1 to
type string #2
pkey_local pfloc pl Prog funct key #1 to
execute string #2
pkey_plab pfxl xl Prog key #1 to xmit
string #2 and show string #3
pkey_xmit pfx px Prog funct key #1 to
xmit string #2
plab_norm pln pn Prog label #1 to show
string #2
print_screen mc0 ps Print contents of the screen
prtr_non mc5p pO Turn on the printer for #1 bytes
prtr_off mc4 pf Turn off the printer
prtr_on mc5 po Turn on the printer
pulse pulse PU Select pulse dialing
quick_dial qdial QD Dial phone number #1, without
progress detection
remove_clock rmclk RC Remove time-of-day clock
repeat_char rep rp Repeat char #1 #2 times
req_for_input rfi RF Send next input char (for ptys)
req_mouse_pos reqmp RQ Request mouse position report
reset_1string rs1 r1 Reset terminal completely to
sane modes
reset_2string rs2 r2 Reset terminal completely to
sane modes
reset_3string rs3 r3 Reset terminal completely to
sane modes
reset_file rf rf Name of file containing
SunOS 5.10 Last change: 9 Jul 1996 15
File Formats terminfo(4)
reset string
restore_cursor rc rc Restore cursor to
position of last sc
row_address vpa cv Vertical position absolute
save_cursor sc sc Save cursor position
scancode_escape scesc S7 Escape for scancode emulation
scroll_forward ind sf Scroll text up
scroll_reverse ri sr Scroll text down
select_char_set scs Zj Select character set
set0_des_seq s0ds s0 Shift into codeset 0
(EUC set 0, ASCII)
set1_des_seq s1ds s1 Shift into codeset 1
set2_des_seq s2ds s2 Shift into codeset 2
set3_des_seq s3ds s3 Shift into codeset 3
attributes #1-#6
set_a_background setab AB Set background color
using ANSI escape
set_a_foreground setaf AF Set foreground color
using ANSI escape
set_attributes sgr sa Define the video
attributes #1-#9
set_background setb Sb Set current background color
set_bottom_margin smgb Zk Set bottom margin at
current line
set_bottom_margin_parm smgbp Zl Set bottom margin at
line #1 or #2
lines from bottom
set_clock sclk SC Set time-of-day clock
set_color_band setcolor YzChange to ribbon color #1
set_color_pair scp sp Set current color-pair
set_foreground setf Sf Set current foreground color1
set_left_margin smgl ML Set left margin at current line
set_left_margin_parm smglp Zm Set left (right) margin
at column #1 (#2)
set_lr_margin smglr ML Sets both left and right margins
set_page_length slines YZ Set page length to #1 lines
(use tparm) of an inch
set_right_margin smgr MR Set right margin at
current column
set_right_margin_parm smgrp Zn Set right margin at column #1
set_tab hts st Set a tab in all rows,
current column
set_tb_margin smgtb MT Sets both top and bottom margins
set_top_margin smgt Zo Set top margin at current line
set_top_margin_parm smgtp Zp Set top (bottom) margin
at line #1 (#2)
set_window wind wi Current window is lines
#1-#2 cols #3-#4
start_bit_image sbim Zq Start printing bit image graphics
start_char_set_def scsd Zr Start definition of a character
set
stop_bit_image rbim Zs End printing bit image graphics
SunOS 5.10 Last change: 9 Jul 1996 16
File Formats terminfo(4)
stop_char_set_def rcsd Zt End definition of a character set
subscript_characters subcs Zu List of ``subscript-able''
characters
superscript_characters supcs Zv List of ``superscript-able''
characters
tab ht ta Tab to next 8-space hardware tab
stop
these_cause_cr docr Zw Printing any of these
chars causes cr
to_status_line tsl ts Go to status line, col #1
tone tone TO Select touch tone dialing
user0 u0 u0 User string 0
user1 u1 u1 User string 1
user2 u2 u2 User string 2
user3 u3 u3 User string 3
user4 u4 u4 User string 4
user5 u5 u5 User string 5
user6 u6 u6 User string 6
user7 u7 u7 User string 7
user8 u8 u8 User string 8
user9 u9 u9 User string 9
underline_char uc uc Underscore one char
and move past it
up_half_line hu hu Half-line up (reverse
1/2 linefeed)
wait_tone wait WA Wait for dial tone
xoff_character xoffc XF X-off character
xon_character xonc XN X-on character
zero_motion zerom Zx No motion for the
subsequent character
Sample Entry
The following entry, which describes the AT&T 610 terminal,
is among the more complex entries in the terminfo file as of
this writing.
610|610bct|ATT610|att610|AT&T610;80column;98key keyboard
am, eslok, hs, mir, msgr, xenl, xon,
cols#80, it#8, lh#2, lines#24, lw#8, nlab#8, wsl#80,
acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z,
civis=\E[?25l, clear=\E[H\E[J, cnorm=\E[?25h\E[?12l,
cr=\r, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\b,
cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K,
flash=\E[?5h$<200>\E[?5l, fsl=\E8, home=\E[H, ht=\t,
ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=\ED, .ind=\ED$<9>,
invis=\E[8m,
is1=\E[8;0 | \E[?3;4;5;13;15l\E[13;20l\E[?7h\E[12h\E(B\E)0,
is2=\E[0m^O, is3=\E(B\E)0, kLFT=\E[\s@, kRIT=\E[\sA,
SunOS 5.10 Last change: 9 Jul 1996 17
File Formats terminfo(4)
kbs=^H, kcbt=\E[Z, kclr=\E[2J, kcub1=\E[D, kcud1=\E[B,
kcuf1=\E[C, kcuu1=\E[A, kf1=\EOc, kf10=\ENp,
kf11=\ENq, kf12=\ENr, kf13=\ENs, kf14=\ENt, kf2=\EOd,
kf3=\EOe, kf4=\EOf, kf5=\EOg, kf6=\EOh, kf7=\EOi,
kf8=\EOj, kf9=\ENo, khome=\E[H, kind=\E[S, kri=\E[T,
ll=\E[24H, mc4=\E[?4i, mc5=\E[?5i, nel=\EE,
pfxl=\E[%p1%d;%p2%l%02dq%?%p1%{9}%<%t\s\s\sF%p1%1d\s\s\s\s\s
\s\s\s\s\s\s%;%p2%s,
pln=\E[%p1%d;0;0;0q%p2%:-16.16s, rc=\E8, rev=\E[7m,
ri=\EM, rmacs=^O, rmir=\E[4l, rmln=\E[2p, rmso=\E[m,
rmul=\E[m, rs2=\Ec\E[?3l, sc=\E7,
sgr=\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p4%t;5%;
%?%p3%p1% | %t;7%;%?%p7%t;8%;m%?%p9%t^N%e^O%;,
sgr0=\E[m^O, smacs=^N, smir=\E[4h, smln=\E[p,
smso=\E[7m, smul=\E[4m, tsl=\E7\E[25;%i%p1%dx,
Types of Capabilities in the Sample Entry
The sample entry shows the formats for the three types of
terminfo capabilities listed: Boolean, numeric, and string.
All capabilities specified in the terminfo source file must
be followed by commas, including the last capability in the
source file. In terminfo source files, capabilities are
referenced by their capability names (as shown in the previ-
ous tables).
Boolean capabilities are specified simply by their comma
separated cap names.
Numeric capabilities are followed by the character `#' and
then a positive integer value. Thus, in the sample, cols
(which shows the number of columns available on a device) is
assigned the value 80 for the AT&T 610. (Values for numeric
capabilities may be specified in decimal, octal, or hexade-
cimal, using normal C programming language conventions.)
Finally, string-valued capabilities such as el (clear to end
of line sequence) are listed by a two- to five-character
capname, an `=', and a string ended by the next occurrence
of a comma. A delay in milliseconds may appear anywhere in
such a capability, preceded by $ and enclosed in angle
brackets, as in el=\EK$<3>. Padding characters are supplied
by tput. The delay can be any of the following: a number, a
number followed by an asterisk, such as 5*, a number fol-
lowed by a slash, such as 5/, or a number followed by both,
such as 5*/. A `*' shows that the padding required is pro-
portional to the number of lines affected by the operation,
and the amount given is the per-affected-unit padding
required. (In the case of insert characters, the factor is
still the number of lines affected. This is always 1 unless
the device has in and the software uses it.) When a `*' is
specified, it is sometimes useful to give a delay of the
SunOS 5.10 Last change: 9 Jul 1996 18
File Formats terminfo(4)
form 3.5 to specify a delay per unit to tenths of mil-
liseconds. (Only one decimal place is allowed.)
A `/' indicates that the padding is mandatory. If a device
has xon defined, the padding information is advisory and
will only be used for cost estimates or when the device is
in raw mode. Mandatory padding will be transmitted regard-
less of the setting of xon. If padding (whether advisory or
mandatory) is specified for bel or flash, however, it will
always be used, regardless of whether xon is specified.
terminfo offers notation for encoding special characters.
Both \E and \e map to an ESCAPE character, ^x maps to a con-
trol x for any appropriate x, and the sequences \n, \l, \r,
\t, \b, \f, and \s give a newline, linefeed, return, tab,
backspace, formfeed, and space, respectively. Other escapes
include: \^ for caret (^); \\ for backslash (\); \, for
comma (,); \: for colon (:); and \0 for null. (\0 will actu-
ally produce \200, which does not terminate a string but
behaves as a null character on most devices, providing CS7
is specified. (See stty(1)). Finally, characters may be
given as three octal digits after a backslash (for example,
\123).
Sometimes individual capabilities must be commented out. To
do this, put a period before the capability name. For exam-
ple, see the second ind in the example above. Note that
capabilities are defined in a left-to-right order and,
therefore, a prior definition will override a later defini-
tion.
Preparing Descriptions
The most effective way to prepare a device description is by
imitating the description of a similar device in terminfo
and building up a description gradually, using partial
descriptions with vi to check that they are correct. Be
aware that a very unusual device may expose deficiencies in
the ability of the terminfo file to describe it or the ina-
bility of vi to work with that device. To test a new device
description, set the environment variable TERMINFO to the
pathname of a directory containing the compiled description
you are working on and programs will look there rather than
in /usr/share/lib/terminfo. To get the padding for insert-
line correct (if the device manufacturer did not document
it) a severe test is to comment out xon, edit a large file
at 9600 baud with vi, delete 16 or so lines from the middle
of the screen, and then press the u key several times
quickly. If the display is corrupted, more padding is usu-
ally needed. A similar test can be used for insert-
character.
SunOS 5.10 Last change: 9 Jul 1996 19
File Formats terminfo(4)
Section 1-1: Basic Capabilities
The number of columns on each line for the device is given
by the cols numeric capability. If the device has a screen,
then the number of lines on the screen is given by the lines
capability. If the device wraps around to the beginning of
the next line when it reaches the right margin, then it
should have the am capability. If the terminal can clear its
screen, leaving the cursor in the home position, then this
is given by the clear string capability. If the terminal
overstrikes (rather than clearing a position when a charac-
ter is struck over) then it should have the os capability.
If the device is a printing terminal, with no soft copy
unit, specify both hc and os. If there is a way to move the
cursor to the left edge of the current row, specify this as
cr. (Normally this will be carriage return, control M.) If
there is a way to produce an audible signal (such as a bell
or a beep), specify it as bel. If, like most devices, the
device uses the xon-xoff flow-control protocol, specify xon.
If there is a way to move the cursor one position to the
left (such as backspace), that capability should be given as
cub1. Similarly, sequences to move to the right, up, and
down should be given as cuf1, cuu1, and cud1, respectively.
These local cursor motions must not alter the text they pass
over; for example, you would not normally use ``cuf1=\s''
because the space would erase the character moved over.
A very important point here is that the local cursor motions
encoded in terminfo are undefined at the left and top edges
of a screen terminal. Programs should never attempt to back-
space around the left edge, unless bw is specified, and
should never attempt to go up locally off the top. To scroll
text up, a program goes to the bottom left corner of the
screen and sends the ind (index) string.
To scroll text down, a program goes to the top left corner
of the screen and sends the ri (reverse index) string. The
strings ind and ri are undefined when not on their respec-
tive corners of the screen.
Parameterized versions of the scrolling sequences are indn
and rin. These versions have the same semantics as ind and
ri, except that they take one parameter and scroll the
number of lines specified by that parameter. They are also
undefined except at the appropriate edge of the screen.
The am capability tells whether the cursor sticks at the
right edge of the screen when text is output, but this does
not necessarily apply to a cuf1 from the last column. Back-
ward motion from the left edge of the screen is possible
only when bw is specified. In this case, cub1 will move to
the right edge of the previous row. If bw is not given, the
SunOS 5.10 Last change: 9 Jul 1996 20
File Formats terminfo(4)
effect is undefined. This is useful for drawing a box around
the edge of the screen, for example. If the device has
switch selectable automatic margins, am should be specified
in the terminfo source file. In this case, initialization
strings should turn on this option, if possible. If the dev-
ice has a command that moves to the first column of the next
line, that command can be given as nel (newline). It does
not matter if the command clears the remainder of the
current line, so if the device has no cr and lf it may still
be possible to craft a working nel out of one or both of
them.
These capabilities suffice to describe hardcopy and screen
terminals. Thus the AT&T 5320 hardcopy terminal is described
as follows:
5320|att5320|AT&T 5320 hardcopy terminal,
am, hc, os,
cols#132,
bel=^G, cr=\r, cub1=\b, cnd1=\n,
dch1=\E[P, dl1=\E[M,
ind=\n,
while the Lear Siegler ADM-3 is described as
adm3 | lsi adm3,
am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H,
cud1=^J, ind=^J, lines#24,
Section 1-2: Parameterized Strings
Cursor addressing and other strings requiring parameters are
described by a parameterized string capability, with
printf-like escapes (%x) in it. For example, to address the
cursor, the cup capability is given, using two parameters:
the row and column to address to. (Rows and columns are num-
bered from zero and refer to the physical screen visible to
the user, not to any unseen memory.) If the terminal has
memory relative cursor addressing, that can be indicated by
mrcup.
The parameter mechanism uses a stack and special % codes to
manipulate the stack in the manner of Reverse Polish Nota-
tion (postfix). Typically a sequence will push one of the
parameters onto the stack and then print it in some format.
Often more complex operations are necessary. Operations are
in postfix form with the operands in the usual order. That
is, to subtract 5 from the first parameter, one would use
%p1%{5}%-.
The % encodings have the following meanings:
SunOS 5.10 Last change: 9 Jul 1996 21
File Formats terminfo(4)
%% outputs `%'
%[[:]flags][width[.precision]][doxXs] as in printf, flags
are [-+#] and space
%c print pop gives %c
%p[1-9] push ith parm
%P[a-z] set dynamic variable
[a-z] to pop
%g[a-z] get dynamic variable
[a-z] and push it
%P[A-Z] set static variable
[a-z] to pop
%g[A-Z] get static variable
[a-z] and push it
%'c' push char constant c
%{nn} push decimal con-
stant nn
%l push strlen(pop)
%+ %- %* %/ %m arithmetic (%m is
mod): push(pop
SunOS 5.10 Last change: 9 Jul 1996 22
File Formats terminfo(4)
integer2 op pop
integer1)
%& %| %^ bit operations:
push(pop integer2 op
pop integer1)
%= %> %< logical operations:
push(pop integer2 op
pop integer1)
%A %O logical operations:
and, or
%! %~ unary operations:
push(op pop)
%i (for ANSI terminals)
add 1 to first parm,
if one parm present,
or first two parms,
if more than one
parm present
%? expr %t thenpart %e elsepart %; if-then-else, %e
elsepart is
optional; else-if's
are possible ala
Algol 68: %? c1 %t
b1 %e c2 %t b2 %e c3
%t b3 %e c4 %t b4 %e
b5%; ci are condi-
tions, bi are
bodies.
If the ``-'' flag is used with ``%[doxXs]'', then a colon
(:) must be placed between the ``%'' and the ``-'' to dif-
ferentiate the flag from the binary ``%-'' operator, for
SunOS 5.10 Last change: 9 Jul 1996 23
File Formats terminfo(4)
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 mil-
liseconds. 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 system may change or discard them. (The library routines
dealing with terminfo set tty modes so that tabs are never
expanded, so \t is safe to send. This turns out to be essen-
tial 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 parameter, pushes the ASCII 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 parameter.
More complex arithmetic is possible using the stack.
Section 1-3: 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 assump-
tion 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 parameter capabilities hpa
(horizontal position absolute) and vpa (vertical position
absolute). Sometimes these are shorter than the more general
two-parameter sequence (as with the Hewlett-Packard 2645)
and can be used in preference to cup. If there are
parameterized local motions (for example, move n spaces to
the right) these can be given as cud, cub, cuf, and cuu with
a single parameter indicating how many spaces to move. These
SunOS 5.10 Last change: 9 Jul 1996 24
File Formats terminfo(4)
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 rela-
tive 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 smcup
sequence will not restore the screen after an rmcup sequence
is output (to the state prior to outputting rmcup), specify
nrrmc.
Section 1-4: 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 ter-
minal 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.)
Section 1-5: 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 parameter 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 parameters: the top
and bottom lines of the scrolling region. The cursor posi-
tion 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) com-
mands 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 fas-
ter even on terminals with those features.
SunOS 5.10 Last change: 9 Jul 1996 25
File Formats terminfo(4)
To determine whether a terminal has destructive scrolling
regions or non-destructive 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 non-destructive scrolling
regions. Otherwise, it has destructive scrolling regions. Do
not specify csr if the terminal has non-destructive scrol-
ling 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 parameterized string wind. The four parameters 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 non-
blank lines up from below or that scrolling back with ri may
bring down non-blank lines.
Section 1-6: 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 char-
acters 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 capa-
bility 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
SunOS 5.10 Last change: 9 Jul 1996 26
File Formats terminfo(4)
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 actually 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 sin-
gle 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 capa-
bility, with one parameter, n, will insert n blanks.
If padding is necessary between characters typed while not
in insert mode, give this as a number of milliseconds pad-
ding 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 termi-
nal 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's) 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 parameter, n, to delete n characters, and
delete mode by giving smdc and rmdc to enter and exit delete
mode (any mode the terminal needs to be placed in for dch1
to work).
A command to erase n characters (equivalent to outputting n
blanks without moving the cursor) can be given as ech with
one parameter.
Section 1-7: Highlighting, Underlining, and Visible Bells
Your device may have one or more kinds of display attributes
that allow you to highlight selected characters when they
appear on the screen. The following display modes (shown
with the names by which they are set) may be available: a
blinking screen (blink), bold or extra-bright characters
SunOS 5.10 Last change: 9 Jul 1996 27
File Formats terminfo(4)
(bold), dim or half-bright characters (dim), blanking or
invisible text (invis), protected text (prot), a reverse-
video screen (rev), and an alternate character set (smacs to
enter this mode and rmacs to exit it). (If a command is
necessary before you can enter alternate character set mode,
give the sequence in enacs or "enable alternate-character-
set" mode.) Turning on any of these modes singly may or may
not turn off other modes.
sgr0 should be used to turn off all video enhancement capa-
bilities. It should always be specified because it
represents the only way to turn off some capabilities, such
as dim or blink.
You should choose one display method as standout mode and
use it to highlight error messages and other kinds of text
to which you want to draw attention. Choose a form of
display that provides strong contrast but that is easy on
the eyes. (We recommend reverse-video plus half-bright or
reverse-video alone.) The sequences to enter and exit stan-
dout mode are given as smso and rmso, respectively. If the
code to change into or out of standout mode leaves one or
even two blank spaces on the screen, as the TVI 912 and
Teleray 1061 do, then xmc should be given to tell how many
spaces are left.
Sequences to begin underlining and end underlining can be
specified as smul and rmul , respectively. If the device has
a sequence to underline the current character and to move
the cursor one space to the right (such as the Micro-Term
MIME), this sequence can be specified as uc.
Terminals with the ``magic cookie'' glitch (xmc) deposit
special ``cookies'' when they receive mode-setting
sequences, which affect the display algorithm rather than
having extra bits for each character. Some terminals, such
as the Hewlett-Packard 2621, automatically leave standout
mode when they move to a new line or the cursor is
addressed. Programs using standout mode should exit standout
mode before moving the cursor or sending a newline, unless
the msgr capability, asserting that it is safe to move in
standout mode, is present.
If the terminal has a way of flashing the screen to indicate
an error quietly (a bell replacement), then this can be
given as flash; it must not move the cursor. A good flash
can be done by changing the screen into reverse video, pad
for 200 ms, then return the screen to normal video.
If the cursor needs to be made more visible than normal when
it is not on the bottom line (to make, for example, a non-
blinking underline into an easier to find block or blinking
SunOS 5.10 Last change: 9 Jul 1996 28
File Formats terminfo(4)
underline) give this sequence as cvvis. The boolean chts
should also be given. If there is a way to make the cursor
completely invisible, give that as civis. The capability
cnorm should be given which undoes the effects of either of
these modes.
If your terminal generates underlined characters by using
the underline character (with no special sequences needed)
even though it does not otherwise overstrike characters,
then you should specify the capability ul. For devices on
which a character overstriking another leaves both charac-
ters on the screen, specify the capability os. If over-
strikes are erasable with a blank, then this should be indi-
cated by specifying eo.
If there is a sequence to set arbitrary combinations of
modes, this should be given as sgr (set attributes), taking
nine parameters. Each parameter is either 0 or non-zero, as
the corresponding attribute is on or off. The nine parame-
ters are, in order: standout, underline, reverse, blink,
dim, bold, blank, protect, alternate character set. Not all
modes need to be supported by sgr; only those for which
corresponding separate attribute commands exist should be
supported. For example, let's assume that the terminal in
question needs the following escape sequences to turn on
various modes.
tparm
parameter 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
SunOS 5.10 Last change: 9 Jul 1996 29
File Formats terminfo(4)
on, the sequence would be \E[0;3;4;5;7;8m^N.
Now look at when different sequences are output. For exam-
ple, ;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.
Section 1-8: 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 (pre-
vious page), kind (scroll forward/down), kri (scroll
SunOS 5.10 Last change: 9 Jul 1996 30
File Formats terminfo(4)
backward/up), khts (set a tab stop in this column). In addi-
tion, 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.
Strings to program function keys can be specified as pfkey,
pfloc, and pfx. A string to program screen labels should be
specified as pln. Each of these strings takes two parame-
ters: a function key identifier and a string to program it
with. pfkey causes pressing the given key to be the same as
the user typing the given string; pfloc causes the string to
be executed by the terminal in local mode; and pfx causes
the string to be transmitted to the computer. The capabili-
ties nlab, lw and lh define the number of programmable
screen labels and their width and height. If there are com-
mands to turn the labels on and off, give them in smln and
rmln. smln is normally output after one or more pln
sequences to make sure that the change becomes visible.
Section 1-9: Tabs and Initialization
If the device has hardware tabs, the command to advance to
the next tab stop can be given as ht (usually control I). A
``backtab'' command that moves leftward to the next tab stop
can be given as cbt. By convention, if tty modes show that
tabs are being expanded by the computer rather than being
sent to the device, programs should not use ht or cbt (even
if they are present) because the user may not have the tab
stops properly set. If the device has hardware tabs that are
initially set every n spaces when the device is powered up,
the numeric parameter it is given, showing the number of
spaces the tabs are set to. This is normally used by tput
init (see tput(1)) to determine whether to set the mode for
hardware tab expansion and whether to set the tab stops. If
the device has tab stops that can be saved in nonvolatile
memory, the terminfo description can assume that they are
properly set. If there are commands to set and clear tab
stops, they can be given as tbc (clear all tab stops) and
hts (set a tab stop in the current column of every row).
Other capabilities include: is1, is2, and is3, initializa-
tion strings for the device; iprog, the path name of a pro-
gram to be run to initialize the device; and if, the name of
a file containing long initialization strings. These strings
are expected to set the device into modes consistent with
the rest of the terminfo description. They must be sent to
the device each time the user logs in and be output in the
following order: run the program iprog; output is1; output
is2; set the margins using mgc, smgl and smgr; set the tabs
using tbc and hts; print the file if; and finally output
is3. This is usually done using the init option of tput.
SunOS 5.10 Last change: 9 Jul 1996 31
File Formats terminfo(4)
Most initialization is done with is2. Special device modes
can be set up without duplicating strings by putting the
common sequences in is2 and special cases in is1 and is3.
Sequences that do a reset from a totally unknown state can
be given as rs1, rs2, rf, and rs3, analogous to is1, is2,
is3, and if. (The method using files, if and rf, is used for
a few terminals, from /usr/share/lib/tabset/*; however, the
recommended method is to use the initialization and reset
strings.) These strings are output by tput reset, which is
used when the terminal gets into a wedged state. Commands
are normally placed in rs1, rs2, rs3, and rf only if they
produce annoying effects on the screen and are not necessary
when logging in. For example, the command to set a terminal
into 80-column mode would normally be part of is2, but on
some terminals it causes an annoying glitch on the screen
and is not normally needed because the terminal is usually
already in 80-column mode.
If a more complex sequence is needed to set the tabs than
can be described by using tbc and hts, the sequence can be
placed in is2 or if.
Any margin can be cleared with mgc. (For instructions on how
to specify commands to set and clear margins, see "Margins"
below under "PRINTER CAPABILITIES".)
Section 1-10: Delays
Certain capabilities control padding in the tty driver.
These are primarily needed by hard-copy terminals, and are
used by tput init to set tty modes appropriately. Delays
embedded in the capabilities cr, ind, cub1, ff, and tab can
be used to set the appropriate delay bits to be set in the
tty driver. If pb (padding baud rate) is given, these values
can be ignored at baud rates below the value of pb.
Section 1-11: Status Lines
If the terminal has an extra ``status line'' that is not
normally used by software, this fact can be indicated. If
the status line is viewed as an extra line below the bottom
line, into which one can cursor address normally (such as
the Heathkit h19's 25th line, or the 24th line of a VT100
which is set to a 23-line scrolling region), the capability
hs should be given. Special strings that go to a given
column of the status line and return from the status line
can be given as tsl and fsl. (fsl must leave the cursor
position in the same place it was before tsl. If necessary,
the sc and rc strings can be included in tsl and fsl to get
this effect.) The capability tsl takes one parameter, which
is the column number of the status line the cursor is to be
moved to.
SunOS 5.10 Last change: 9 Jul 1996 32
File Formats terminfo(4)
If escape sequences and other special commands, such as tab,
work while in the status line, the flag eslok can be given.
A string which turns off the status line (or otherwise
erases its contents) should be given as dsl. If the terminal
has commands to save and restore the position of the cursor,
give them as sc and rc. The status line is normally assumed
to be the same width as the rest of the screen, for example,
cols. If the status line is a different width (possibly
because the terminal does not allow an entire line to be
loaded) the width, in columns, can be indicated with the
numeric parameter wsl.
Section 1-12: Line Graphics
If the device has a line drawing alternate character set,
the mapping of glyph to character would be given in acsc.
The definition of this string is based on the alternate
character set used in the DEC VT100 terminal, extended
slightly with some characters from the AT&T 4410v1 terminal.
Glyph Name vt100+ Character
arrow pointing right +
arrow pointing left ,
arrow pointing down .
solid square block 0
lantern symbol I
arrow pointing up -
diamond `
checker board (stipple) a
degree symbol f
plus/minus g
board of squares h
lower right corner j
upper right corner k
upper left corner l
lower left corner m
plus n
scan line 1 o
horizontal line q
scan line 9 s
left tee t
right tee u
bottom tee v
top tee w
vertical line x
bullet ~
The best way to describe a new device's line graphics set is
to add a third column to the above table with the characters
for the new device that produce the appropriate glyph when
the device is in the alternate character set mode. For exam-
ple,
SunOS 5.10 Last change: 9 Jul 1996 33
File Formats terminfo(4)
Glyph Name vt100+ Char New tty Char
upper left corner l R
lower left corner m F
upper right corner k T
lower right corner j G
horizontal line q ,
vertical line x .
Now write down the characters left to right, as in
``acsc=lRmFkTjGq\,x.''.
In addition, terminfo allows you to define multiple charac-
ter sets. See Section 2-5 for details.
Section 1-13: Color Manipulation
Let us define two methods of color manipulation: the Tek-
tronix method and the HP method. The Tektronix method uses a
set of N predefined colors (usually 8) from which a user can
select "current" foreground and background colors. Thus a
terminal can support up to N colors mixed into N*N color-
pairs to be displayed on the screen at the same time. When
using an HP method the user cannot define the foreground
independently of the background, or vice-versa. Instead, the
user must define an entire color-pair at once. Up to M
color-pairs, made from 2*M different colors, can be defined
this way. Most existing color terminals belong to one of
these two classes of terminals.
The numeric variables colors and pairs define the number of
colors and color-pairs that can be displayed on the screen
at the same time. If a terminal can change the definition of
a color (for example, the Tektronix 4100 and 4200 series
terminals), this should be specified with ccc (can change
color). To change the definition of a color (Tektronix 4200
method), use initc (initialize color). It requires four
arguments: color number (ranging from 0 to colors-1) and
three RGB (red, green, and blue) values or three HLS colors
(Hue, Lightness, Saturation). Ranges of RGB and HLS values
are terminal dependent.
Tektronix 4100 series terminals only use HLS color notation.
For such terminals (or dual-mode terminals to be operated in
HLS mode) one must define a boolean variable hls; that would
instruct the curses init_color routine to convert its RGB
arguments to HLS before sending them to the terminal. The
last three arguments to the initc string would then be HLS
values.
If a terminal can change the definitions of colors, but uses
a color notation different from RGB and HLS, a mapping to
either RGB or HLS must be developed.
SunOS 5.10 Last change: 9 Jul 1996 34
File Formats terminfo(4)
To set current foreground or background to a given color,
use setaf (set ANSI foreground) and setab (set ANSI back-
ground). They require one parameter: the number of the
color. To initialize a color-pair (HP method), use initp
(initialize pair). It requires seven parameters: the number
of a color-pair (range=0 to pairs-1), and six RGB values:
three for the foreground followed by three for the back-
ground. (Each of these groups of three should be in the
order RGB.) When initc or initp are used, RGB or HLS argu-
ments should be in the order "red, green, blue" or "hue,
lightness, saturation"), respectively. To make a color-pair
current, use scp (set color-pair). It takes one parameter,
the number of a color-pair.
Some terminals (for example, most color terminal emulators
for PCs) erase areas of the screen with current background
color. In such cases, bce (background color erase) should be
defined. The variable op (original pair) contains a sequence
for setting the foreground and the background colors to what
they were at the terminal start-up time. Similarly, oc (ori-
ginal colors) contains a control sequence for setting all
colors (for the Tektronix method) or color-pairs (for the HP
method) to the values they had at the terminal start-up
time.
Some color terminals substitute color for video attributes.
Such video attributes should not be combined with colors.
Information about these |