Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

curses(3)

tic(1)

terminfo(4)  —  File Formats

OSF

NAME

terminfo − Describes terminals by capability

DESCRIPTION

A terminfo file is a database that describes the capabilities and method of operation of various terminals.  The database includes definitions of initialization sequences, padding requirements, cursor positioning, and other command sequences that control specific terminals. 

Before a terminfo source file can be used, it must be compiled using the tic command.  The compiled terminfo entries are placed into subdirectories of the /usr/lib/terminfo directory.  This directory may be redefined with the TERMINFO environment variable.  See the EXAMPLE section for more information on using the TERMINFO environment variable. 

Each terminfo file entry consists of a number of fields separated by commas.  Any white space between commas is ignored. The first field for each terminal supplies the names the terminal is known by, separated by vertical bars (|).  The first name given is the most common abbreviation for the terminal, the last name given is a long name fully identifying the terminal, and all others are synonyms for the terminal name.  All names except the last are in lowercase and do not contain any white space.

The fields following the terminal name supply the capabilities of the terminal.  Although capability names have no absolute length limit, an informal limit of 5 characters is adopted to keep them short and to allow the tabs in the source file caps to be aligned.  Whenever possible, names are chosen to be the same as or similar to the ANSI X3.64 standard of 1979. 

Terminal names (except the last) are chosen using the following conventions. A root name is chosen to represent the particular hardware class of the terminal. This name does not contain hyphens, except to avoid synonyms that conflict with other names. Possible modes for the hardware or user preferences are indicated by appending a - (hyphen) and one of the suffixes listed below:

-amWith automatic margins (usually default)

-cColor mode

-wWide mode (more than 80 columns)

-namWithout automatic margins

-nNumber of lines on the screen

-naNo arrow keys (leave them in local)

-npNumber of pages of memory

-rvReverse video

Thus, a vt100 terminal in 132-column mode would be vt100-w. 

Capabilities in the terminfo file are of three types:

       •Boolean capabilities indicate that the terminal has some particular feature. Boolean capabilities are evaluated as true if the corresponding name is in the terminal description. 

       •Numeric capabilities give the size of the terminal or the size of particular delays. 

       •String capabilities give a sequence that can be used to perform particular terminal operations. 

To continue an entry onto multiple lines, place white space at the beginning of each subsequent line.  Include a comment on a line beginning with the # (number sign) character.  To comment out an individual capability, precede it with a . (dot). 

List of Capabilities

The following table shows the C variable (which the programmer uses to access the terminfo capabilities), the capability name (the short name used in the text of the database), the 2-letter internal code used in the compiled database (always corresponding to a termcap capability name), and a short description of each capability. 

Boolean Name Code Description
auto_left_margin bw bw Indicates cub1 wraps from column 0 (zero) to last column. 
auto_right_margin am am Indicates terminal has automatic margins. 
beehive_glitch xsb xs Indicates a terminal with F1=<esc> and ­F2=<Ctrl-C>. 
ceol_standout_glitch xhp xs Indicates standout not erased by overwriting. 
eat_newline_glitch xenl xn Ignores newline character after 80 columns. 
erase_overstrike eo eo Erases overstrikes with a blank. 
Generic_type gn gn Indicates generic line type (such as dialup, switch)
hard_copy hc hc Indicates hardcopy terminal. 
has_meta_key km km Indicates terminal has a meta key (shift, sets parity bit). 
has_status_line hs hs Indicates terminal has extra status line. 
insert_null_glitch in in Indicates insert mode distinguishes nulls. 
memory_above da da Retains information above display in memory. 
memory_below db db Retains information below display in memory. 
move_insert_mode mir mi Indicates safe to move while in insert mode. 
move_standout_mode msgr ms Indicates safe to move in standout mode. 
over_strike os os Indicates terminal overstrikes. 
status_line_esc_ok eslok es Indicates escape can be used on the status line. 
teleray_glitch xt xt Indicates destructive tabs and blanks inserted while entering standout mode. 
tilde_glitch hz hz Indicates terminal cannot print ~ (tilde) characters. 
transparent_underline ul ul Overstrikes with underline character. 
xon_xoff xon xo Indicates terminal uses xon/xoff handshaking. 

Number Name Code Description
columns cols co Specifies the number of columns in a line. 
init_tabs it it Provides tabs initially every # spaces. 
lines lines li Specifies the number of lines on screen or page. 
lines_of_memory lm lm Specifies the number of lines of memory if greater than the number of lines on the screen.  A value of 0 (zero) indicates that the number of lines is variable. 
magic_cookie_glitch xmc sg Indicates number of blank characters left by smso or rmso. 
padding_baud_rate pb pb Indicates lowest baud where carriage return and line return padding is needed. 
virtual_terminal vt vt Indicates virtual terminal number. 
width_status_lines wsl ws Specifies the number of columns in status line. 

String Name Code Description
appl_defined_str apstr za Application-defined terminal
string.
back_tab cbt bt Back tab. (P)
bell bel bl Produces an audible signal (bell). (P)
box_chars_1 box1 bx Box characters primary set.
box_chars_2 box2 by Box characters alternate set.
box_attr_1 batt1 Bx Attributes for box_chars_1.
box_attr_2 batt2 By Attributes for box_chars_2.
carriage_return cr cr Indicates carriage return. (P∗)
change_scroll_region csr cs Changes scroll region to
lines 1 through 2. (PG)
clear_all_tabs tbc ct Clears all tab stops. (P)
clear_screen clear cl Clears screen and puts cursor in
home position. (P∗)
clr_eol el ce Clears to end of line. (P)
clr_eos ed cd Clears to end of the display. (P∗)
color_bg_0 colb0 d0 Background color 0 black.
color_bg_1 colb1 d1 Background color 1 red.
color_bg_2 colb2 d2 Background color 2 green.
color_bg_3 colb3 d3 Background color 3 brown.
color_bg_4 colb4 d4 Background color 4 blue.
color_bg_5 colb5 d5 Background color 5 magenta.
color_bg_6 colb6 d6 Background color 6 cyan.
color_bg_7 colb7 d7 Background color 7 white.
color_fg_0 colf0 c0 Foreground color 0 white.
color_fg_1 colf1 c1 Foreground color 1 red.
color_fg_2 colf2 c2 Foreground color 2 green.
color_fg_3 colf3 c3 Foreground color 3 brown.
color_fg_4 colf4 c4 Foreground color 4 blue.
color_fg_5 colf5 c5 Foreground color 5 magenta.
color_fg_6 colf6 c6 Foreground color 6 cyan.
color_fg_7 colf7 c7 Foreground color 7 black.
column_address hpa ch Sets cursor column. (PG)
command_character cmdch CC Indicates terminal command
prototype character can be set.
cursor_address cup cm Indicates screen relative cursor
motion row #1 col #2. (PG)
cursor_down cud1 do Moves cursor down one line.
cursor_home home ho Moves cursor to home position
(if no cup).
cursor_invisible civis vi Makes cursor invisible.
cursor_left cub1 le Moves cursor left one space.
cursor_mem_address mrcup CM Indicates memory relative
cursor addressing.
cursor_normal cnorm ve Makes cursor appear normal
(undo vs or vi).
cursor_right cuf1 nd Indicates nondestructive space
(cursor right).
cursor_to_ll ll ll Moves cursor to first column of last
line (if no cup).
cursor_up cuu1 up Moves cursor up one line (cursor up).
cursor_visible cvvis vs Makes cursor very visible.
delete_character dch1 dc Deletes character. (P∗)
delete_line dl1 dl Deletes line. (P∗)
dis_status_line dsl ds Disables status line.
down_half_line hd hd Indicates subscript
(forward 1/2 linefeed).
enter_alt_charset_mode smacs as Starts alternate character set. (P)
enter_blink_mode blink mb Enables blinking.
enter_bold_mode bold md Enables bold (extra bright) mode.
enter_ca_mode smcup ti Begins programs that use cup.
enter_delete_mode smdc dm Starts delete mode.
enter_dim_mode dim mh Enables half-bright mode.
enter_insert_mode smir m Starts insert mode.
enter_protected_mode prot mp Enables protected mode.
enter_reverse_mode rev mr Enables reverse video mode.
enter_secure_mode invis mk Enables blank mode
(characters invisible).
enter_standout_mode smso so Begins standout mode.
enter_underline_mode smul us Starts underscore mode.
erase_chars ech ec Erases #1 characters. (PG)
exit_alt_charset_mode rmacs ae Ends alternate character set. (P)
exit_attribute_mode sgr0 me Disables all attributes.
exit_ca_mode rmcup te Ends programs that use cup.
exit_delete_mode rmdc ed Ends delete mode.
exit_insert_mode rmir ei Ends insert mode.
exit_standout_mode rmso se Ends standout mode.
exit_underline_mode rmul ue Ends underscore mode.
flash_screen lash vb Indicates visual bell
(may not move cursor).
font_0 font0 f0 Select font 0.
font_1 font1 f1 Select font 1.
font_2 font2 f2 Select font 2.
font_3 font3 f3 Select font 3.
font_4 font4 f4 Select font 4.
font_5 font5 f5 Select font 5.
font_6 font6 f6 Select font 6.
font_7 font7 f7 Select font 7.
form_feed ff ff Ejects page (hardcopy terminal). (P∗)
from_status_line fsl fs Returns from status line.
init_1string is1 i1 Initializes terminal.
init_2string is2 i2 Initializes terminal.
init_3string is3 i3 Initializes terminal.
init_file if if Identifies file containing is.
insert_character ich1 ic Inserts character. (P)
insert_line il1 al Adds new blank line. (P∗)
insert_padding ip ip Inserts pad after character
inserted. (P∗)
key_action kact kJ Send by the action key.
key_backspace kbs kb Sent by backspace key.
key_back_tab kbtab k0 Sent by backtab key.
key_catab ktbc ka Sent by clear-all-tabs key.
key_clear kclr kC Sent by clear-screen or erase key.
key_ctab kctab kt Sent by clear-tab key.
key_command kcmd kc Command request key.
key_command_pane kcpn kW Command pane key.
key_dc kdch1 kD Sent by delete-character key.
key_dl kdl1 kL Sent by delete-line key.
key_do kdo ki Do request key.
key_down kcud1 kd Sent by terminal cursor down key.
key_eic krmir kM Sent by rmir or smir in insert mode.
key_end kend kw End key.
key_eol ke1 kE Sent by clear-to-end-of-line key.
key_eos ked kS Sent by clear-to-end-of-screen key.
key_f0 kf0 k0 Sent by function key F0.
key_f1 kf1 k1 Sent by function key F1.
key_f2 kf2 k2 Sent by function key F2.
key_f3 kf3 k3 Sent by function key F3.
key_f4 kf4 k4 Sent by function key F4.
key_f5 kf5 k5 Sent by function key F5.
key_f6 kf6 k6 Sent by function key F6.
key_f7 kf7 k7 Sent by function key F7.
key_f8 kf8 k8 Sent by function key F8.
key_f9 kf9 k9 Sent by function key F9.
key_f10 kf10 ka Sent by function key F10.
key_f11 kf11 k< Sent by function key F11.
key_f12 kf12 k> Sent by function key F12.
key_f13 kf13 k! Sent by function key F13.
key_f14 kf14 k@ Sent by function key F14.
key_f15 kf15 k# Sent by function key F15.
key_f16 kf16 k$ Sent by function key F16.
key_f17 kf17 k% Sent by function key F17.
key_f18 kf18 k^ Sent by function key F18.
key_f19 kf19 k& Sent by function key F19.
key_f20 kf20 k∗ Sent by function key F20.
key_f21 kf21 k( Sent by function key F21.
key_f22 kf22 k) Sent by function key F22.
key_f23 kf23 k- Sent by function key F23.
key_f24 kf24 k_ Sent by function key F24.
key_f25 kf25 k+ Sent by function key F25.
key_f26 kf26 k, Sent by function key F26.
key_f27 kf27 k: Sent by function key F27.
key_f28 kf28 k? Sent by function key F28.
key_f29 kf29 k[ Sent by function key F29.
key_f30 kf30 k] Sent by function key F30.
key_f31 kf31 k{ Sent by function key F31.
key_f32 kf32 k} Sent by function key F32.
key_f33 kf33 k| Sent by function key F33.
key_f34 kf34 k~ Sent by function key F34.
key_f35 kf35 k/ Sent by function key F35.
key_f36 kf36 k= Sent by function key F36.
key_help khlp kq Help key.
key_home khome kh Sent by home key.
key_ic kich1 kI Sent by insert character/enter
insert mode key.
key_il kil1 kA Sent by insert line key.
key_left kcub1 kl Sent by terminal cursor left key.
key_ll kll kH Sent by home-down key.
key_newline knl kn New-line key.
key_next_pane knpn kv Next-pane key.
key_npage knp kN Sent by next-page key.
key_ppage kpp kP Sent by previous-page key.
key_prev_cmd kpcmd kp Sent by previous-command key.
key_prev_pane kppn kV Previous pane key.
key_quit kquit kQ Quit key.
key_right kcuf1 kr Sent by terminal cursor right key.
key_scroll_left kscl kz Scroll left.
key_scroll_right kscr kZ Scroll right.
key_select ksel kU Select key.
key_sf kind kF Sent by scroll-forward/down key.
key_sf1 ksf1 S1 Special function key 1.
key_sf2 ksf2 S2 Special function key 2.
key_sf3 ksf3 S3 Special function key 3.
key_sf4 ksf4 S4 Special function key 4.
key_sf5 ksf5 S5 Special function key 5.
key_sf6 ksf6 S6 Special function key 6.
key_sf7 ksf7 S7 Special function key 7.
key_sf8 ksf8 S8 Special function key 8.
key_sf9 ksf9 S9 Special function key 9.
key_sf10 ksf10 SA Special function key 10.
key_smap_in1 kmpf1 Kv Input for special mapped key 1.
key_smap_out1 kmpt1 KV Output for mapped key 1.
key_smap_in2 kmpf2 Kw Input for special mapped key 2.
key_smap_out2 kmpt2 KW Output for mapped key 2.
key_smap_in3 kmpf3 Kx Input for special mapped key 3.
key_smap_out3 kmpt3 KX Output for mapped key 3.
key_smap_in4 kmpf4 Ky Input for special mapped key 4.
key_smap_out4 kmpt4 KY Output for mapped key 4.
key_smap_in5 kmpf5 Kz Input for special mapped key 5.
key_smap_out5 kmpt5 KZ Output for mapped key 5.
key_smap_in6 kmpf6 Kr Input for special mapped key 6.
key_smap_out6 kmpt6 KR Output for mapped key 6.
key_smap_in7 kmpf7 Ks Input for special mapped key 7.
key_smap_out7 kmpt7 KS Output for mapped key 7.
key_smap_in8 kmpf8 Kt Input for special mapped key 8.
key_smap_out8 kmpt8 KT Output for mapped key 8.
key_smap_in9 kmpf9 Ku Input for special mapped key 9.
key_smap_out9 kmpt9 KU Output for mapped key 9.
key_sr kri kR Sent by scroll-backward/up key.
key_stab khts k Sent by set-tab key.
key_tab ktab ko Tab key.
key_up kcuu1 ku Sent by terminal cursor up key.
keypad_local rmkx ke Ends keypad transmit mode.
keypad_xmit smkx ks Puts terminal in keypad transmit mode.
lab_f0 f0 l0 Labels function key F0 if not F0.
lab_f1 lf1 l1 Labels function key F1 if not F1.
lab_f2 lf2 l2 Labels function key F2 if not F2.
lab_f3 lf3 l3 Labels function key F3 if not F3.
lab_f4 lf4 l4 Labels function key F4 if not F4.
lab_f5 lf5 l5 Labels function key F5 if not F5.
lab_f6 lf6 l6 Labels function key F6 if not F6.
lab_f7 lf7 l7 Labels function key F7 if not F7.
lab_f8 lf8 l8 Labels function key F8 if not F8.
lab_f9 lf9 l9 Labels function key F9 if not F9.
lab_f10 lf10 la Labels function key F10 if not F10.
meta_on smm mm Enables meta mode (8th bit).
meta_off rmm mo Disables meta mode.
newline nel nw Performs newline function
(behaves like a carriage return
followed by a linefeed).
pad_char pad pc Pad character (instead of null).
parm_dch dch DC Deletes #1 characters. (PG∗)
parm_delete_line dl DL Deletes #1 lines. (PG∗)
parm_down_cursor cud DO Moves cursor down #1 lines. (PG∗)
parm_ich ich IC Inserts #1 blank characters. (PG∗)
parm_index indn SF Scrolls forward #1 lines. (PG)
parm_insert_line il AL Adds #1 new blank lines. (PG∗)
parm_left_cursor cub LE Moves cursor left #1 spaces. (PG)
parm_right_cursor cuf RI Moves cursor right #1 spaces. (PG∗)
parm_rindex rin SR Scrolls backward #1 lines. (PG)
parm_up_cursor cuu UP Moves cursor up #1 lines. (PG∗)
pkey_key pfkey pk Programs function key F1 to type
string #2.
pkey_local pfloc pl Programs function key F1 to execute
string #2.
pkey_xmit pfx px Programs function key F1 to xmit
string #2.
print_screen mc0 ps Prints contents of the screen.
prtr_off mc4 pf Disables the printer.
prtr_on mc5 po Enables the printer.
repeat_char rep rp Repeats character #1 twice. (PG∗)
reset_1string rs1 r1 Resets terminal to known modes.
reset_2string rs2 r2 Resets terminal to known modes.
reset_3string rs3 r3 Resets terminal to known modes.
reset_file rf rf Identifies the file containing reset
string.
restore_cursor rc rc Restores cursor to position of
last sc.
row_address vpa cv Positions cursor to an absolute
vertical position (set row). (PG)
save_cursor sc sc Saves cursor position. (P)
scroll_forward ind sf Scrolls text up. (P)
scroll_reverse ri sr Scrolls text down. (P)
set_attributes sgr sa Defines the video attributes. (PG∗)
set_tab hts st Sets a tab in all rows,
current column.
set_window wind wi Indicates current window is lines #1
to #2 cols #3 to #4.
tab ht a Tabs to next 8-space hardware
tab stop.
to_status_line tsl ts Moves to status line, column #1.
underline_char uc uc Underscores one character and moves
beyond it.
up_half_line hu hu Indicates superscript
(reverse 1/2 linefeed).
init_prog iprog iP Locates the program for init.
key_a1 ka1 K1 Specifies upper left of keypad.
key_a3 ka3 K3 Specifies upper right of keypad.
key_b2 kb2 K2 Specifies center of keypad.
key_c1 kc1 K4 Specifies lower left of keypad.
key_c3 kc3 K5 Specifies lower right of keypad.
prtr_non mc5p pO Enables the printer for #1 bytes.

Notes to table:

(P)Indicates that padding can be specified. 

(G)Indicates that the string is passed through tparm with parameters as given (#i). 

(∗)Indicates that padding can be based on the number of lines affected. 

(#i)Indicates the ith parameter. 

EXAMPLE

The following is an uncompiled terminfo entry for the xterm terminal type:

xterm|vs100|xterm terminal emulator,
        ind=^J, cols#80, lines#25,
        clear=E[HE[2J, cub1=^H, am, cup=E[%i%p1%d;%p2%dH,
        cuf1=E[C, cuu1=E[A, el=E[K, ed=E[J,
        cud=E[%p1%dB, cuu=E[%p1%dA, cub=E[%p1%dD,
        cuf=E[%p1%dC, km,
        smso=E[7m, rmso=E[m, smul@, rmul@,
        bold=E[1m, rev=E[7m, blink=@, sgr0=E[m,
        rs1=E>E[1;3;4;5;6lE[?7hE[mE[rE[2JE[H, rs2=@
        kf1=EOP, kf2=EOQ, kf3=EOR, kf4=EOS, ht=^I, ri=EM,
        vt@, xon@, csr=E[%i%p1%d;%p2%dr,
        il=E[%p1%dL, dl=E[%p1%dM, il1=E[L, dl1=E[M,
        ich=E[%p1%d@, dch=E[%p1%dP, ich1=E[@, dch1=E[P,
        use=vt100-am,

The first line of the xterm entry contains two names for the terminal type (xterm and vs100), and a third name that fully describes the terminal.  When the terminfo entry is compiled with the tic command, entries are made in /usr/lib/terminfo/x/xterm and /usr/lib/terminfo/v/vs100, unless the TERMINFO environment variable was used to redefine the default path.  The TERMINFO environment variable is useful when testing a new entry, or when you do not have write permission for the /usr/lib/terminfo directory tree.  For example, if the TERMINFO environment variable is set to /usr/raj/test, the tic command places the compiled terminfo entries into /usr/raj/test/x/xterm and /usr/raj/test/v/vs100.  The TERMINFO environment variable is also referenced by programs that use terminfo (such as vi), so the new entry can be tested right away. 

The second line of the xterm entry says that pressing a Ctrl-J causes the screen to scroll up, and that the screen dimensions are 80 columns by 24 lines. 

The third line of the entry sets the string that clears the screen (ESCAPE followed by "[H", another ESCAPE, and then the string "[2J"), defines <Ctrl-H> as the backspace key, and declares that the terminal has automatic margins.  The string for relative cursor movement is also specified, using terminfo parameter syntax. 

The rest of the capabilities are declared likewise.  The last line of the entry reads "use=vt100-am"", meaning that the vt100-am terminal entry should be read first as the basis for the xterm terminal entry, with the capabilities explicitly defined overriding their default vt100-am values.  Note that the smul, rmul, vt, and xon capabilities are removed by following them with an @ (at sign). 

RELATED INFORMATION

Functions:  curses(3)

Commands:  tic(1)

J. Strang, L. Mui, and T. O’Reilly.  Termcap and Terminfo.  Sebastapol, California: O’Reilly and Associates, Inc., 1990. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026