tteerrmmiinnffoo -- System Administration

Terminal-description language
/uussrr/lliibb/tteerrmmiinnffoo

tteerrmmiinnffoo is a  system for describing terminals.  Descriptions are collected
in the file  /uussrr/lliibb/tteerrmmiinnffoo and are read by ccuurrsseess,  mmoorree, vvii, and other
utilities.  By  passing her terminal's tteerrmmiinnffoo entry to  a program, a user
can make  sure that the program  can take full advantage  of her terminal's
capacities.

tteerrmmiinnffoo resembles  the terminal-description language  tteerrmmccaapp; however, it
enjoys a number of features that tteerrmmccaapp does not, as follows:

-> A tteerrmmccaapp  entry cannot exceed a predefined  limit.  tteerrmmiinnffoo lifts this
   restriction.

-> tteerrmmiinnffoo entries are compiled;  therefore, they are read and loaded more
   quickly.

-> tteerrmmccaapp entries are all kept in file /eettcc/tteerrmmccaapp. Each tteerrmmiinnffoo resides
   in  its own  file;  thus, a  program  and find  and load  an entry  more
   quickly.

-> tteerrmmiinnffoo is a little more easily read by human beings.

Whether a program uses tteerrmmccaapp or tteerrmmiinnffoo descriptions depends entirely on
that program.   For example, MicroEMACS uses  tteerrmmccaapp descriptions; but vvsshh
(and  other ccuurrsseess-based  programs) use tteerrmmiinnffoo.  In general,  tteerrmmiinnffoo is
regarded as being more flexible and up-to-date.

_t_e_r_m_i_n_f_o _E_n_t_r_i_e_s
Directory /uussrr/lliibb/tteerrmmiinnffoo  consists of  a number of  sub-directories, one
for each terminal type being  described.  A _t_e_r_m_i_n_a_l _t_y_p_e describes a given
make of terminal (e.g., the Wyse  150) plus some special attribute, such as
the number of characters on a  line or a specially defined bank of function
keys.  A  tteerrmmiinnffoo entry can  extend over more  than one line  by indenting
every line after the first.  A  line that begins with a pound sign `#' is a
comment.

A  tteerrmmiinnffoo  entry  consists of  an  indefinite  number of  comma-separated
fields.  White  space after each  comma is ignored.  The  first field names
the  terminal; the  remaining  fields hold  capability codes.   (_C_a_p_a_b_i_l_i_t_y
_c_o_d_e_s are discussed  in detail below.) Preceding a field  with a period `.'
comments out that field, and only that field.

_N_a_m_i_n_g _T_e_r_m_i_n_a_l_s
The first  field in  a tteerrmmiinnffoo entry  names the terminal  being described.
The  name field  consists of  one  or more  names, which  are separated  by
vertical-bar  characters.   The   first  name  given  is  the  most  common
abbreviation for the  terminal.  The last name is usually  a long name that
fully identifies the terminal.  All names in between the first and the last
give common  synonyms for that terminal.  All  names can contain upper-case
characters; the last name can also contain white space.

Terminal  names  (except  for  the  last,  verbose entry)  should  use  the
following conventions:

-> The hardware should have a root name chosen, e.g., ``wyse150''.

-> The root  name should  not contain  hyphens, except to  prevent synonyms
   from colliding with other names.

-> Modes  that the  hardware  can be  in,  or user  preferences, should  be
   indicated  by appending  a hyphen  and  an indicator  of the  mode.  For
   example, a wwyyssee115500 with an old-fashioned 82-key keyboard could be called
   wwyyssee115500-oo.

Use the following suffixes whenever possible:

_S_u_f_f_i_x    _M_e_a_n_i_n_g
-ww        Wide (more than 80 columns)
-aamm       With automatic margins (usually default)
-nnaamm      Without automatic margins
-_n        Number of lines on the screen
-nnaa       No arrow keys
-_npp       _n pages of memory
-rrvv       Reverse video

_C_a_p_a_b_i_l_i_t_y _C_o_d_e_s
A _c_a_p_a_b_i_l_i_t_y  _c_o_d_e describes a capability of  a terminal.  Capability codes
come in three varieties:

_B_o_o_l_e_a_n   This indicates  whether a terminal  has a given  feature.  If the
          field is present, the terminal is assumed to have the capability;
          if not, then  it is assumed not to be  present.  For example, the
          code  aamm indicates  ``automatic margins''.   If  aamm appears  in a
          terminal's tteerrmmiinnffoo entry, then it can execute automatic margins;
          if not, then it can't.

_N_u_m_e_r_i_c   This gives  the size of  some aspect of  a terminal, such  as the
          number  of lines  or the  number of columns.   A numeric  code is
          followed by a number sign `#'  and then a string of digits, which
          set  the  value  for that  code  For  example,  the code  ccoollss#8800
          indicates that a terminal has 80 columns per row.

_S_t_r_i_n_g _C_a_p_a_b_i_l_i_t_i_e_s
          This  gives a  sequence  of characters  that  trigger a  terminal
          operation.   For  example,   a  terminal  may  expect  a  ``magic
          sequence'' to  wipe the screen clean, to  print in reverse video,
          or to  change the shape of its cursor.   Likewise, a terminal may
          send  a ``magic  sequence''  when a  particular  function key  is
          pressed.   For example,  the  code kkllff11=\EE55  indicates that  this
          terminal sends the  string <eesscc>55 when the user presses function-
          key 1.

Some  terminal capabilities  may involve  _p_a_d_d_i_n_g --  that is,  telling the
terminal to delay  execution of the capability for a  fraction of a second.
In some  instances, padding  may make  the difference between  a terminal's
drawing information correctly, or displaying a jumble.

A  delay code  can appear  anywhere  in a  string capability  code.  It  is
introduced by a dollar sign `$' and enclosed in angle brackets `<>'.    The
numeric value is always  in milliseconds.  For example, the code eell=\EEKK$<33>
indicates that  the clear-to-end-of-line code eell is  invoked by the ``magic
sequence'' <eesscc>KK,  and that it  should involve a  three-millisecond delay.
Function ttppuuttss() provides the delay.

The delay can be either a  number, e.g., ``20'', or a number followed by an
asterisk, e.g.,  ``3*''.  An  asterisk indicates  that the padding  must be
proportional to  the number of lines affected by  the operation; the amount
given is the  amount of padding required by each  line of output.  (This is
true even  in the case of  the insert-character code.) When  an asterisk is
specified, it  is sometimes useful to  give a delay of  the form ``3.5'' to
specify  a delay-per-unit  to tenths  of  milliseconds.  (Only  one decimal
place is allowed.)

The  following table  gives the commonest  tteerrmmiinnffoo capability  codes.  The
_v_a_r_i_a_b_l_e  is the  name  by which  the  programmer (at  the tteerrmmiinnffoo  level)
accesses the capability.  The _c_o_d_e is  the name used in the tteerrmmiinnffoo entry.
There is no  fixed limit to the length of  a code, but the convention is to
keep them  to five characters  or fewer.  Whenever possible,  names are the
same as, or similar to, those in the ANSI Standard X3.64-1979.

The semantics describe features of the code:

+  You may specify padding.

+* Padding may be based on the number of lines affected.

#  The string is passed through ttppaarrmm() with the number of parameters given
   in the description.

#_i Indicate the _ith parameter.


_B_o_o_l_e_a_n _C_o_d_e_s
_C_o_d_e    _V_a_r_i_a_b_l_e                 _D_e_s_c_r_i_p_t_i_o_n
aamm..... auto_right_margin....... Automatic margins
bbccee.... back_color_erase........ Erase screen with background color
bbww..... auto_left_margin........ ccuubb11 wraps from column 0 to last column
cccccc.... can_change.............. Terminal can redefine a color
cchhttss... hard_cursor............. Cursor is difficult to see
ccppiixx... cpi_changes_res......... Changing character pitch also changes resolution
ccrrxxmm... cr_cancels_micro_mode... Carriage return cancels micro mode
ddaa..... memory_above............ Display can be retained above the screen
ddaaiissyy.. has_print_wheel......... You must change print wheel on printer
ddbb..... memory_below............ Display can be retained below the screen
eeoo..... erase_overstrike........ Erase overstrikes with a blank
eessllookk.. status_line_esc_ok...... Escape can be used on the status line
ggnn..... generic_type............ Generic line type (e.g., dialup, switch).
hhcc..... hard_copy............... Hardcopy terminal
hhllss.... hue_lightness_saturation Terminal uses HLS color notation
hhss..... has_status_line......... Has an extra ``status line''
hhzz..... tilde_glitch............ Hazeltine cannot print tildes `~'
iinn..... insert_null_glitch...... Insert mode distinguishes NULs
kkmm..... has_meta_key............ Has a metakey (shift sets parity bit)
mmcc55ii... prtr_silent............. Printer does not echo on screen
mmiirr.... move_insert_mode........ Safe to move while in insert mode
mmssggrr... move_standout_mode...... Safe to move in standout modes
nnppcc.... no_pad_char............. No padding character
nnxxoonn... needs_xon_xoff.......... Padding does not work:  needs XON/XOFF
ooss..... over_strike............. Terminal overstrikes
ssaamm.... semi_auto_right_margin.. Printing in last column returns carriage
uull..... transparent_underline... Underline character overstrikes
xxeennll... eat_newline_glitch...... Newline ignored after 80 columns (Concept)
xxhhpp.... ceol_standout_glitch.... Standout not erased by overwriting (HP)
xxhhppaa... col_addr_glitch......... Only positive motion for HPA/MHPA capitals
xxoonn.... xon_xoff................ Terminal uses XON/XOFF handshaking
xxssbb.... no_esc_ctlc............. Beehive terminal (F1=escape, F2=<ccttrrll-CC>)
xxvvppaa... row_addr_glitch......... Only positive motion for VPA/MVPA capitals
xxtt..... teleray_glitch.......... Tabs destructive, magic SO char (Teleray 1061)

_N_u_m_e_r_i_c _C_o_d_e_s
_C_o_d_e    _V_a_r_i_a_b_l_e                 _D_e_s_c_r_i_p_t_i_o_n
bbuuffsszz.. buffer_capacity......... Number of bytes buffered before printing
ccoolloorrss. max_colors.............. Maximum number of colors on the screen
ccoollss... columns................. Number of columns in a line
iitt..... init_tabs............... Tabs initially every _n spaces
lliinneess.. lines................... Number of lines on screen or page
llmm..... lines_of_memory......... Lines of memory if greater than lliinneess; zero, variable
mmaaddddrr.. max_micro_address....... Maximum value in micro_ ... _address
mmjjuummpp.. max_micro_jump.......... Maximum value in parm_ ... _micro
mmllss.... micro_line_size......... Line-step size when in micro mode
nnccvv.... no_color_video.......... Video attributes that cannot be used with color
nnllaabb... num_labels.............. Number of labels on the screen
nnppiinnss.. number_of_pins.......... Number of pins in the print-head
oorrcc.... output_res_char......... Horizontal resolution, units per character
oorrhhii... output_res_horz......... Horizontal resolution in units per inch
oorrll.... output_res_line......... Vertical resolution, units per line
oorrvvii... output_res_vert......... Vertical resolution, units per inch
ppaaiirrss.. max_pairs............... Maximum number of color_pairs on screen
ppbb..... padding_baud_rate....... Lowest baud rate where CR/NL padding is needed
ssppiinnhh.. dot_horz_spacing........ Spacing of pins horizontally (pins/inch)
ssppiinnvv.. dot_vert_spacing........ Spacing of pins vertically (pins/inch)
vvtt..... virtual_terminal........ Virtual terminal number
wwiiddccss.. wide_char_size.......... Character step size, double-width mode
wwssll.... width_status_line....... Number of columns in the status line
xxmmcc.... magic_cookie_glitch..... Number of blank characters left by ssmmssoo or rrmmssoo

_S_t_r_i_n_g _C_a_p_a_b_i_l_i_t_i_e_s
_C_o_d_e    _V_a_r_i_a_b_l_e                 _D_e_s_c_r_i_p_t_i_o_n
CCCC..... command_character....... Terminal-settable command character in prototype
aaccsscc... acs_chars............... Pairs of graphical character set (aAbBcC ...)
bbeell.... bell.................... Audible signal (bell)+
bblliinnkk.. enter_blink_mode........ Turn on blinking
bboolldd... enter_bold_mode......... Turn on bold (extra bright)
ccbbtt.... back_tab................ Back tab+
cchh..... erase_charse............ Erase #1 characters+#
cchhrr.... change_res_horz......... Change horizontal resolution
cciivviiss.. cursor_invisible........ Make cursor invisible
cclleeaarr.. clear_screen............ Clear screen+*
ccnnoorrmm.. cursor_normal........... Make cursor appear normal (undo vvss and vvii)
ccppii.... change_char_pitch....... Change number of characters per inch
ccrr..... carriage_return......... Carriage return+*
ccssnnmm... char_set_names.......... Names of character sets
ccssrr.... change_scroll_region.... change to lines #1 through #2 (vt100)+#
ccuubb.... parm_left_cursor........ Move cursor left #1 spaces+#
ccuubb11... cursor_left............. Move cursor left one space
ccuudd.... parm_down_cursor........ Move cursor down #1 lines.+*#
ccuudd11... cursor_down............. Move cursor down one line
ccuuff.... parm_right_cursor....... Move cursor right #1 spaces+*#
ccuuff11... cursor_right............ Move cursor right one space
ccuupp.... cursor_address.......... Cursor motion relative to row 1 column 2+#
ccuuuu.... parm_up_cursor.......... Move cursor up #1 lines+*#
ccuuuu11... cursor_up............... Upline (cursor up)
ccvvrr.... change_rs_vert.......... Change vertical resolution
ccvvvviiss.. cursor_visible.......... Make cursor very visible
ddcchh.... parm_dch................ Delete #1 chars+*#
ddcchh11... delete_character........ Delete character+*
ddeeffcc... define_char............. Define a character in a character set
ddiimm.... enter_dim_mode.......... Turn on half-bright mode
ddll..... parm_delete_line........ Delete #1 lines+*#
ddll11.... delete_line............. Delete line+*
ddooccrr... these_cause_cr.......... List of characters that trigger carriage return
ddssll.... dis_status_line......... Disable status line
eecchh.... erase_chars............. Erase no. 1 characters
eedd..... clr_eos................. Clear to end of display+*
eell..... clr_eol................. Clear to end of line+
eell11.... clr_bol................. Clear to beginning of line, inclusive
eennaaccss.. ena_acs................. Enable alternate character set
ffllaasshh.. flash_screen............ Visible bell (may not move cursor)
ffff..... form_feed............... Hardcopy terminal page eject+*
ffssll.... from_status_line........ Return from status line
hhdd..... down_half_line.......... Half-line down (forward 1/2 linefeed)
hhoommee... cursor_home............. Move cursor to home position (if no ccuupp)
hhppaa.... column_address.......... Set cursor column+#
hhtt..... tab..................... Tab to next eight-space hardware tab stop
hhttss.... set_tab................. Set a tab in all rows, current column.
hhuu..... up_half_line............ Half-line up (reverse 1/2 linefeed)
iicchh.... parm_ich................ Insert #1 blank characters+*#
iicchh11... insert_character........ Insert character+
iiff..... init_file............... Name of file containing iiss
iill..... parm_insert_line........ Add #1 new blank lines+*#
iill11.... insert_line............. Add new blank line+*
iinndd.... scroll_forward.......... Scroll text up+
iinnddnn... parm_index.............. Scroll forward #1 lines+#
iinniittcc.. initialize_color........ Initialize color definition
iinniittpp.. initialize_pair......... Initialize color pairs
iinnvviiss.. enter_secure_mode....... Turn on blank mode (characters invisible)
iipp..... insert_padding.......... Insert pad after character inserted+*
iipprroogg.. init_prog............... Full path name of initialization program
iiss11.... init_1string............ Terminal-initialization string
iiss22.... init_2string............ Terminal-initialization string
iiss33.... init_3string............ Terminal-initialization string
kkBBEEGG... key_sbeg................ Sent by shifted beginning key
kkCCAANN... key_scancel............. Sent by shifted cancel key
kkCCMMDD... key_scommand............ Sent by shifted command key
kkCCPPYY... key_scopy............... Sent by shifted copy key
kkCCRRTT... key_screate............. Sent by shifted create key
kkDDCC.... key_sdc................. Sent by shifted delete-character key
kkDDLL.... key_sdl................. Sent by shifted delete-line key
kkEENNDD... key_send................ Sent by shifted end key
kkEEOOLL... key_seol................ Sent by shifted EOL clear-line key
kkEEXXTT... key_sexit............... Sent by shifted exit key
kkFFNNDD... key_sfind............... Sent by shifted find key
kkHHLLPP... key_shelp............... Sent by shifted help key
kkHHOOMM... key_shome............... Sent by shifted home key
kkIICC.... key_sic................. Sent by shifted input key
kkLLFFTT... key_sleft............... Sent by shifted <- key
kkMMOOVV... key_smove............... Sent by shifted move key
kkMMSSGG... key_smessage............ Sent by shifted message key
kkNNXXTT... key_snext............... Sent by shifted next key
kkOOPPTT... key_soptions............ Sent by shifted option key
kkPPRRTT... key_sprint.............. Sent by shifted print key
kkPPRRVV... key_sprevious........... Sent by shifted previous key
kkRRDDOO... key_sredo............... Sent by shifted redo key
kkRREESS... key_srsume.............. Sent by shifted resume key
kkRRIITT... key_sright.............. Sent by shifted -> key
kkRRPPLL... key_sreplace............ Sent by shifted replace key
kkSSAAVV... key_ssave............... Sent by shifted save key
kkSSPPDD... key_ssuspend............ Sent by shifted suspend key
kkUUNNDD... key_sundo............... Sent by shifted undo key
kkaa11.... key_a1.................. Sent by key A1, upper left of keypad
kkaa33.... key_a3.................. Sent by key A3, upper right of keypad
kkbb22.... key_b2.................. Sent by key B2, center of keypad
kkbbeegg... key_beg................. Sent by ``begin'' key
kkbbss.... key_backspace........... Sent by backspace key
kkcc11.... key_c1.................. Sent by key C1, lower left of keypad
kkcc33.... key_c3.................. Sent by key C3, lower right of keypad
kkccaann... key_cancel.............. Sent by cancel key
kkccbbtt... key_btab................ Sent by back-tab key
kkcclloo... key_close............... Sent by close key
kkccllrr... key_clear............... Sent by clear-screen or erase key
kkccmmdd... key_command............. Sent by ``cmd'' key
kkccppyy... key_copy................ Sent by copy key
kkccrrtt... key_create.............. Sent by create key
kkccttaabb.. key_ctab................ Sent by clear-tab key
kkccuubb11.. key_left................ Sent by <- key
kkccuudd11.. key_down................ Sent by v key
kkccuuff11.. key_right............... Sent by -> key
kkccuuuu11.. key_up.................. Sent by terminal ^ key
kkddcchh11.. key_dc.................. Sent by delete-character key
kkddll11... key_dl.................. Sent by delete-line key
kkeedd.... key_eos................. Sent by clear-to-end-of-screen key
kkeell.... key_eol................. Sent by clear-to-end-of-line key
kkeenndd... key_end................. Sent by end key
kkeenntt... key_enter............... Sent by <rreettuurrnn> key
kkeexxtt... key_exit................ Sent by exit key
kkff00.... key_f0.................. Sent by function key 0
kkff11.... key_f1.................. Sent by function key 1
kkff1100... key_f10................. Sent by function key 10
kkff1111... key_f11................. Sent by function key 11
kkff1122... key_f12................. Sent by function key 12
kkff1133... key_f13................. Sent by function key 13
kkff1144... key_f14................. Sent by function key 14
kkff1155... key_f15................. Sent by function key 15
kkff1166... key_f16................. Sent by function key 16
kkff1177... key_f17................. Sent by function key 17
kkff1188... key_f18................. Sent by function key 18
kkff1199... key_f19................. Sent by function key 19
kkff22.... key_f2.................. Sent by function key 2
kkff2200... key_f20................. Sent by function key 20
kkff2211... key_f21................. Sent by function key 21
kkff2222... key_f22................. Sent by function key 22
kkff2233... key_f23................. Sent by function key 23
kkff2244... key_f24................. Sent by function key 24
kkff2255... key_f25................. Sent by function key 25
kkff2266... key_f26................. Sent by function key 26
kkff2277... key_f27................. Sent by function key 27
kkff2288... key_f28................. Sent by function key 28
kkff2299... key_f29................. Sent by function key 29
kkff33.... key_f3.................. Sent by function key 3
kkff3300... key_f30................. Sent by function key 30
kkff3311... key_f31................. Sent by function key 31
kkff3322... key_f32................. Sent by function key 32
kkff3333... key_f33................. Sent by function key 33
kkff3344... key_f34................. Sent by function key 34
kkff3355... key_f35................. Sent by function key 35
kkff3366... key_f36................. Sent by function key 36
kkff3377... key_f37................. Sent by function key 37
kkff3388... key_f38................. Sent by function key 38
kkff3399... key_f39................. Sent by function key 39
kkff44.... key_f4.................. Sent by function key 4
kkff4400... key_f40................. Sent by function key 40
kkff4411... key_f41................. Sent by function key 41
kkff4422... key_f42................. Sent by function key 42
kkff4433... key_f43................. Sent by function key 43
kkff4444... key_f44................. Sent by function key 44
kkff4455... key_f45................. Sent by function key 45
kkff4466... key_f46................. Sent by function key 46
kkff4477... key_f47................. Sent by function key 47
kkff4488... key_f48................. Sent by function key 48
kkff4499... key_f49................. Sent by function key 49
kkff55.... key_f5.................. Sent by function key 5
kkff5500... key_f50................. Sent by function key 50
kkff5511... key_f51................. Sent by function key 51
kkff5522... key_f52................. Sent by function key 52
kkff5533... key_f53................. Sent by function key 53
kkff5544... key_f54................. Sent by function key 54
kkff5555... key_f55................. Sent by function key 55
kkff5566... key_f56................. Sent by function key 56
kkff5577... key_f57................. Sent by function key 57
kkff5588... key_f58................. Sent by function key 58
kkff5599... key_f59................. Sent by function key 59
kkff66.... key_f6.................. Sent by function key 6
kkff6600... key_f60................. Sent by function key 60
kkff6611... key_f61................. Sent by function key 61
kkff6622... key_f62................. Sent by function key 62
kkff6633... key_f63................. Sent by function key 63
kkff77.... key_f7.................. Sent by function key 7
kkff88.... key_f8.................. Sent by function key 8
kkff99.... key_f9.................. Sent by function key 9
kkffnndd... key_find................ Sent by find key
kkhhllpp... key_help................ Sent by help key
kkhhoommee.. key_home................ Sent by home key
kkhhttss... key_stab................ Sent by set-tab key
kkiicchh11.. key_ic.................. Sent by insert char/enter insert-mode key
kkiill11... key_il.................. Sent by insert line
kkiinndd... key_sf.................. Sent by scroll-forward/down key
kkllll.... key_ll.................. Sent by home-down key
kkmmrrkk... key_mark................ Sent by mark key
kkmmssgg... key_message............. Sent by message key
kkmmoovv... key_move................ Sent by move key
kknnpp.... key_npage............... Sent by next-page key
kknnxxtt... key_next................ Sent by next-object key
kkooppnn... key_open................ Sent by open key
kkoopptt... key_options............. Sent by options key
kkpppp.... key_ppage............... Sent by previous-page key
kkpprrtt... key_print............... Sent by print (copy) key
kkpprrvv... key_previous............ Sent by previous-object key
kkrrddoo... key_redo................ Sent by redo key
kkrreeff... key_reference........... Sent by reference key
kkrreess... key_resume.............. Sent by resume key
kkrrffrr... key_refresh............. Sent by refresh key
kkrrii.... key_sr.................. Sent by scroll-backward/up key
kkrrmmiirr.. key_eic................. Sent by rrmmiirr or ssmmiirr in insert mode
kkrrppll... key_replace............. Sent by replace key
kkrrsstt... key_restart............. Sent by restart key
kkssaavv... key_save................ Sent by save key
kksslltt... key_select.............. Sent by select key
kkssppdd... key_suspend............. Sent by suspend key
kkttbbcc... key_catab............... Sent by clear-all-tabs key
kkuunndd... key_undo................ Sent by undo key
llff00.... label_f0................ Label on function key 0 if not F0
llff11.... label_f1................ Label on function key 1 if not F1
llff1100... label_f10............... Label on function key 10 if not F10
llff22.... label_f2................ Label on function key 2 if not F2
llff33.... label_f3................ Label on function key 3 if not F3
llff44.... label_f4................ Label on function key 4 if not F4
llff55.... label_f5................ Label on function key 5 if not F5
llff66.... label_f6................ Label on function key 6 if not F6
llff77.... label_f7................ Label on function key 7 if not F7
llff88.... label_f8................ Label on function key 8 if not F8
llff99.... label_f9................ Label on function key 9 if not F9
llll..... cursor_to_ll............ Last line, first column (if no ccuupp)
llppii.... change_line_pitch....... Change number of lines per inch
mmcc00.... print_screen............ Print contents of the screen
mmcc44.... prtr_off................ Turn off printer
mmcc55.... prtr_on................. Turn on printer
mmccuubb... parm_left_micro......... Like ccuubb for micro adjustment
mmccuubb11.. micro_left.............. Like ccuubb11 for micro adjustment
mmccuudd... parm_down_micro......... Like ccuudd for micro adjustment
mmccuudd11.. micro_down.............. Like ccuudd11 for micro adjustment
mmccuuff... parm_right_micro........ Like ccuuff for micro adjustment
mmccuuff11.. micro_right............. Like ccuuff11 for micro adjustment
mmccuuuu... parm_up_micro........... Like ccuuuu for micro adjustment
mmccuuuu11.. micro_up................ Like ccuuuu11 for micro adjustment
mmggcc.... clear_margins........... Clear all margins (top, bottom, sides)
mmhhppaa... micro_column_address.... Like hhppaa for micro adjustment
mmrrccuupp.. cursor_mem_address...... Memory-relative cursor addressing
mmvvppaa... micro_row_address....... Like vvppaa for micro adjustment
nneell.... newline................. Newline (behaves like CR followed by LF)
oocc..... orig_colors............. Set all colors to originals
oopp..... orig_pair............... Set default color_pair to original
ppaadd.... pad_char................ Pad character (rather than NUL)
ppffkkeeyy.. pkey_key................ Program function key 1 to type string 2
ppfflloocc.. pkey_local.............. Program function key 1 to execute string 2
ppffxx.... pkey_xmit............... Program function key 1 to transmit string 2
ppllnn.... plab_norm............... Program label 1 to show string 2
ppoorrddeerr. order_of_pins........... Match software bits to print-head pins
pprroott... enter_protected_mode.... Turn on protected mode
rrcc..... restore_cursor.......... Restore cursor to position of last sscc
rreepp.... repeat_char............. Repeat character #1 #2 times. +*#
rreevv.... enter_reverse_mode...... Turn on reverse-video
rrff..... reset_file.............. Name of file containing reset string
rrffii.... reg_for_input........... Send next input character
rrii..... scroll_reverse.......... Scroll text down+
rriinn.... parm_rindex............. Scroll backward one line+#
rriittmm... exit_italics_mode....... Disable italics
rrllmm.... exit_leftward_mode...... Enable rightward motion
rrmmaaccss.. exit_alt_charset_mode... End alternate character set+
rrmmaamm... exit_am_mode............ Turn off automatic margins
rrmmccuupp.. exit_ca_mode............ String to end programs that use ccuupp
rrmmddcc... exit_delete_mode........ End delete mode
rrmmiiccmm.. exit_micro_mode......... Disable micro-motion capabilities
rrmmiirr... exit_insert_mode........ End insert mode
rrmmkkxx... keypad_local............ Exit ``keypad transmit'' mode
rrmmllnn... label_off............... Turn off soft labels
rrmmmm.... meta_off................ Turn off ``meta mode''
rrmmpp.... char_padding............ Like iipp, but in replace mode
rrmmssoo... exit_standout_mode...... End stand out mode
rrmmuull... exit_underline_mode..... End underscore mode
rrmmxxoonn.. exit_xon_mode........... Turn off XON/XOFF handshaking
rrss11.... reset_1string........... Reset terminal completely to sane modes
rrss22.... reset_2string........... Reset terminal completely to sane modes
rrss33.... reset_3string........... Reset terminal completely to sane modes
rrsshhmm... exit_shadow_mode........ Disable shadow printing
rrssuubbmm.. exit_subscript_mode..... Disable subscript printing
rrssuuppmm.. exit_superscript_mode... Disable superscript printing
rruumm.... exit_upward_motion...... Enable downward motion
rrwwiiddmm.. exit_doublewide_mode.... Disable double-width printing
ssbbiimm... start_bit_margin........ Start printing bit-mapped graphics
sscc..... save_cursor............. Save cursor position+
ssccpp.... set_color_pair.......... Set current color pair
ssccss.... select_char_set......... Select character set
ssccssdd... start_char_set_def...... Start definition of a character set
ssddrrffqq.. enter_draft_quality..... Set draft-quality printing
sseettbb... set_background.......... Set current background color
sseettff... set_foreground.......... Set current foreground color
ssggrr.... set_attributes.......... Define the nine video attributes+*#
ssggrr00... exit_attribute_mode..... Turn off all attributes
ssiittmm... enter_italics_mode...... Enable italics
ssllmm.... enter_leftward_mode..... Enable leftward carriage motion
ssmmaaccss.. enter_alt_charset_mode.. Start alternate character set+
ssmmaamm... enter_am_mode........... Turn on automatic margins
ssmmccuupp.. enter_ca_mode........... String to begin programs that use ccuupp
ssmmddcc... enter_delete_mode....... Delete mode (enter)
ssmmggbb... set_bottom_margin....... Set bottom margin to current line
ssmmggbbpp.. set_bottom_margin_parm.. Set bottom margin at lines 1 or 2
ssmmggll... set_left_margin......... Set left margin to current column
ssmmggllpp.. set_left_margin_parm.... Set left margin to columns 1 or 2
ssmmggrr... set_right_margin........ Set right margin to current column
ssmmggrrpp.. set_right_margin_parm... Set right margin to columns 1 or 2
ssmmggtt... set_top_margin.......... Set top margin to current line
ssmmggttpp.. set_top_margin_parm..... Set top margin to lines 1 or 2
ssmmiiccmm.. enter_micro_mode........ Enable micro-motion capabilities
ssmmiirr... enter_insert_mode....... Insert mode (enter)
ssmmkkxx... keypad_xmit............. Enter ``keypad transmit'' mode
ssmmllnn... label_on................ Turn on soft labels
ssmmmm.... meta_on................. Turn on ``meta mode'' (eighth bit)
ssmmssoo... enter_standout_mode..... Begin stand-out mode
ssmmuull... enter_underline_mode.... Start underscore mode
ssmmxxoonn.. enter_xon_mode.......... Turn on XON/XOFF handshaking
ssnnllqq... enter_near_letter_qualitySet near-letter-quality printing
ssnnrrmmqq.. enter_normal_quality.... Set normal-quality print
sssshhmm... enter_shadow_mode....... Enable shadow printing
ssssuubbmm.. enter_subscript_mode.... Enable subscript printing
ssssuuppmm.. enter_superscript_mode.. Enable superscript printing
ssuubbccss.. subscript_characters.... List of ``subscript-able'' characters
ssuumm.... enter_upward_mode....... Enable upward carriage motion
ssuuppccss.. superscript_characters.. List of ``superscript-able'' characters
sswwiiddmm.. enter_doublewide_mode... Enable double-wide printing
ttbbcc.... clear_all_tabs.......... Clear all tab stops+
ttssll.... to_status_line.......... Go to status line, column 1
uucc..... underline_char.......... Underscore one char and move past it
vvppaa.... row_address............. Vertical position absolute (set row)+#
wwiinndd... set_window.............. Current window is lines #1-#2, columns 3--4
xxooffffcc.. xoff_character.......... XOFF character
xxoonncc... xon_character........... XON character
zzeerroomm.. zero_motion............. No motion for subsequent character

_E_s_c_a_p_e _S_e_q_u_e_n_c_e_s
You  can use  the  following escape  sequences  with any  string-capability
entry:

     \EE        <eesscc> character
     \ee        <eesscc> character
     ^_X        <ccttrrll-_X> for any appropriate _X
     \nn        Newline
     \rr        Carriage return
     \tt        Horizontal tab
     \bb        Backspace
     \ff        Formfeed
     \ss        Space
     \_0_0_0      Value of a character in three octal digits
     \^        Literal carat
     \,        Literal comma
     \\        Literal backslash

_P_a_r_a_m_e_t_e_r_i_z_e_d _S_t_r_i_n_g_s
Cursor-addressing and  other strings  requiring parameters in  the terminal
are  described by  a  parameterized string  capability, with  pprriinnttff()-like
escape sequences in it.  Each  escape sequence is introduced with a percent
sign `%',  followed by one character that described  the type of formatting
to be performed, as follows:

     %%        Literal `%'
     %dd        Decimal integer
     %22dd       Decimal integer with at least two places
     %0022dd      Decimal integer, two places, zero padding
     %33dd       Decimal integer with at least three places
     %0033dd      Decimal integer, three places, zero padding
     %cc        Character
     %ss        String

     %pp[_i]     Push _ith parameter
     %PP[_a-_z]   Set variable [_a-_z] to ppoopp()
     %gg[_a-_z]   Push variable [_a-_z]
     %'_c'      Character constant _c
     %{_n_n}     Integer constant _n_n

     %+        Addition: ppuusshh(ppoopp() + ppoopp())
     %-        Subtraction: ppuusshh(ppoopp() - ppoopp())
     %*        Multiplication: ppuusshh(ppoopp() * ppoopp())
     %/        Division: ppuusshh(ppoopp() / ppoopp())
     %mm        Modulo: ppuusshh(ppoopp() % ppoopp())
     %&        Bitwise AND: ppuusshh(ppoopp() oopp ppoopp())
     %|        Bitwise OR: ppuusshh(ppoopp() oopp ppoopp())
     %^        Bitwise NOR: ppuusshh(ppoopp() oopp ppoopp())
     %=        Logical AND: ppuusshh(ppoopp() oopp ppoopp())
     %>        Logical OR: ppuusshh(ppoopp() oopp ppoopp())
     %<        Logical NOR: ppuusshh(ppoopp() oopp ppoopp())
     %!        Unary NOT: ppuusshh(oopp ppoopp())
     %~        Unary complement: ppuusshh(oopp ppoopp())
     %ii        Add one to first two parmameters (for ANSI terminals)

The  parameterized  mechanism  is based  on  a  stack.   % operations  push
parameters and constants onto the stack, do arithmetic and other operations
on the  top of the stack,  and print out values in  various formats.  Up to
nine parameters can be used  at once.  If-then-else testing is possible, as
is storage  in a limited  number of variables.   There is no  provision for
loops or printing strings in any format other than %ss.

For example, compare  the tteerrmmccaapp entry ccmm and the  tteerrmmiinnffoo entry ccuupp.  %+
(add space  and print as a  character) ccmm would be  treated as %pp11%' '%+%cc,
that is, push the first parameter, push space, add the top two numbers onto
the  stack, and  output the  top  item on  the stack  using character  (%cc)
format.   For the  second parameter,  change %pp11  to %pp22.   %. (print  as a
character) becomes %pp11%cc. %dd (print in decimal) becomes %pp11%dd.

As with ttggoottoo(), characters standing by themselves (no `%' sign) are output
as is.

_A_l_t_e_r_n_a_t_e _C_h_a_r_a_c_t_e_r_s
The  instruction  aaccsscc  defines  a  set  of  alternate  characters.   These
alternate  characters define,  among other things,  the characters  used to
draw boxes.

aaccsscc  is set  to  a string  composed  of pairs  of  characters.  The  first
character in each pair gives the character used by a VT100 in graphics mode
to display; the  second character is the one for  the terminal in use.  The
following table shows the VT100 graphic-character set:

     Arrow right         +
     Arrow left          ,
     Arrow down          .
     Full block (inverted space)00
     Lantern             II
     Arrow up            -
     Diamond             '
     Checkboard          aa
     Degree              ff
     +/- Sign            gg
     Centered rectangles hh
     Lower right corner  jj
     Upper right corner  kk
     Upper left corner   ll
     Lower left corner   mm
     Cross               nn
     Upper horizontal lineoo
     Middle horizontal lineqq
     Lower horizontal liness
     Left tee            tt
     Right tee           uu
     Lower tee           vv
     Upper tee           ww
     Vertical line       xx
     Centered dot        ~

_C_h_a_n_g_e_s _f_r_o_m _t_e_r_m_c_a_p _t_o _t_e_r_m_i_n_f_o
This section describes features of tteerrmmiinnffoo that tteerrmmccaapp does not contain.

_D_e_f_a_u_l_t_s
tteerrmmiinnffoo  does not  contain every  default found  in tteerrmmccaapp.  tteerrmmccaapp, for
example,  assumed that  \r was  a  carriage return  unless nncc  was present,
indicating  that  it  did  not  work,  or ccrr  was  present,  indicating  an
alternative.  In  tteerrmmiinnffoo, if  ccrr is present,  the string so  given works;
otherwise it should be assumed _n_o_t to work.  The bbss and bbcc capabilities are
replaced by ccuubb and ccuubb11.  (The  former takes a parameter, moving left that
many spaces.   The latter  is probably more  common in terminals  and moves
left  one space.)  nnll (linefeed)  has been split  into two  functions: ccuudd11
(moves the  cursor down one  line) and iinndd (scroll  forward).  ccuudd11 applies
when the  cursor is not on  the bottom line, iinndd applies when  it is on the
bottom line.  The bell capability is now explicitly given as bbeell.

The  tteerrmmiinnffoo data  base is  compiled, unlike termcap.   This means  that a
tteerrmmiinnffoo source file (describing some set of terminals) is processed by the
terminfo compiler, producing a binary description of the terminal in a file
under  /uussrr/lliibb/tteerrmmiinnffoo. The  function sseettuupptteerrmm()  reads this  file.  The
advantage to  compilation is that  starting up a program  using tteerrmmiinnffoo is
faster.  The  increase in speed comes  partly from not having  to skip past
other terminal descriptions, and partly from the compiler having sorted the
capabilities into order so that a linear scan can read them in.

The tteerrmmiinnffoo compiler ttiicc uses  the environment variable TTEERRMMIINNFFOO to be the
destination  directory  of  the new  object  files.   It  is  also used  by
sseettuupptteerrmm() to find  an entry for a given terminal.   First it looks in the
directory   given   in   TTEERRMMIINNFFOO  and,   if   not   found  there,   checks
/uussrr/lliibb/tteerrmmiinnffoo.

_B_a_s_i_c _E_x_a_m_p_l_e
The following  gives the  tteerrmmiinnffoo description  for a simple  terminal, the
Lear-Siegler ADM-3:

    adm3|3|lsi adm3,
        cr=^M, cud1=^J, ind=^J, bel=^G,
        am, cub1=^H, clear=^Z, lines#24, cols#80

As you  can see,  the description  is divided into  comma-separated fields.
The following discusses each field in detail.

aaddmm33|33|llssii aaddmm33,
        The first field names  the terminal.  This field  is unique in that
        it is divided into  a number of sub-fields,  which are separated by
        vertical bar  characters.  The  first sub-field  gives the  name by
        which the  terminal is  normally addressed in  a program;  the last
        gives a longer, descriptive name.

ccrr=^MM,  To move the cursor to the left margin, send <ccttrrll-MM>.

ccuudd11=^JJ,
        To move the cursor down one row, send <ccttrrll-JJ>.

iinndd=^JJ,
        To scroll the screen up, send  <ccttrrll-JJ>.  Note that the ADM-3, like
        most terminals, does  not scroll unless  the cursor is  on the last
        row.

bbeell=^GG,
        To ring the terminal's bell, send <ccttrrll-GG>.

aamm,     This boolean code  indicates that the  ADM-3 wraps to  the leftmost
        column of the of the next row when the cursor reaches the rightmost
        column.

ccuubb11=^HH,
        To move the  cursor nondestructively one  column to the  left, send
        <ccttrrll-HH>.

cclleeaarr=^ZZ,
        To clear the screen, send <ccttrrll-ZZ>.

lliinneess#2244,
        The ADM-3 has 24 rows (lines).

ccoollss#8800,
        The ADM-3 has 80 columns.

_M_o_d_i_f_y_i_n_g _a_n _E_n_t_r_y
A full discussion of how to  modify a tteerrmmiinnffoo entry is beyond the scope of
this  article.  The  references, below, name  several volumes  that discuss
this topic at length.

In  brief, modifying  a tteerrmmiinnffoo  entry requires that  you use  the command
iinnffooccmmpp to  de-compile the entry for  a given terminal, modify  the text by
hand, then use the command ttiicc to recompile and re-install the entry.

_C-_L_e_v_e_l _R_o_u_t_i_n_e_s
The library /uussrr/lliibb/lliibbccuurrsseess.aa contains a suite of C functions with which
you can read a  given terminal's tteerrmmiinnffoo capabilities.  You must reference
the tteerrmmiinnffoo  capabilities in your program as  global variables whose names
are  identical to  the  full names  of the  capabilities themselves;  e.g.,
aauuttoo_lleefftt_mmaarrggiinn.  These  functions   are  declared  in  the  header  files
<ccuurrsseess.hh>  <tteerrmm.hh>, and  <tteerrmmiinnffoo.hh>; note  that  you must  #iinncclluuddee all
three header files in your C program.

You can  call the  following functions  from within a  C program to  read a
tteerrmmiinnffoo entry:

ffiixxtteerrmm()      Set the terminal into program mode
ppuuttpp()         Write a string into _s_t_d_w_i_n
rreesseetttteerrmm()    Reset the terminal into a saved mode
sseettuupptteerrmm()    Initialize terminal capabilities
ttppaarrmm()        Output a parameterized string
ttppuuttss()        Process a capability string
vviiddaattttrr()      Set the terminal's video attributes
vviiddppuuttss()      Set video attributes into a function

sseettuupptteerrmm() initializes  a terminal.  It inhales  all terminal capabilities
at once, and performs all other system-dependent initialization.

A program should call rreesseetttteerrmm() when it exits or calls a shell escape, to
restore the  tty modes.  When it  returns from a shell  escape, the program
should call ffiixxtteerrmm() to set the tty modes back to their internal settings.

ttppaarrmm() is  a more powerful, parameterized  string mechanism.  It resembles
the tteerrmmccaapp function ttggoottoo(). ttggoottoo() is still available for compatibility.
ttppuuttss() is unchanged.

_F_i_l_e_s
/uussrr/lliibb/lliibbccuurrsseess.aa -- Routines for reading tteerrmmiinnffoo descriptions
/uussrr/lliibb/tteerrmmiinnffoo/?/* -- Directories containing compiled descriptions

_S_e_e _A_l_s_o
AAddmmiinniisstteerriinngg  CCOOHHEERREENNTT,  ccaappttooiinnffoo,  ccuurrsseess, ffiixxtteerrmm(),  iinnffooccmmpp,  ppuuttpp(),
rreesseetttteerrmm(),  sseettuupptteerrmm(),  tteerrmm,   tteerrmmccaapp,  ttiicc,  ttppaarrmm(),  ttppuuttss(),  vvii,
vviiddppuuttss()
Strang, J.,  Mui, L., O'Reilly, T.: _T_e_r_m_c_a_p  _a_n_d _T_e_r_m_i_n_f_o.  Sebastopol, CA:
O'Reilly & Associates, Inc., 1991.  _H_i_g_h_l_y _r_e_c_o_m_m_e_n_d_e_d.

_N_o_t_e_s
As mentioned above, each tteerrmmiinnffoo description is kept in its own file, in a
subdirectory of  directory /uussrr/lliibb/tteerrmmiinnffoo. Each file  is named after the
device  it describes.   Thus, to  see what  terminal devices  have tteerrmmiinnffoo
descriptions, type the command:

    ls -laR /usr/lib/terminfo

You  may wish  to redirect  the  output of  this command  into a  file, for
further study later on.

This  implementation of  tteerrmmiinnffoo was  written by  Pavel Curtis  of Cornell
University.  It was ported to COHERENT by Udo Munk.
