Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ terminfo(4) — DG/UX R4.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

curses(3X)

printf(3S)

term(5)

profile(4)

termcap(5)

captoinfo(1M)

infocmp(1M)

tic(1M)

termio(7)

ttcompat(7)

tput(1)



terminfo(4)                      DG/UX R4.11                     terminfo(4)


NAME
       terminfo - terminal and printer capability database

DESCRIPTION
       Terminfo is a compiled database of terminal and printer device
       capabilities.  The capabilities of each type of device are described
       in a data file that has a name of the following form:
       /usr/lib/terminfo/?/*, where * stands for the device name and ?
       stands for the first character of the name.  For example,

              /usr/lib/terminfo/d/d215

       is the terminfo entry for Data General's DASHER D215 terminal and
       terminals that behave like it.

       Terminfo data files are obtained by compiling source descriptions
       with the tic(1M) command.  Terminfo source descriptions describe, in
       special code, how basic operations are performed on a terminal or
       printer.  They also describe padding requirements, initialization
       sequences, and so on.  The section entitled "Preparing a Terminfo
       Description" explains how to build a terminfo source description.
       Applications such as vi(1) and curses(3X) refer to the compiled
       terminfo database so that they can work with a variety of terminals
       without changes to the program code.

       Entries in a terminfo source file consist of a number of comma-
       separated fields.  The white space after each comma is ignored.  The
       first line names the device, and the remaining lines describe its
       capabilities.

   Device Names
       The first line of each device description in the terminfo source file
       gives the names by which terminfo knows the device.  Each name is
       separated by bar ( | ) characters.  The first name specifies the most
       common abbreviation for the device (this is the one to use for the
       environment variable TERM; see profile(4)).  The last name should be
       a long name that fully identifies the device.  All other names are
       synonyms for the device name.  All names but the last should contain
       no blanks; the last, verbose name may contain blanks for readability.

       Device names (except for the verbose entry) should be chosen using
       the following conventions.  First, the particular vendor and model of
       the device should be specified in the root name, for example, att4425
       for the AT&T 4425 terminal.  Second, device modes or user preferences
       should be indicated by appending a hyphen and an indicator of the
       mode, for example, d410-w for the Data General DASHER D410 series in
       wide mode (more than 80 columns).  See term(5) for examples and more
       information on choosing names and synonyms.

   Device Capabilities
       Lines after the first line of a device description describe the
       device's capabilities.  Terminfo device capabilities are of three
       general types: boolean capabilities indicate that the device has some
       particular feature, numeric capabilities specify a numeric value
       associated with a particular feature, for example, the size of a
       terminal screen, and string capabilities give a sequence which can be
       used to perform particular device operations.

       In the table below, the variable is the name by which a C programmer
       (at the terminfo level) accesses the capability.  The capname is the
       short name for this variable used in the text of the database.  It is
       used by a person updating the database and by the tput(1) command
       when asking what the value of the capability is for a particular
       device.  See Also refers to the numbered subsection in "Terminfo
       Terminal Capabilities" or the lettered subsection in "Terminfo
       Printer Capabilities" where the capability is described in detail.

       Capability names have no fixed length limit, but an informal limit of
       5 characters has been adopted to keep them short.  Most of the time,
       names are chosen to be the same as or similar to the ANSI X3.64-1979
       standard.  Semantics are also intended to match those of the
       description.

       All string capabilities listed below may have padding described, with
       the exception of those used for input.  Input capabilities, listed
       under the strings section in the table below, have names beginning
       with key.  The following indicators may appear at the end of the
       description for a variable.

       (G)    indicates that the string needs to be instantiated by tparm()
              with arguments (parms) as given (#i as described below).
              Tparm() will substitute the arguments into the string to
              create a customized version.  (See curses(3X) for more
              information on tparm() and the strings it creates.)

       (*)    indicates that padding may be based on the number of lines
              affected.

       (#i)   indicates the ith parameter.

           Variable          Cap-     See               Description
                             name     Also

   Boolean Capabilities:
   auto_left_margin          bw       1    cub1 wraps back from column 0
   auto_right_margin         am       1,13 Device has automatic margins
   back_color_erase          bce      12   Screen erased with background color
   can_change                ccc      12   Device can redefine existing color
   ceol_standout_glitch      xhp      14   Standout not erased by overwriting
                                           (HP)
   col_addr_glitch           xhpa     B    Only positive motion for hpa/mhpa
   cpi_changes_res           cpix     A,G  Character pitch affects resolution
   cr_cancels_micro_mode     crxm     B    Using cr disables micro mode
   dest_tabs_magic_smso      xt       13   Destructive tabs, magic smso
                                           character (t1061)
   eat_newline_glitch        xenl     14   Newline ignored after 80 columns
                                           (Concept)
   erase_overstrike          eo       6    Overstrikes are erased by blanks
   generic_type              gn       13   Generic line type
                                           (e.g., dialup, switch)
   hard_copy                 hc       1    Hardcopy device
   hard_cursor               chts     6    Cursor is hard to see
   has_meta_key              km       13   Device can send meta-characters
                                           (e.g., key sets eighth bit)
   has_print_wheel           daisy    E    Printer needs operator to change
                                           character sets
   has_status_line           hs       10   Terminal has extra ``status line''
   hue_lightness_saturation  hls      12   Device uses only HLS color notation
                                           (Tektronix)
   insert_null_glitch        in       5    Insert mode distinguishes nulls
   lpi_changes_res           lpix     A,G  Line pitch affects resolution
   memory_above              da       4    Display may be retained above screen
   memory_below              db       4    Display may be retained below screen
   move_insert_mode          mir      5    Safe to move in insert mode
   move_standout_mode        msgr     6    Safe to move in standout modes
   needs_xon_xoff            nxon     14   Padding won't work, XON/XOFF needed
   no_esc_ctlc               xsb      14   Beehive (F1=<ESC>, F2=<Ctrl-C>)
   no_pad_char               npc      13   Pad character doesn't exist
   non_dest_scroll_region    ndscr    4    Scrolling region is non-destructive
   non_rev_rmcup             nrrmc    6    smcup does not reverse rmcup
   over_strike               os       1,6  Device overstrikes (hardcopy device)
   prtr_silent               mc5i     13   Printer won't echo on screen
   row_addr_glitch           xvpa     B    Only positive motion for vpa/mvpa
   semi_auto_right_margin    sam      B    Printing in last column causes cr
   status_line_esc_ok        eslok    10   Escape sequences work on status line
   tilde_glitch              hz       14   Hazeltine; can't print tildes (~)
   transparent_underline     ul       6    Underline character overstrikes
   xon_xoff                  xon      1,13 Device uses XON/XOFF handshaking

   Numeric Capabilities:
   buffer_capacity           bufsz    I    Bytes buffered before printing
   buttons                   btns     13   Number of buttons on the mouse
   columns                   cols     1    Number of columns in a line
   dot_horz_spacing          spinh    F    Horizontal dot spacing (dots/inch)
   dot_vert_spacing          spinv    F    Vertical pin spacing (pins/inch)
   init_tabs                 it       8    Initial spacing of tab settings
   label_height              lh       7    Number of rows in each soft label
   label_width               lw       7    Number of columns in each soft label
   lines                     lines    1    Number of lines on screen or page
   lines_of_memory           lm       13   Lines of memory; variable if 0
   magic_cookie_glitch       xmc      6    Number of blanks left by smso/rmso
   max_attributes            ma       6    max combined video attributes
                                           terminal can display
   max_colors                colors   12   Maximum number of colors on-screen
   max_micro_address         maddr    B    Maximum limit on micro...address
   max_micro_jump            mjump    B    Maximum limit on parm...micro
   max_pairs                 pairs    12   Maximum number of color-pairs
   maximum_windows           wnum     4    Maximum number of definable windows
   micro_col_size            mcs      A    Horizontal step size in micro mode
   micro_line_size           mls      A    Vertical step size in micro mode
   no_color_video            ncv      12   Video attributes unusable with color
   num_labels                nlab     7    Number of soft labels available
                                           (starting from 1)
   number_of_pins            npins    F    Number of pins in print head
   output_res_char           orc      A    Horizontal resolution (steps/column)
   output_res_horz_inch      orhi     A    Horizontal resolution (steps/inch)
   output_res_line           orl      A    Vertical resolution (steps/line)
   output_res_vert_inch      orvi     A    Vertical resolution (steps/inch)
   padding_baud_rate         pb       9    Lowest baud rate requiring padding
   print_rate                cps      I    Average speed (characters/second)
   virtual_terminal          vt       13   UNIX system virtual terminal number
   wide_char_size            widcs    A    Character size in double wide mode
   width_status_line         wsl      10   Number of columns in status line

   String Capabilities:
   acs_chars                 acsc     11   Graphic character set pairs aAbBcC
                                           (vt100+)
   alt_scancode_esc          scesca   E    Alternate esc for scancode emulation
   back_tab                  cbt      8    Back tab
   bell                      bel      1    Audible signal (bell)
   bit_image_carriage_return bicr     F    Move to beginning of same row
   bit_image_entwining       bitwin   F    Number of passes for each
                                           bit-image row
   bit_image_newline         binel    F    Move to next row of the bit image
   bit_image_repeat          birep    F    Repeat bit-image cell #1 #2 times
   bit_image_type            bitype   F    Type of bit-image device
   carriage_return           cr       1,9  Carriage return (*)
   change_char_pitch         cpi      A,G  Set pitch to #1 characters/inch (G)
   change_line_pitch         lpi      A,G  Set pitch to #1 lines/inch (G)
   change_res_horz           chr      A    Set horizontal resolution to #1 (G)
   change_res_vert           cvr      A    Set vertical resolution to #1 (G)
   change_scroll_region      csr      4    Scrolling area lines #1 through #2
                                           (vt100) (G)
   char_padding              rmp      5    Like ip but when in replace mode
   char_set_names            csnm     E    Name of character set #1 (G)
   clear_all_tabs            tbc      8    Clear all tab stops
   clear_margins             mgc      8    Clear left and right soft margins
   clear_screen              clear    1    Clear screen and home cursor (*)
   clr_bol                   el1      3    Clear to beginning of line
   clr_eol                   el       3,14 Clear to end of line
   clr_eos                   ed       3    Clear to end of display (*)
   code_set_init             csin     E    Init sequence for multiple codesets
   color_names               colornm  12   Give name for color #1
   column_address            hpa      2    Horizontal position to column #1 (G)
   command_character         cmdch    13   Prototype settable command character
   create_window             cwin     4    Define win #1 to go from #2,#3
                                           to #4,#5
   cursor_address            cup      2    Move cursor to row #1, column #2 (G)
   cursor_down               cud1     1    Move cursor down one line
   cursor_home               home     2    Home cursor (especially if no cup)
   cursor_invisible          civis    6    Make cursor invisible
   cursor_left               cub1     1    Move cursor left one space
   cursor_mem_address        mrcup    2    Like cup but memory relative (G)
   cursor_normal             cnorm    6    Make cursor normal (undo civis/cvvis)
   cursor_right              cuf1     1    Move cursor right one space
                                           (non-destructive)
   cursor_to_ll              ll       2    Move cursor to column 0 of last line
   cursor_up                 cuu1     2    Move cursor up one line
   cursor_visible            cvvis    6    Make cursor very visible
   define_bit_image_region   defbi    F    Define rectangular bit-image region
   define_char               defc     E    Define character #1 with width #2
                                           and descender #3 (G)
   delete_character          dch1     5    Delete character (*)
   delete_line               dl1      4    Delete line (*)
   device_type               devt     E    Indicate language/codeset support
   dial_phone                dial     13   Dial phone number #1
   dis_status_line           dsl      10   Disable status line
   display_clock             dclk     13   Display time-of-day clock
   display_pc_char           dispc    E    Display PC character
   down_half_line            hd       13   Move cursor down one half-line
                                           (forward 1/2 linefeed)
   ena_acs                   enacs    6    Initialize alternate character set
   end_bit_image_region      endbi    F    End a bit-image region
   enter_alt_charset_mode    smacs    6    Enable alternate character set mode
   enter_am_mode             smam     13   Enable automatic margins
   enter_blink_mode          blink    6    Enable blinking mode
   enter_bold_mode           bold     6    Enable bold (extra bright) mode
   enter_ca_mode             smcup    6    String to send before using cup
   enter_delete_mode         smdc     5    Begin delete mode
   enter_dim_mode            dim      6    Enable half-bright mode
   enter_doublewide_mode     swidm    D    Enable double wide printing
   enter_draft_quality       sdrfq    G    Set draft quality printing
   enter_insert_mode         smir     5    Begin insert mode
   enter_italics_mode        sitm     D    Enable italics
   enter_leftward_mode       slm      B    Enable leftward carriage motion
   enter_micro_mode          smicm    B    Enable micro motion capabilities
   enter_near_letter_quality snlq     G    Set near-letter-quality printing
   enter_normal_quality      snrmq    G    Set normal quality printing
   enter_pc_charset_mode     smpch    E    Enter PC character display mode
   enter_protected_mode      prot     6    Enable protected mode
   enter_reverse_mode        rev      6    Enable reverse video mode
   enter_scancode_mode       smsc     E    Enter PC scancode mode
   enter_secure_mode         invis    6    Enable blank mode (invisible text)
   enter_shadow_mode         sshm     D    Enable shadow printing
   enter_standout_mode       smso     6    Enable standout mode
   enter_subscript_mode      ssubm    D    Enable subscript printing
   enter_superscript_mode    ssupm    D    Enable superscript printing
   enter_underline_mode      smul     6    Enable underscore mode
   enter_upward_mode         sum      B    Enable upward carriage motion
   enter_xon_mode            smxon    13   Enable XON/XOFF handshaking
   erase_chars               ech      5    Erase #1 characters (G)
   exit_alt_charset_mode     rmacs    6    Disable alternate character set mode
   exit_am_mode              rmam     13   Disable automatic margins
   exit_attribute_mode       sgr0     6    Disable all video attributes (G)
   exit_ca_mode              rmcup    6    String to send when done with cup
   exit_delete_mode          rmdc     5    End delete mode
   exit_doublewide_mode      rwidm    D    Disable double wide printing
   exit_insert_mode          rmir     5    End insert mode
   exit_italics_mode         ritm     D    Disable italics
   exit_leftward_mode        rlm      B    Enable rightward carriage motion
                                           (the normal state)
   exit_micro_mode           rmicm    B    Disable micro motion capabilities
   exit_pc_charset_mode      rmpch    E    Disable PC character display mode
   exit_scancode_mode        rmsc     E    Disable PC scancode mode
   exit_shadow_mode          rshm     D    Disable shadow printing
   exit_standout_mode        rmso     6    Disable standout mode
   exit_subscript_mode       rsubm    D    Disable subscript printing
   exit_superscript_mode     rsupm    D    Disable superscript printing
   exit_underline_mode       rmul     6    Disable underscore mode
   exit_upward_mode          rum      B    Enable downward carriage motion
                                           (the normal state)
   exit_xon_mode             rmxon    13   Disable XON/XOFF handshaking
   fixed_pause               pause    13   Pause for 2-3 seconds
   flash_hook                hook     13   Flash the switch hook
   flash_screen              flash    6    Visible bell (must not move cursor)
   form_feed                 ff       13   Hardcopy device page eject (*)
   from_status_line          fsl      10   Return from status line
   get_mouse                 getm     13   Curses should get button events
   goto_window               wingo    4    Go to window #1
   hangup                    hup      13   Hang-up phone
   init_1string              is1      8    Device initialization string 1
   init_2string              is2      8    Device initialization string 2
   init_3string              is3      8    Device initialization string 3
   init_file                 if       8    Name of initialization data file
   init_prog                 iprog    8    Path name of initialization program
   initialize_color          initc    12   Define color #1 as RGB #2-#4 (G)
   initialize_pair           initp    12   Define color-pair #1 as RGB #2-#7 (G)
   insert_character          ich1     5    Insert new blank character
   insert_line               il1      4    Add new blank line (*)
   insert_padding            ip       5    Padding after character inserted (*)
   key_a1                    ka1      7    KEY_A1, Upper left of keypad
   key_a3                    ka3      7    KEY_A3, Upper right of keypad
   key_b2                    kb2      7    KEY_B2, Center of keypad
   key_backspace             kbs      7    KEY_BACKSPACE, Sent by backspace key
   key_beg                   kbeg     7    KEY_BEG, Sent by beginning key
                                           (beg key)
   key_btab                  kcbt     7    KEY_BTAB, Sent by back-tab key
   key_c1                    kc1      7    KEY_C1, Lower left of keypad
   key_c3                    kc3      7    KEY_C3, Lower right of keypad
   key_cancel                kcan     7    KEY_CANCEL, Sent by cancel key
   key_catab                 ktbc     7    KEY_CATAB, Sent by clear-all-tabs key
   key_clear                 kclr     7    KEY_CLEAR, Sent by clear-screen key
                                           (erase key)
   key_close                 kclo     7    KEY_CLOSE, Sent by close key
   key_command               kcmd     7    KEY_COMMAND, Sent by command key
                                           (cmd key)
   key_copy                  kcpy     7    KEY_COPY, Sent by copy key
   key_create                kcrt     7    KEY_CREATE, Sent by create key
   key_ctab                  kctab    7    KEY_CTAB, Sent by clear-tab key
   key_dc                    kdch1    7    KEY_DC, Sent by delete-character key
   key_dl                    kdl1     7    KEY_DL, Sent by delete-line key
   key_down                  kcud1    7    KEY_DOWN, Sent by cursor-down key
                                           (down-arrow key)
   key_eic                   krmir    7    KEY_EIC, Sent by end-insert-mode key
   key_end                   kend     7    KEY_END, Sent by end key
   key_enter                 kent     7    KEY_ENTER, Sent by enter/send key
   key_eol                   kel      7    KEY_EOL, Sent by
                                           clear-to-end-of-line key
   key_eos                   ked      7    KEY_EOS, Sent by
                                           clear-to-end-of-screen key
   key_exit                  kext     7    KEY_EXIT, Sent by exit key
   key_f0                    kf0      7    KEY_F(0), Sent by function key F0
   key_f1                    kf1      7    KEY_F(1), Sent by function key F1
   key_f2                    kf2      7    KEY_F(2), Sent by function key F2
   key_f3                    kf3      7    KEY_F(3), Sent by function key F3
   key_f4                    kf4      7    KEY_F(4), Sent by function key F4
   key_f5                    kf5      7    KEY_F(5), Sent by function key F5
   key_f6                    kf6      7    KEY_F(6), Sent by function key F6
   key_f7                    kf7      7    KEY_F(7), Sent by function key F7
   key_f8                    kf8      7    KEY_F(8), Sent by function key F8
   key_f9                    kf9      7    KEY_F(9), Sent by function key F9
   key_f10                   kf10     7    KEY_F(10), Sent by function key F10
   key_f11                   kf11     7    KEY_F(11), Sent by function key F11
   key_f12                   kf12     7    KEY_F(12), Sent by function key F12
   key_f13                   kf13     7    KEY_F(13), Sent by function key F13
   key_f14                   kf14     7    KEY_F(14), Sent by function key F14
   key_f15                   kf15     7    KEY_F(15), Sent by function key F15
   key_f16                   kf16     7    KEY_F(16), Sent by function key F16
   key_f17                   kf17     7    KEY_F(17), Sent by function key F17
   key_f18                   kf18     7    KEY_F(18), Sent by function key F18
   key_f19                   kf19     7    KEY_F(19), Sent by function key F19
   key_f20                   kf20     7    KEY_F(20), Sent by function key F20
   key_f21                   kf21     7    KEY_F(21), Sent by function key F21
   key_f22                   kf22     7    KEY_F(22), Sent by function key F22
   key_f23                   kf23     7    KEY_F(23), Sent by function key F23
   key_f24                   kf24     7    KEY_F(24), Sent by function key F24
   key_f25                   kf25     7    KEY_F(25), Sent by function key F25
   key_f26                   kf26     7    KEY_F(26), Sent by function key F26
   key_f27                   kf27     7    KEY_F(27), Sent by function key F27
   key_f28                   kf28     7    KEY_F(28), Sent by function key F28
   key_f29                   kf29     7    KEY_F(29), Sent by function key F29
   key_f30                   kf30     7    KEY_F(30), Sent by function key F30
   key_f31                   kf31     7    KEY_F(31), Sent by function key F31
   key_f32                   kf32     7    KEY_F(32), Sent by function key F32
   key_f33                   kf33     7    KEY_F(33), Sent by function key F33
   key_f34                   kf34     7    KEY_F(34), Sent by function key F34
   key_f35                   kf35     7    KEY_F(35), Sent by function key F35
   key_f36                   kf36     7    KEY_F(36), Sent by function key F36
   key_f37                   kf37     7    KEY_F(37), Sent by function key F37
   key_f38                   kf38     7    KEY_F(38), Sent by function key F38
   key_f39                   kf39     7    KEY_F(39), Sent by function key F39
   key_f40                   kf40     7    KEY_F(40), Sent by function key F40
   key_f41                   kf41     7    KEY_F(41), Sent by function key F41
   key_f42                   kf42     7    KEY_F(42), Sent by function key F42
   key_f43                   kf43     7    KEY_F(43), Sent by function key F43
   key_f44                   kf44     7    KEY_F(44), Sent by function key F44
   key_f45                   kf45     7    KEY_F(45), Sent by function key F45
   key_f46                   kf46     7    KEY_F(46), Sent by function key F46
   key_f47                   kf47     7    KEY_F(47), Sent by function key F47
   key_f48                   kf48     7    KEY_F(48), Sent by function key F48
   key_f49                   kf49     7    KEY_F(49), Sent by function key F49
   key_f50                   kf50     7    KEY_F(50), Sent by function key F50
   key_f51                   kf51     7    KEY_F(51), Sent by function key F51
   key_f52                   kf52     7    KEY_F(52), Sent by function key F52
   key_f53                   kf53     7    KEY_F(53), Sent by function key F53
   key_f54                   kf54     7    KEY_F(54), Sent by function key F54
   key_f55                   kf55     7    KEY_F(55), Sent by function key F55
   key_f56                   kf56     7    KEY_F(56), Sent by function key F56
   key_f57                   kf57     7    KEY_F(57), Sent by function key F57
   key_f58                   kf58     7    KEY_F(58), Sent by function key F58
   key_f59                   kf59     7    KEY_F(59), Sent by function key F59
   key_f60                   kf60     7    KEY_F(60), Sent by function key F60
   key_f61                   kf61     7    KEY_F(61), Sent by function key F61
   key_f62                   kf62     7    KEY_F(62), Sent by function key F62
   key_f63                   kf63     7    KEY_F(63), Sent by function key F63
   key_find                  kfnd     7    KEY_FIND, Sent by find key
   key_help                  khlp     7    KEY_HELP, Sent by help key
   key_home                  khome    7    KEY_HOME, Sent by home key
   key_ic                    kich1    7    KEY_IC, Sent by insert-character key
                                           (enter-insert-mode key)
   key_il                    kil1     7    KEY_IL, Sent by insert-line key
   key_left                  kcub1    7    KEY_LEFT, Sent by cursor-left key
                                           (left-arrow key)
   key_ll                    kll      7    KEY_LL, Sent by home-down key
   key_mark                  kmrk     7    KEY_MARK, Sent by mark key
   key_message               kmsg     7    KEY_MESSAGE, Sent by message key
   key_mouse                 kmous    13   KEY_MOUSE, 0631, Mouse event
                                           has occurred
   key_move                  kmov     7    KEY_MOVE, Sent by move key
   key_next                  knxt     7    KEY_NEXT, Sent by next-object key
   key_npage                 knp      7    KEY_NPAGE, Sent by next-page key
   key_open                  kopn     7    KEY_OPEN, Sent by open key
   key_options               kopt     7    KEY_OPTIONS, Sent by options key
   key_ppage                 kpp      7    KEY_PPAGE, Sent by previous-page key
   key_previous              kprv     7    KEY_PREVIOUS, Sent by
                                           previous-object key
   key_print                 kprt     7    KEY_PRINT, Sent by print key
                                           (copy key)
   key_redo                  krdo     7    KEY_REDO, Sent by redo key
   key_reference             kref     7    KEY_REFERENCE, Sent by reference key
                                           (ref key)
   key_refresh               krfr     7    KEY_REFRESH, Sent by refresh key
   key_replace               krpl     7    KEY_REPLACE, Sent by replace key
   key_restart               krst     7    KEY_RESTART, Sent by restart key
   key_resume                kres     7    KEY_RESUME, Sent by resume key
   key_right                 kcuf1    7    KEY_RIGHT, Sent by cursor-right key
                                           (right-arrow key)
   key_save                  ksav     7    KEY_SAVE, Sent by save key
   key_sbeg                  kBEG     7    KEY_SBEG, Sent by shifted
                                           beginning key
   key_scancel               kCAN     7    KEY_SCANCEL, Sent by shifted
                                           cancel key
   key_scommand              kCMD     7    KEY_SCOMMAND, Sent by shifted
                                           command key (cmd key)
   key_scopy                 kCPY     7    KEY_SCOPY, Sent by shifted copy key
   key_screate               kCRT     7    KEY_SCREATE, Sent by shifted
                                           create key
   key_sdc                   kDC      7    KEY_SDC, Sent by shifted
                                           delete-character key
   key_sdl                   kDL      7    KEY_SDL, Sent by shifted
                                           delete-line key
   key_select                kslt     7    KEY_SELECT, Sent by select key
   key_send                  kEND     7    KEY_SEND, Sent by shifted end key
   key_seol                  kEOL     7    KEY_SEOL, Sent by shifted
                                           clear-to-end-of-line key
   key_sexit                 kEXT     7    KEY_SEXIT, Sent by shifted exit key
   key_sf                    kind     7    KEY_SF, Sent by scroll-forward key
                                           (scroll-down key)
   key_sfind                 kFND     7    KEY_SFIND, Sent by shifted find key
   key_shelp                 kHLP     7    KEY_SHELP, Sent by shifted help key
   key_shome                 kHOM     7    KEY_SHOME, Sent by shifted home key
   key_sic                   kIC      7    KEY_SIC, Sent by shifted input key
   key_sleft                 kLFT     7    KEY_SLEFT, Sent by shifted
                                           cursor-left key (left-arrow key)
   key_smessage              kMSG     7    KEY_SMESSAGE, Sent by shifted
                                           message key
   key_smove                 kMOV     7    KEY_SMOVE, Sent by shifted move key
   key_snext                 kNXT     7    KEY_SNEXT, Sent by shifted next key
   key_soptions              kOPT     7    KEY_SOPTIONS, Sent by shifted
                                           options key
   key_sprevious             kPRV     7    KEY_SPREVIOUS, Sent by shifted
                                           previous-object key
   key_sprint                kPRT     7    KEY_SPRINT, Sent by shifted
                                           print key
   key_sr                    kri      7    KEY_SR, Sent by scroll-backward key
                                           (scroll-up key)
   key_sredo                 kRDO     7    KEY_SREDO, Sent by shifted redo key
   key_sreplace              kRPL     7    KEY_SREPLACE, Sent by shifted
                                           replace key
   key_sright                kRIT     7    KEY_SRIGHT, Sent by shifted
                                           cursor-right key (right-arrow key)
   key_srsume                kRES     7    KEY_SRSUME, Sent by shifted
                                           resume key
   key_ssave                 kSAV     7    KEY_SSAVE, Sent by shifted save key
   key_ssuspend              kSPD     7    KEY_SSUSPEND, Sent by shifted
                                           suspend key
   key_stab                  khts     7    KEY_STAB, Sent by set-tab key
   key_sundo                 kUND     7    KEY_SUNDO, Sent by shifted undo key
   key_suspend               kspd     7    KEY_SUSPEND, Sent by suspend key
   key_undo                  kund     7    KEY_UNDO, Sent by undo key
   key_up                    kcuu1    7    KEY_UP, Sent by cursor-up key
                                           (up-arrow key)
   keypad_local              rmkx     7    Disable ``keypad-transmit'' mode
   keypad_xmit               smkx     7    Enable ``keypad-transmit'' mode
   lab_f0                    lf0      7    Label on function key F0 if not F0
   lab_f1                    lf1      7    Label on function key F1 if not F1
   lab_f2                    lf2      7    Label on function key F2 if not F2
   lab_f3                    lf3      7    Label on function key F3 if not F3
   lab_f4                    lf4      7    Label on function key F4 if not F4
   lab_f5                    lf5      7    Label on function key F5 if not F5
   lab_f6                    lf6      7    Label on function key F6 if not F6
   lab_f7                    lf7      7    Label on function key F7 if not F7
   lab_f8                    lf8      7    Label on function key F8 if not F8
   lab_f9                    lf9      7    Label on function key F9 if not F9
   lab_f10                   lf10     7    Label on function key F10 if not F10
   label_format              fln      7    Label format
   label_off                 rmln     7    Disable soft labels
   label_on                  smln     7    Enable soft labels
   meta_off                  rmm      13   Disable ``meta mode''
   meta_on                   smm      13   Enable ``meta mode'' (eight-bit I/O)
   micro_column_address      mhpa     B    Like columnaddress for micro
                                           adjustment (G)
   micro_down                mcud1    B    Like cursordown for micro
                                           adjustment
   micro_left                mcub1    B    Like cursorleft for micro
                                           adjustment
   micro_right               mcuf1    B    Like cursorright for micro
                                           adjustment
   micro_row_address         mvpa     B    Like rowaddress for micro
                                           adjustment (G)
   micro_up                  mcuu1    B    Like cursorup for micro adjustment
   mouse_info                minfo    13   Mouse status information
   newline                   nel      1    Newline (like CR followed by LF)
   order_of_pins             porder   F    Matches data bits to print head pins
   orig_colors               oc       12   Set all color(-pair)s to defaults
   orig_pair                 op       12   Set color-pair to the default (G)
   pad_char                  pad      13   Pad character (rather than null)
   parm_dch                  dch      5    Delete #1 characters (G*)
   parm_delete_line          dl       4    Delete #1 lines (G*)
   parm_down_cursor          cud      1    Move cursor down #1 lines (G*)
   parm_down_micro           mcud     B    Like parmdowncursor for micro
                                           adjustment (G)
   parm_ich                  ich      4    Insert #1 blank characters (G*)
   parm_index                indn     1    Scroll forward #1 lines (G)
   parm_insert_line          il       4    Add #1 new blank lines (G*)
   parm_left_cursor          cub      1    Move cursor left #1 spaces (G)
   parm_left_micro           mcub     B    Like parmleftcursor for micro
                                           adjustment (G)
   parm_right_cursor         cuf      1    Move cursor right #1 spaces (G*)
   parm_right_micro          mcuf     B    Like parmrightcursor for micro
                                           adjustment (G)
   parm_rindex               rin      1    Scroll backward #1 lines (G)
   parm_up_cursor            cuu      1    Move cursor up #1 lines (G*)
   parm_up_micro             mcuu     B    Like parmupcursor for micro
                                           adjustment (G)
   pc_term_options           pctrm    E    PC terminal options
   pkey_key                  pfkey    7    Program PFkey #1 to type #2 (G)
   pkey_local                pfloc    7    Program PFkey #1 to execute #2 (G)
   pkey_plab                 pfxl     7    Prog key #1 to xmit string #2 and
                                           show string #3
   pkey_xmit                 pfx      7    Program PFkey #1 to transmit #2 (G)
   plab_norm                 pln      7    Program soft label #1 to show #2 (G)
   print_screen              mc0      13   Print contents of screen
   prtr_non                  mc5p     13   Enable printer for #1 bytes
   prtr_off                  mc4      13   Disable printer
   prtr_on                   mc5      13   Enable printer
   pulse                     pulse    13   Select pulse dialing
   quick_dial                qdial    13   Dial phone number #1, without
                                           progress detection
   remove_clock              rmclk    13   Remove time-of-day clock
   repeat_char               rep      13   Repeat character #1 #2 times (G*)
   req_for_input             rfi      13   Send next input character (for ptys)
   req_mouse_pos             reqmp    13   Request mouse position report
   reset_1string             rs1      8    Device full reset string 1
   reset_2string             rs2      8    Device full reset string 2
   reset_3string             rs3      8    Device full reset string 3
   reset_file                rf       8    Name of file containing reset string
   restore_cursor            rc       4,10 Move cursor to position of last sc
   row_address               vpa      2    Vertical position to row #1 (G)
   save_cursor               sc       4,10 Save cursor position for next rc
   scancode_escape           scesc    E    Escape for scancode emulation
   scroll_forward            ind      1    Scroll text up one line
   scroll_reverse            ri       1    Scroll text down one line
   select_char_set           scs      E    Select character set #1 (G)
   set0_des_seq              s0ds     E    Shift into codeset 0 (EUC set 0)
   set1_des_seq              s1ds     E    Shift into codeset 1
   set2_des_seq              s2ds     E    Shift into codeset 2
   set3_des_seq              s3ds     E    Shift into codeset 3
   set_a_background          setab    12   Set background color using ANSI esc
   set_a_foreground          setaf    12   Set foreground color using ANSI esc
   set_attributes            sgr      6    Define video attributes #1-#9 (G)
   set_background            setb     12   Set active background color to #1 (G)
   set_bottom_margin         smgb     C    Set bottom margin at current line
   set_bottom_margin_parm    smgbp    C    Set bottom margin at line #1 or
                                           #2 lines from bottom (G)
   set_clock                 sclk     13   Set time-of-day clock
   set_color_band            setcolor 12   Change to ribbon color #1
   set_color_pair            scp      12   Set current color-pair to #1 (G)
   set_foreground            setf     12   Set active foreground color to #1 (G)
   set_left_margin           smgl     8    Set soft left margin
   set_left_margin_parm      smglp    C    Set left margin at column #1
                                           (right margin at #2) (G)
   set_lr_margin             smglr    8    Sets both left and right margins
   set_page_length           slines   J    Set page length to #1 lines (G)
   set_right_margin          smgr     8    Set soft right margin
   set_right_margin_parm     smgrp    C    Set right margin at column #1 (G)
   set_tab                   hts      8    Set tab in all rows, current column
   set_tb_margin             smgtb    C    Sets both top and bottom margins
   set_top_margin            smgt     C    Set top margin at current line
   set_top_margin_parm       smgtp    C    Set top margin at line #1
                                           (bottom margin at line #2) (G)
   set_window                wind     4    Set current window to lines #1-#2,
                                           columns #3-#4 (G)
   start_bit_image           sbim     F    Start printing bit image graphics,
                                           #1 dots wide (G)
   start_char_set_def        scsd     E    Start defining character set #1,
                                           containing #2 characters (G)
   stop_bit_image            rbim     F    End printing bit image graphics
   stop_char_set_def         rcsd     E    End defining character set #1 (G)
   subscript_characters      subcs    D    ``Subscript-able'' characters
   superscript_characters    supcs    D    ``Superscript-able'' characters
   tab                       ht       8    Tab to next hardware tab stop
   these_cause_cr            docr     B    Any of these characters causes cr
   to_status_line            tsl      10   Go to status line, column #1 (G)
   tone                      tone     13   Select touch tone dialing
   underline_char            uc       6    Underscore character and move past
   up_half_line              hu       13   Move up one half-line
                                           (reverse 1/2 linefeed)
   user0                     u0       13   User string 0
   user1                     u1       13   User string 1
   user2                     u2       13   User string 2
   user3                     u3       13   User string 3
   user4                     u4       13   User string 4
   user5                     u5       13   User string 5
   user6                     u6       13   User string 6
   user7                     u7       13   User string 7
   user8                     u8       13   User string 8
   user9                     u9       13   User string 9
   wait_tone                 wait     13   Wait for dial tone
   xoff_character            xoffc    13   XOFF character
   xon_character             xonc     13   XON character
   zero_motion               zerom    B    No motion for subsequent character

PREPARING A TERMINFO DESCRIPTION
       At a minimum for a terminal, a terminfo source file should specify
       capabilities to do the following:

       - Clear the screen
       - Specify screen size
       - Specify how to scroll the screen
       - Specify how to move the cursor to any point on the screen
       - Display whatever graphic embellishments are available (e.g.,
              reverse video)
       - Specify whether the cursor wraps around when it reaches the end of
              a line
       - Specify a scrolling region, if possible
       - Insert and delete lines and characters, if available
       - Save and restore the cursor position, if possible
       - Describe special keys, if any
       - Specify how to handle special cases of terminal behavior, if any

       The most effective way to prepare a new device description is by
       imitating the description of a similar device in terminfo and
       building up the new description gradually, testing whether vi(1)
       works with the compiled description.  That is, first create a
       terminfo source file that includes what you have determined to be the
       minimum set of capabilities needed for the new device.  Next, compile
       the source with the tic(1M) command.  Use vi(1) and determine whether
       the device displays what it is supposed to display.  Make alterations
       or add more advanced capabilities to the source file as appropriate,
       recompile the source, and repeat the test.  Repeat this cycle until
       the description is complete and correct.

       You can obtain the source description for a given device by using the
       -I option of infocmp(1M).  You may copy and edit this description to
       accurately describe the device that you wish to enter into the
       terminfo database.  Most reference manuals for terminals and printers
       list the codes that make the device perform specific operations.  Use
       these codes to describe capabilities of the new device.

       To test a new device description, set the environment variable
       TERMINFO to the pathname of a directory containing the compiled
       description.  Programs will then search that directory for terminal
       information instead of /usr/lib/terminfo.  To get the padding for
       insert-line correct on a terminal (if the manufacturer did not
       document it) a severe test is to comment out xon, edit a large file
       at 9600 baud with vi(1), delete 16 or so lines from the middle of the
       screen, then hit the u key several times quickly.  If the display is
       corrupted, more padding is usually needed.  An analogous test can be
       used for insert-character.

       Be aware that a very unusual device may expose deficiencies in the
       ability of terminfo to describe it or the ability of programs such as
       vi(1) to work with that device.

   Similar Devices
       If there are two very similar devices, one can be defined as being
       just like the other with certain exceptions.  The string capability
       use can be given with the name of the similar device.  The
       capabilities given before use override those in the device type
       included by use.

       More than one use capability may be specified.  Statements that
       contain use exhibit left-to-right precedence.  That is, the earliest
       use statement has priority when more than one statement defines the
       same capability.

       A capability can be canceled by placing @ to the left of the
       capability definition.  For example:

           att4424-2|Teletype 4424 in display function group ii,
               rev@, sgr@, smul@, use=att4424,

       defines an AT&T 4424 terminal that does not have the rev, sgr, and
       smul capabilities, and hence cannot do highlighting.  This is useful
       for different modes of a device, or for different user preferences.

   Parameterized Strings
       Cursor addressing and other strings requiring parameters for the
       device are described by a parameterized string capability, with
       printf(3S)-like escapes (%x) in it.  The parameter mechanism uses a
       stack and special % codes to manipulate it in the manner of a Reverse
       Polish Notation (postfix) calculator.

       Typically a sequence pushes one of the parameters onto the stack and
       then prints it in some format.  When a sequence pushes a value, the
       value is placed onto the top of the terminfo stack, leaving the
       source unchanged.  The complement to a "push" is the "pop", which
       removes the topmost value from the terminfo stack, storing it
       elsewhere or using it in the current calculation.

          Stack and Variable Manipulation

       Parameterized strings can access arguments passed to tparm().  The
       arguments are referenced positionally, by number from 1 to 9.
       Terminfo also provides 52 variables that parameterized strings can
       use.  The variables are referenced by letter from a to z and from A
       to Z.  The lowercase variable names represent automatic variables
       that do not retain their values between parameterized strings.  The
       uppercase variable names represent static variables that do retain
       their values.

       %p[1-9]     Push the indicated parameter.
       %'c'        Push the character constant 'c'.
       %{n}        Push the one or two digit decimal number constant n.
       %P[a-zA-Z]  Pop the stack into the indicated variable.
       %g[a-zA-Z]  Push the current contents of the indicated variable.

          Printing Operations

       The following escapes print a value in a specified format.

       %%     Print the `%' character.
       %c     Pop the stack and print the value without interpretation, that
              is, as a single character.
       %[[:]flags][width[.precision]][doxXs]
              Pop the stack and print the value as a formatted string,
              converting to decimal (d), octal (o), lowercase hexadecimal
              (x), uppercase hexadecimal (X), or character (s) data as
              indicated.  For information on the flags, width, and precision
              fields, and more information on the conversions, consult
              printf(3S).  (The flags supported are -, +, #, and the space
              character.)

              NOTE:  The - flag must be preceded by a colon (:) to
              differentiate the flag from the %- escape described below.

          Arithmetic Operations

       The following escapes pop one or two operands off the stack, perform
       some arithmetic operation, and then push the result onto the stack.
       Binary operations are in postfix form and expect the first operand to
       be on the top of the stack.

       NOTE:  Whether arithmetic is signed or unsigned is unspecified.

       %+     Push the sum of the two topmost values on the stack.
       %-     Push the difference of the two topmost values on the stack.
       %*     Push the product of the two topmost values on the stack.
       %/     Push the quotient of the two topmost values on the stack.
       %m     Push the modulus of the two topmost values on the stack.
       %&     Push the bitwise AND of the two topmost values on the stack.
       %|     Push the bitwise OR of the two topmost values on the stack.
       %^     Push the bitwise exclusive OR of the two topmost values on the
              stack.
       %~     Bitwise complement the topmost value on the stack.

          Logical Operations

       The following escapes are like arithmetic operations except that they
       return boolean values.  They pop one or two operands off the stack,
       perform some logical operation, and then push the result onto the
       stack.  Possible results are 0 for FALSE, or 1 for TRUE.

       NOTE:  For logical operands, any nonzero value is considered TRUE.

       %=     Push TRUE if the two topmost operands are numerically equal.
       %>     Push TRUE if the second operand is greater than the topmost
              operand.
       %<     Push TRUE if the second operand is less than the topmost
              operand.
       %A     Push TRUE if the two topmost operands are both logically TRUE
              (AND).
       %O     Push TRUE if either of the two topmost operands are logically
              TRUE (OR).
       %!     Logically invert the topmost operand (NOT).

          Miscellaneous Operations


       %l     Pop the stack, then push the length of the string indicated by
              that value.  This escape is similar to strlen(3C).
       %i     Add one to the first two parameters passed to tparm(), or to
              the single parameter if just one was passed.  This is useful
              for ANSI terminals, which number cursor positions starting
              from one instead of zero.
       %?expr%tthen%;
       %?expr%tthen%eelse%;
              "If-Then" and "If-Then-Else" (conditional) statements.  Expr,
              then, and else are all parameterized substrings.  In
              operation, terminfo evaluates expr and then pops the stack.
              If the popped value is logically TRUE, then is evaluated.
              Otherwise, if else was provided, else is evaluated.  (expr
              typically calculates some logical expression, and then and
              else typically print corresponding strings.)

              "If-Then-ElseIf" conditionals can be written as a string of
              "If-Then-Else" statements ala Algol 68, that is:

              %?  c1 %t b1 %e c2 %t b2 ...  %e cN %t bN %e E %;

              where c[1-N] are conditionals like expr, b[1-N] are bodies
              like then, and E is a body like else.

   A Sample Entry
       The following entry, which describes the Concept-100 terminal, is
       among the more complex entries in the terminfo file as of this
       writing.  It is provided here to illustrate the form and content of a
       terminfo entry, and to provide a point of reference for the text that
       follows.

         concept100|c100|concept|c104|c100-4p|concept 100,
            am, db, eo, in, mir, ul, xenl,
            cols#80, lines#24, pb#9600, vt#8,
            bel=^G, blank=\EH, blink=\EC, clear=^L$<2*>, cnorm=\Ew, cr=^M$9,
            cub1=^H, cud1=^J, cuf1=\E=, cup=\Ea%p1%' '%+%c%p2%' '%+%c,
            cuu1=\E;, cvvis=\EW, dch1=\E^A$<16*>, dim=\EE, dl1=\E^B$<3*>,
            ed=\E^C$<16*>, el=\E^U$16, flash=\Ek$<20>\EK, ht=\t$8,
            il1=\E^R$<3*>, .ind=^J$9, ind=^J, ip=$<16*>,
            is2=\EU\Ef\E7\E5\E8\El\ENH\EK\E\0\Eo&\0\Eo\47\E, kbs=^h,
            kcub1=\E>, kcud1=\E<, kcuf1=\E=, kcuu1=\E;, kf1=\E5, kf2=\E6,
            kf3=\E7, khome=\E?, prot=\EI, rep=\Er%p1%c%p2%' '%+%c$<.2*>,
            rev=\ED, rmcup=\Ev\s\s\s\s$<6>\Ep\r\n, rmir=\E\0, rmkx=\Ex,
            rmso=\Ed\Ee, rmul=\Eg, rmul=\Eg, sgr0=\EN\0,
            smcup=\EU\Ev\s\s8p\Ep\r, smir=\E^P, smkx=\EX, smso=\EE\ED,
            smul=\EG,

       Entries may continue onto multiple lines by placing white space at
       the beginning of each line except the first.  Lines beginning with
       ``#'' are interpreted as comments.

   How to Describe Device Capabilities
       In the example, the boolean capabilities appear in the second line.
       The numeric capabilities appear in the line that follows the
       booleans.  The remainder of the entry consists of string
       capabilities.

       The fact that a device has ``automatic margins'' (that is, an
       automatic return and linefeed when the end of a line is reached) is
       indicated by the boolean capability am.  Thus, the device description
       simply gives am.  Numeric capabilities are followed by the character
       `#' and then the value assigned.  Thus cols, which indicates the
       number of columns the device has, specifies the value 80 for the
       Concept 100 as cols#80.  The value may be specified in decimal,
       octal, or hexadecimal using normal C conventions.  Finally, string-
       valued capabilities, such as bel (sound an audible alarm) are
       specified by the two- to five-character capability name, or capname
       for short, an `=', and then a string ending at the next following
       comma.  The concept 100 responds to <Ctrl-G> by sounding its bell, so
       the description specifies bel=^G.

       A delay in milliseconds may appear anywhere in a string capability,
       bracketed by $<..>, as in el=\EK$<3>.  Padding characters are
       supplied by tputs() (see curses(3X)) to provide this delay.  The
       delay can be either a number (for example, 20); or a number followed
       by an `*' (for example, 3*), a `/' (for example, 5/), or both (for
       example, 10*/).  A `*' indicates that the padding required is
       proportional 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 character, the factor is still the number of lines
       affected.  This is always 1 unless the terminal has in defined and
       the software uses it.)  When an `*' 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.)  A `/'
       indicates that the padding is mandatory.  Otherwise, if the device
       has xon defined, the padding information is advisory and is only used
       for cost estimates or when the device is in raw mode.  Mandatory
       padding is transmitted regardless of the setting of xon.

       A number of escape sequences are provided in the string valued
       capabilities for easy encoding of characters there.  Both \E and \e
       map to an ESCAPE character, ^x maps to a <Ctrl-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 actually produces
       \200, which does not terminate a string but behaves as a null
       character on most devices.)  Finally, characters may be given as
       three octal digits after a backslash (e.g., \123).

       Sometimes individual capabilities must be commented out.  To do this,
       put a period before the capability name.  For example, see the first
       ind in the example above.  Note that when capabilities are defined
       more than once, a prior definition overrides a later definition.

TERMINFO TERMINAL CAPABILITIES
       The following subsections describe terminfo terminal capabilities in
       detail.  Subsections are numbered for cross-reference to the table
       that appears earlier in this man page.

   1. Basic Capabilities
       The number of columns on each line for the terminal is given by the
       cols numeric capability.  If the terminal has a screen, then the
       number of lines on the screen is given by the lines capability.  If
       the terminal cursor wraps around to the beginning of the next line
       when it reaches the right margin, then the am capability should be
       given.  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
       character is overwritten) then it should have the os capability.  If
       the terminal is a printing terminal, with no soft copy unit, give it
       both hc and os.  (os applies to storage scope terminals, such as the
       Tektronix 4010 series, as well as hardcopy and APL terminals.)  If
       there is a code to move the cursor to the left edge of the current
       row, give this as cr.  (Normally this is carriage return, ^M.)  If
       there is a code to produce an audible signal (bell, beep, etc) give
       this as bel.  If the terminal uses the XON-XOFF flow control
       protocol, like most terminals, specify the boolean capability xon.

       If there is a code to move the cursor one position to the left (such
       as backspace) that capability should be given as cub1.  Similarly,
       codes to move to the right, up, and down should be given as cuf1,
       cuu1, and cud1.  These local cursor motions should 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.

       It is important to remember 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 backspace around the left
       edge, unless bw is specified, and should never attempt to move the
       cursor up locally off the top.

       To scroll text up, a program moves the cursor to the bottom left
       corner of the screen and sends the ind (index) string.  To scroll
       text down, a program moves the cursor to the top left corner of the
       screen and sends the ri (reverse index) string.  The strings ind and
       ri are undefined when the cursor is not on their respective corners
       of the screen.

       Parameterized versions of the scrolling sequences are indn and rin
       which have the same semantics as ind and ri except that they take one
       parameter, and scroll that many lines.  They are also undefined
       except at the appropriate corners 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.  The only local motion which is
       defined from the left edge is if bw is given, then a cub1 from the
       left edge moves to the right edge of the previous row.  If bw is not
       given, the effect is undefined.  bw is useful for drawing a box
       around the edge of the screen, for example.  If the terminal has
       switch selectable automatic margins, the terminfo file usually
       assumes that this is on; i.e., am.  If the terminal has a command
       which 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 terminal 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 model 33 teletype is described as follows:

           33|tty33|tty|model 33 teletype,
               bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,

       The Lear Siegler ADM-3 is described as follows:

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

   2. Cursor Motions
       If the terminal has a fast way to home the cursor (to the very upper
       left corner of the 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 assumption 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 terminal has a way to move the cursor to any selected position
       on the screen, specify this with the cup string capability, which
       takes two parameters: the row and column of the new cursor position.
       (Rows and columns are numbered 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 the string capability mrcup.

       If the terminal 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 (e.g., 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 are primarily
       useful if the terminal does not have cup, as with the Tektronix 4025.

   3. 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 terminal 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.)

   4. Insert/delete line
       If the terminal can open a new blank line before the line containing
       the cursor, 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 destructive programmable scrolling region (like
       the VT100), the command to set the region can be described with the
       csr string capability, which takes two parameters: the top and bottom
       lines of the scrolling region.  It is possible to get the effect of
       insert or delete line using this command -- the sc and rc (save and
       restore cursor) string capabilities are also useful.  The cursor
       position is, alas, undefined after using this command.  It must be
       reset using other terminfo capabilities such as cup, home, or rc.
       Inserting lines at the top or bottom of the screen can also be done
       using ri or ind on many terminals without a true insert/delete line,
       and is often faster even on terminals with those features.

       To determine whether a terminal has destructive scrolling regions or
       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 scrolling regions, unless ind,
       ri, indn, rin, dl, and dl1 all simulate destructive scrolling.

       If the terminal has the ability to define a window as part of memory,
       which all commands affect, it should be given as the 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 boolean
       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.

   5. 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 (i.e., all characters to the right of the
       insertion or deletion shift as a unit).  Other terminals, such as the
       Concept-100 and the Perkin Elmer Owl, make a distinction between
       typed and untyped blanks on the screen, shifting upon an insert or
       delete only to an untyped blank on the screen which is either
       eliminated, or expanded to two untyped blanks.

       You can determine the kind of terminal you have by clearing the
       screen and then typing text separated by cursor motions.  Type
       ``abc    def'' using local cursor motions (not spaces) between the
       abc and the def.  Then position the cursor before the abc and put the
       terminal in insert mode.  If typing characters causes the rest of the
       line to shift rigidly and characters to "fall off" the end, then your
       terminal does not distinguish between blanks and untyped positions.
       If the abc shifts over to the def which then move together around the
       end of the current line and onto the next as you insert, you have the
       second type of terminal, and thus you should define the boolean
       capability 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 have seen no terminals
       whose insert mode cannot be described with the single attribute.

       Terminfo can describe both terminals which 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 do not specify
       ich1; terminals which send a sequence to open a screen position
       should specify 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 capability).  Any other sequence
       that may need to be sent after an insert of a single character may
       also be given in ip.  If your terminal needs both to be placed into
       an `insert mode' and a special code to precede each inserted
       character, then both smir/rmir and ich1 can be given, and both are
       used.

       The ich capability, with one parameter, n, repeats the effects of
       ich1 n times.

       If padding is necessary between characters typed while not in insert
       mode, give this as a number of milliseconds padding in rmp.

       It is occasionally necessary to move around while in insert mode to
       delete characters on the same line (e.g., if there is a tab after the
       insertion position).  If your terminal allows motion while in insert
       mode you can give the capability mir to speed up inserting in this
       case.  Omitting mir affects only speed.  Some terminals (notably
       Datamedia's) must not have mir because of the way their insert mode
       works.

       Finally, you can give dch1 to delete a single character, dch with one
       parameter, n, to delete n characters, and 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 explicitly moving the cursor) can be given as ech with one
       parameter.

   6. Highlighting, Underlining, and Visible Bells
       If your terminal has one or more kinds of display attributes (graphic
       embellishments to text), these can be represented in a number of
       different ways.  You should choose one display form as ``standout
       mode'' (see curses(3X)), representing a good, high contrast, easy-on-
       the-eyes format for highlighting error messages and other attention
       getters.  (If you have a choice, reverse video plus half-bright is
       good, or reverse video alone; however, different users have different
       preferences on different terminals.)  The sequences to enter and exit
       standout 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 on the TVI 912 and the Teleray 1061, then
       xmc should be given to tell how many spaces are left.

       Codes to begin underlining and end underlining can be given as smul
       and rmul respectively.  If the terminal has a code to underline the
       current character and move the cursor one space to the right, such as
       the Micro-Term MIME, this can be given as uc.

       Other capabilities to enter various highlighting modes include blink
       (blinking), bold (bold or extra-bright), dim (dim or half-bright),
       invis (blanking or invisible text), prot (protected), rev (reverse
       video), sgr0 (turn off all attribute modes), smacs (enter alternate-
       character-set mode), and rmacs (exit alternate-character-set mode).
       Turning on any of these modes singly may or may not turn off other
       modes.  If a command is necessary before alternate character set mode
       is entered, give the sequence in enacs (enable alternate-character-
       set mode).

       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 zero or non-zero, as the corresponding
       attribute is on or off.  The nine parameters are, in order: standout,
       underline, reverse, blink, dim, bold, invisible, protected, and
       alternate character set.  Not all modes need be supported by sgr,
       only those for which corresponding separate attribute commands exist.
       (See the example at the end of this section.)

       Terminals with the ``magic cookie'' glitch (xmc) deposit special
       ``cookies'' when they receive mode-setting sequences, rather than
       having extra attribute bits for each character.  These ``cookies''
       affect the display algorithm to provide video attributes, but also
       take up (blank) space on the screen.

       Some terminals, such as the Hewlett-Packard 2621, automatically leave
       standout mode when the cursor is moved to a new line or 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, padding for 200 ms, then returning 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 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 the terminal needs to be in a special mode when running a program
       that uses terminfo capabilities, the codes to enter and exit this
       mode can be given as smcup and rmcup.  This arises, for example, from
       terminals like the Concept-100 with more than one page of memory.  If
       the terminal has only memory relative cursor addressing and not
       screen relative cursor addressing, a window the size of the screen
       must be fixed into the terminal for cursor addressing to work
       properly.  This is also used for the Tektronix 4025, where smcup sets
       the command character to the one used by terminfo.  If the smcup
       sequence does not restore the screen after an rmcup sequence is
       output (to the state prior to outputting rmcup), specify the boolean
       capability nrrmc.

       If your terminal generates underlined characters by using the
       underline character (with no special codes needed) even though it
       does not otherwise overstrike characters, then you should give the
       capability ul.  For terminals where a character overstriking another
       leaves both characters on the screen, give the capability os.  If
       overstrikes are erasable with a blank, then this should be indicated
       by giving eo.

       Here is an example of highlighting: assume that a terminal needs the
       following escape sequences to turn on various modes.
                     tparm       attribute      escape sequence
                   parameter

                                 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.  Combinations of attributes are
       allowed by appending a digit that represents each attribute,
       separated by a semicolon.  For instance, underline + blink needs the
       sequence \E[0;3;5m.  Note that, as suggested above, standout is set
       up to be the combination of reverse and dim.  Also, since this
       terminal has no bold mode, bold is set up as the combination of
       reverse and underline.  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 requires either <Ctrl-O>
       or <Ctrl-N> depending on whether it is to be turned off or on.  If
       all modes were to be turned on, the sequence would be
       \E[0;3;4;5;7;8m^N.

       Now look at the cases in which different sequences are output.  For
       example, ;3 is output when either p2 or p6 is true, that is, if
       either underline or bold modes are turned on.  Writing out the above
       sequences, along with their dependencies, gives the following:
             sequence      when to output       terminfo translation

             \E[0         always                \E[0
             ;3           if p2 or p6           %?%p2%p6%|%t;3%;
             ;4           if p1 or p3 or p6     %?%p1%p3%|%p6%|%t;4%;
             ;5           if p4                 %?%p4%t;5%;
             ;7           if p1 or p5           %?%p1%p5%|%t;7%;
             ;8           if p7                 %?%p7%t;8%;
             m            always                m
             ^N or ^O     if p9 ^N, else ^O     %?%p9%t^N%e^O%;

       Putting this all together into the sgr sequence gives:

       sgr=\E[0%?%p2%p6%|%t;3%;%?%p1%p3%|%p6%|%t;4%;%?%p5%t;5%;
              %?%p1%p5%|%t;7%;%?%p7%t;8%;m%?%p9%t^N%e^O%;,

   7. Keypad
       If the terminal has a keypad that transmits codes when special keys
       are pressed, this information can be given.  Note that it is not
       possible to handle terminals where the keypad only works in local
       mode (this applies, for example, to the unshifted Hewlett-Packard
       2621 keys).  If the keypad can be set to transmit or not transmit,
       give these codes as smkx and rmkx.  Otherwise the keypad is assumed
       to always transmit.

       The codes 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 codes they send can be given 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.  Note that function key
       definitions should appear in order and you should not skip key
       definitions.  If you need to skip a key definition, dummy entries can
       be included (e.g. kf16=\0).

       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), kdch1 (delete
       character), kdl1 (delete line), krmir (exit insert mode), kel (clear
       to end of line), ked (clear to end of screen), kich1 (insert
       character or enter insert mode), kil1 (insert line), knp (next page),
       kpp (previous page), kind (scroll forward/down), kri (scroll
       backward/up), khts (set a tab stop in this column).  In addition, if
       the keypad has a 3 by 3 array of keys including the four arrow keys,
       the other five keys can be given as ka1, ka3, kb2, kc1, and kc3.
       These keys are useful when the effects of a 3 by 3 directional pad
       are needed.  Further keys are defined above in the capabilities list.

       Strings to program function keys can be given as pfkey, pfloc, and
       pfx.  A string to program their soft screen labels can be given as
       pln.  Each of these strings takes two parameters: the function key
       number to program (from 0 to 10) and the string to program it with.
       Function key numbers out of this range may program undefined keys in
       a terminal-dependent manner.  The difference between the capabilities
       is that pfkey causes the given key to act as if the user had typed
       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 capabilities nlab, lw, and lh define how many
       soft labels there are and how wide and high they are.  If there are
       commands to turn the labels on and off, give them as smln and rmln.
       smln is normally output after one or more pln sequences to make sure
       that the change becomes visible.

   8. Tabs and Initialization
       If the terminal has hardware tabs, the command to advance to the next
       tab stop can be given as ht (usually Ctrl-I).  A ``backtab'' command
       which moves leftward to the previous tab stop can be given as cbt.
       By convention, if the terminal driver modes indicate that tabs are
       being expanded by the computer rather than being sent to the
       terminal, programs should not use ht or cbt even if they are present,
       since the user may not have the tab stops properly set.

       If the terminal has hardware tabs which are initially set every n
       spaces when the terminal is powered up, the numeric parameter it
       should be given, showing the number of spaces n to which the tabs are
       set.  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 terminal 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, initialization strings
       for the terminal; iprog, the path name of a program to run to
       initialize the terminal; and if, the name of a file containing long
       initialization strings.  These strings are expected to set the
       terminal into modes consistent with the rest of the terminfo
       description.  They must be sent to the terminal 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(1); see
       profile(4).

       Most initialization is done with is2.  Special terminal 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 harder
       reset from a totally unknown state can be given as rs1, rs2, rf, and
       rs3, analogous to is1, is2, if, and is3.  (The method using files, if
       and rf, is used for a few terminals, from /usr/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 since 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.

       If there are commands to set and clear margins, they can be given as
       mgc (clear all margins), smgl (set left margin), and smgr (set right
       margin).

   9. Delays
       Certain capabilities control padding in the terminal driver (see
       termio(7) and ttcompat(7)).  These are primarily needed by hardcopy
       terminals, and are used by tput init to set terminal driver modes
       appropriately.  Delays embedded in the capabilities cr, ind, cub1,
       ff, and tab can be used to set the appropriate delay bits in the
       terminal driver.  If pb (padding baud rate) is given, these values
       can be ignored at baud rates below the value of pb.

   10. 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 a program
       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 new cursor
       position in the status line.

       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, e.g., 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.

   11. Line Graphics
       If the terminal 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 terminal's line graphics set is to add
       a third column to the above table with the characters for the new
       terminal that produce the appropriate glyphs when the terminal is in
       the alternate character set mode.  For example,

                       glyph name           vt100+   new tty
                                             char     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.

   12. Color Manipulation
       Let us define two methods of color manipulation:  the Tektronix
       method and the HP method.  The Tektronix method uses a set of N
       predefined colors (usually 8) from which a program 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 program
       cannot define the foreground independently of the background, or
       vice-versa.  Instead, the program 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.

       The numeric capabilities 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 the boolean capability ccc (can change color).  To change the
       definition of a color (Tektronix method), use the parameterized
       string capability initc (initialize color).  It requires four
       parameters:  color number (ranging from 0 to colors-1) and three RGB
       (red, green, and blue) values (ranging from 0 to 1000).

       Tektronix 4100 series terminals use a type of color notation called
       HLS (Hue Lightness Saturation) instead of RGB color notation.  For
       such terminals one must define a boolean capability hls.  The last
       three parameters of the initc string would then be HLS values:  H,
       ranging from 0 to 360; and L and S, ranging from 0 to 100.

       To set the current foreground or background to a given color, use
       parameterized string capabilities setf (set foreground) and setb (set
       background).  They each 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
       (ranging from 0 to pairs-1), and six RGB values:  three for the
       foreground followed by three for the background.  (When initc or
       initp is used, RGB or HLS arguments should be in the order "red,
       green, blue" or "hue, lightness, saturation", respectively.)  To make
       a color-pair current, use the parameterized string capability scp
       (set color-pair).  It takes one parameter, the number of a color-
       pair.

       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 and encoded in the initc and initp capabilities.

       Some terminals (for example, most color terminal emulators for PCs)
       erase areas of the screen using the current background color.  In
       such cases, the boolean capability bce (background color erase)
       should be defined.  The string capability op (original pair) contains
       a sequence for setting the foreground and background colors to what
       they were at the terminal start-up time.  Similarly, oc (original
       colors) contains a 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 video attributes on some color terminals should not be combined
       with colors.  For instance, some color terminals substitute color for
       video attributes, so each attribute can be displayed in only one
       color.  Information about these video attributes should be packed
       into the numeric capability ncv (no color video).  There is a one-to-
       one correspondence between the nine least significant bits of this
       capability and the video attributes.  The following table depicts
       this correspondence.

                                          Bit      Decimal
                          Attribute     Position    Value
                         ----------------------------------
                         A_STANDOUT        0           1
                         A_UNDERLINE       1           2
                         A_REVERSE         2           4
                         A_BLINK           3           8
                         A_DIM             4          16
                         A_BOLD            5          32
                         A_INVIS           6          64
                         A_PROTECT         7         128
                         A_ALTCHARSET      8         256

       When a particular video attribute should not be used with colors, the
       corresponding ncv bit should be set to 1; otherwise it should be set
       to zero.  To determine the information to pack into the ncv
       capability, you must add together the decimal values corresponding to
       those attributes that cannot coexist with colors.  For example, if
       the terminal uses colors to simulate reverse video (bit number 2 and
       decimal value 4) and bold (bit number 5 and decimal value 32), the
       resulting value for ncv will be 36 (4 + 32).

   13. Miscellaneous
       If the terminal requires any character other than a null (zero) as a
       pad, then this can be given as pad.  Only the first character of the
       pad string is used.  If the terminal does not have a pad character,
       specify npc.

       If the terminal can move up or down half a line, this can be
       indicated with hu (half-line up) and hd (half-line down).  This is
       primarily useful for superscripts and subscripts on hardcopy
       terminals.  If a hardcopy terminal can eject to the next page (form
       feed), give this as ff (usually ^L).

       If there is a command to repeat a given character a given number of
       times (to save time transmitting a large number of identical
       characters) this can be indicated with the parameterized string rep.
       The first parameter is the character to be repeated and the second is
       the number of times to repeat it.  Thus, tparm(repeatchar, 'x', 10)
       produces the same effect as xxxxxxxxxx.

       If the terminal has a programmable command character, such as the
       Tektronix 4025, this can be indicated with cmdch.  A prototype
       command character is chosen which is used in all capabilities.  This
       character is given in the cmdch capability to identify it.  The
       following convention is supported on some UNIX systems: If the
       environment variable CC exists, all occurrences of the prototype
       character are replaced with the character in CC.

       Terminal descriptions that do not represent a specific kind of known
       terminal, such as switch, dialup, patch, and network, should include
       the gn (generic) capability so that programs can complain that they
       do not know how to talk to the terminal.  (This capability does not
       apply to virtual terminal descriptions for which the escape sequences
       are known.)  If the terminal is one of those supported by the UNIX
       system virtual terminal protocol, the terminal number can be given as
       vt.  A line-turn-around sequence to be transmitted before doing reads
       should be specified in rfi.

       If the terminal uses XON/XOFF handshaking for flow control, define
       xon.  Padding information should still be included so that routines
       can make better decisions about costs, but actual pad characters are
       not transmitted.  Sequences to turn on and off XON/XOFF handshaking
       may be given in smxon and rmxon.  If the characters used for
       handshaking are not <Ctrl-S> and Ctrl-Q, they may be specified with
       xonc and xoffc.

       If the terminal has a ``meta key'' which acts as a shift key, setting
       the eighth bit of any character transmitted, this can be specified
       with the boolean capability km.  Otherwise, software assumes that the
       eighth bit is parity and it is usually cleared.  If strings exist to
       turn this ``meta mode'' on and off, they can be specified as smm and
       rmm.

       If the terminal has more lines of memory than can fit on the screen
       at once, the number of lines of memory can be indicated with lm.  A
       value of zero for lm indicates that the number of lines is not fixed,
       but that there is still more memory than fits on the screen.

       If the terminal cursor can wrap around to the beginning of the next
       line when it reaches the right margin, this can be specified with the
       boolean capability am.  If a string exists to enable this wrapping,
       specify it as smam.  A string to make the cursor stick in the last
       column of a line is specified as rmam.

       Media copy strings which control an auxiliary printer connected to
       the terminal can be given as mc0: print the contents of the screen,
       mc4: turn off the printer, and mc5: turn on the printer.  When the
       printer is on, all text sent to the terminal is sent to the printer.
       A variation, mc5p, takes one parameter, and leaves the printer on for
       as many characters as the value of the parameter, then turns the
       printer off.  The parameter should not exceed 255.  If the text is
       not displayed on the terminal screen when the printer is on, specify
       mc5i (silent printer).  All text, including mc4, is transparently
       passed to the printer while an mc5p is in effect.

       For terminals which provide modem support, the following terminfo
       capabilities can be specified.  Touch tone dialing can be indicated
       with the capability tone and pulse tone with pulse.  The dial phone
       number sequence is given with dial, and the hangup phone is defined
       with hup.  You can indicate a flash to the hook with the capability
       hook, pause for 2-3 seconds with pause, and wait for a dial tone with
       wait.

       If an application requires capabilities that are not defined in the
       standard terminfo capability set, then user defined sequences can be
       specified.  Up to 10 user defined strings can be indicated with the
       capabilities u0-u9.

   14. Special Cases
       The working model used by terminfo fits most terminals reasonably
       well.  However, some terminals do not completely match that model,
       requiring special support by terminfo.  These are not meant to be
       construed as deficiencies in the terminals; they are just differences
       between the working model and the actual hardware.  They may be
       unusual devices or, for some reason, do not have all the features of
       the terminfo model implemented.

       Terminals which cannot display tilde (~) characters, such as certain
       Hazeltine terminals, should indicate hz.

       Terminals which ignore a linefeed immediately after an am wrap, such
       as the Concept-100, should indicate xenl.  Those terminals whose
       cursor remains on the rightmost column until another character has
       been received, rather than wrapping immediately upon receiving the
       rightmost character, such as the VT100, should also indicate xenl.

       If el is required to get rid of standout mode (instead of writing
       normal text on top of it), xhp should be given.

       Those Teleray terminals whose tabs overwrite blanks should indicate
       xt (destructive tabs).  This capability is also taken to mean that it
       is not possible to position the cursor on top of a ``magic cookie'';
       therefore, to erase standout mode, it is instead necessary to use
       delete and insert line.

       Those Beehive Superbee terminals which do not transmit the <ESC> or
       <Ctrl-C> characters should specify xsb, indicating that the F1 key is
       to be used for <ESC> and the F2 key for Ctrl-C.

       Most terminals can use padding as an alternative to XON-XOFF flow
       control.  Some terminals, though, require XON-XOFF flow control.  For
       these, specify the boolean capability nxon.

TERMINFO PRINTER CAPABILITIES
       The terminfo database allows you to define capabilities of printers
       as well as terminals.  To find out what capabilities are available
       for printers as well as for terminals, see the table in the "Device
       Capabilities" section.  Most subsections below are lettered for
       cross-reference to that table.

   Rounding Values
       Because parameterized string capabilities work only with integer
       values, we recommend that terminfo designers create strings that
       expect numeric values that have been rounded.  Application designers
       should note this and should always round values to the nearest
       integer before using them with a parameterized string capability.

   Printer Resolution
       A printer's resolution is defined to be the smallest spacing of
       characters it can achieve.  In general printers have independent
       resolution horizontally and vertically.  Thus the vertical resolution
       of a printer can be determined by measuring the smallest achievable
       distance between consecutive printing baselines, while the horizontal
       resolution can be determined by measuring the smallest achievable
       distance between the leftmost edges of consecutive printed,
       identical, characters.  (The terms ``smallest distance'' and
       ``smallest step'' will be used later to refer to these smallest
       achievable distances.)

       All printers are assumed to be capable of printing with a uniform
       horizontal and vertical resolution.  The view of printing that
       terminfo currently presents is one of printing inside a uniform
       matrix: All characters are printed at fixed positions relative to
       each ``cell'' in the matrix; furthermore, each cell has the same size
       given by the smallest horizontal and vertical step sizes dictated by
       the resolution.  (The cell size can be changed as will be seen
       later.)

       Many printers are capable of ``proportional printing,'' where the
       horizontal spacing depends on the size of the character last printed.
       Terminfo does not make use of this capability, although it does
       provide enough capability definitions to allow an application to
       simulate proportional printing.

       A printer must not only be capable of printing characters as close
       together as the horizontal and vertical resolutions suggest, but also
       of ``moving'' to a position an integral multiple of the resolution
       from a previous position.  Thus printed characters can be spaced
       apart a distance that is an integral multiple of the smallest
       distance, up to the length or width of a single page.

       Some printers can have different resolutions depending on different
       ``modes.''  In ``normal mode,'' the existing terminfo capabilities
       are assumed to work on columns and lines, just like a video terminal.
       Thus the old lines capability would give the length of a page in
       lines, and the cols capability would give the width of a page in
       columns.  In ``micro mode,'' many terminfo capabilities work on
       increments of lines and columns.  With some printers the micro mode
       may be concomitant with normal mode, so that all the capabilities
       work at the same time.

   A. Specifying Printer Resolution
       The printing resolution of a printer is given in several ways.  Each
       specifies the resolution as the number of smallest steps per
       distance:

                        Numeric Capabilities for Specifying
                      Characteristic Number of Smallest Steps
                      ----------------------------------------
                      orhi     Steps per inch horizontally
                      orvi     Steps per inch vertically
                      orc      Steps per column
                      orl      Steps per line

       When printing in normal mode, each character printed causes movement
       to the next column, except in special cases described later; the
       distance moved is the same as the per-column resolution.  Some
       printers cause an automatic movement to the next line when a
       character is printed in the rightmost position; the distance moved
       vertically is the same as the per-line resolution.  When printing in
       micro mode, these distances can be different, and may be zero for
       some printers.

                        Numeric Capabilities for Specifying
                          Automatic Motion after Printing
                        ------------------------------------
                        Normal Mode:
                        orc     Steps moved horizontally
                        orl     Steps moved vertically

                        Micro Mode:
                        mcs     Steps moved horizontally
                        mls     Steps moved vertically

       Some printers are capable of printing wide characters.  The distance
       moved when a wide character is printed in normal mode may be
       different from when a regular width character is printed.  The
       distance moved when a wide character is printed in micro mode may
       also be different from when a regular character is printed in micro
       mode, but the differences are assumed to be related: If the distance
       moved for a regular character is the same whether in normal mode or
       micro mode (mcs=orc), then the distance moved for a wide character is
       also the same whether in normal mode or micro mode.  This doesn't
       mean the normal character distance is necessarily the same as the
       wide character distance, just that the distances don't change with a
       change in normal to micro mode.  However, if the distance moved for a
       regular character is different in micro mode from the distance moved
       in normal mode (mcs<orc), the micro mode distance is assumed to be
       the same for a wide character printed in micro mode, as the table
       below shows.

                       Numeric Capabilities for Specifying
                  Automatic Motion after Printing Wide Character
                  -----------------------------------------------
                  Normal Mode or Micro Mode (mcs = orc):
                  widcs          Steps moved horizontally

                  Micro Mode (mcs < orc):
                  mcs            Steps moved horizontally

       There may be control sequences to change the number of columns per
       inch (the character pitch) and to change the number of lines per inch
       (the line pitch).  If these are used, the resolution of the printer
       changes, but the type of change depends on the printer:

                       String and Boolean Capabilities for
                       Changing the Character/Line Pitches
              -------------------------------------------------------
              cpi    Change character pitch
              cpix   If set, cpi changes orhi, otherwise changes orc

              lpi    Change line pitch
              lpix   If set, lpi changes orvi, otherwise changes orl

              chr    Change steps per column
              cvr    Change steps per line

       The cpi and lpi string capabilities each require a single parameter,
       the pitch in columns (or characters) and lines per inch,
       respectively.  The chr and cvr string capabilities each require a
       single parameter, the number of steps per column and line,
       respectively.

       Using any of the control sequences in these strings will imply a
       change in some of the values of orc, orhi, orl, and orvi.  Also, the
       distance moved when a wide character is printed, widcs, changes in
       relation to orc.  The distance moved when a character is printed in
       micro mode, mcs, changes similarly, with one exception:  if the
       distance is 0 or 1, then no change is assumed (see items marked with
       † in the following table).

       Programs that use cpi, lpi, chr, or cvr should recalculate the
       printer resolution (and should recalculate other values -- see the
       topic "Effect of Changing Printing Resolution" in the section "Dot-
       Matrix Graphics").

                        Specification of Printer Resolution
                  Effects of Changing the Character/Line Pitches
                 --------------------------------------------------
                           Before                     After
                 --------------------------------------------------
                 Using cpi with cpix clear:
                 orhi '                         orhi

                 orc '                          orc=V
o
c
r
h
p
i
Using cpi with cpix set: orhi ' orhi=orc·Vcpi orc ' orc Using lpi with lpix clear: orvi ' orvi orl ' orl=V
o
l
r
p
v
i
Using lpi with lpix set: orvi ' orvi=orl·Vlpi orl ' orl Using chr: orhi ' orhi orc ' Vchr Using cvr: orvi ' orvi orl ' Vcvr Using cpi or chr: widcs ' widcs=widcs 'orcc' mcs '† mcs=mcs 'orcc' Vcpi, Vlpi, Vchr, and Vcvr are the parameters required by cpi, lpi, chr, and cvr, respectively. The ' mark indicates the old value. B. Capabilities that Cause Movement In the following descriptions, ``movement'' refers to the motion of the ``current position.'' With video terminals this would be the cursor; with some printers this is the carriage position. Other printers have different equivalents. In general, the current position is where a character would be displayed if printed. Terminfo has string capabilities for control sequences that cause movement a number of full columns or lines. It also has equivalent string capabilities for control sequences that cause movement a number of smallest steps. String Capabilities for Specifying Single and Multiple Motions ----------------------------------- mcub1 Move 1 step left mcuf1 Move 1 step right mcuu1 Move 1 step up mcud1 Move 1 step down mcub Move N steps left mcuf Move N steps right mcuu Move N steps up mcud Move N steps down mhpa Move N steps from the left mvpa Move N steps from the top The latter six strings each require a single parameter, N. Some printers limit the motion to less than the width or length of a page. Also, some printers don't accept absolute motion to the left of the current position. Terminfo has capabilities for specifying these limits. Numeric and Boolean Capabilities for Specifying Limits to Motion ------------------------------------------------------- mjump Limit on use of mcub1, mcuf1, mcuu1, and mcud1 maddr Limit on use of mhpa and mvpa xhpa If set, hpa and mhpa cannot move left xvpa If set, vpa and mvpa cannot move up If a printer needs to be in a ``micro mode'' for the motion capabilities described above to work, there are string capabilities defined to enter and exit this mode. A boolean capability is available for those printers where using a carriage return causes an automatic return to normal mode. String and Boolean Capabilities for Entering and Exiting Micro Mode ------------------------------------------ smicm Enter micro mode rmicm Exit micro mode crxm If set, using cr exits micro mode The movement made when a character is printed in the rightmost position varies among printers. Some make no movement, some move to the beginning of the next line, others move to the beginning of the same line. Terminfo has boolean capabilities for describing all three cases. Boolean Capabilities for Specifying What Happens After Character Printed in Rightmost Position ----------------------------------------------- sam Automatic move to beginning of same line Some printers can be put in a mode where the normal direction of motion is reversed. This mode can be especially useful when there are no capabilities for leftward or upward motion, because those capabilities can be built from the motion reversal capability and the rightward or downward motion capabilities. It is best to leave it up to an application to build the leftward or upward capabilities, though, and not enter them in the terminfo database. This allows several reverse motions to be strung together without intervening wasted steps that leave and reenter reverse mode. String Capabilities for Entering and Exiting Reverse Modes -------------------------------------------- slm Reverse sense of horizontal motions rlm Restore sense of horizontal motions sum Reverse sense of vertical motions rum Restore sense of vertical motions While sense of horizontal motions reversed: mcub1 Move 1 step right mcuf1 Move 1 step left mcub Move N steps right mcuf Move N steps left cub1 Move 1 column right cuf1 Move 1 column left cub Move N columns right cuf Move N columns left While sense of vertical motions reversed: mcuu1 Move 1 step down mcud1 Move 1 step up mcuu Move N steps down mcud Move N steps up cuu1 Move 1 line down cud1 Move 1 line up cuu Move N lines down cud Move N lines up The reverse motion modes should not affect the mvpa and mhpa absolute motion capabilities. The reverse vertical motion mode should, however, also reverse the action of the line ``wrapping'' that occurs when a character is printed in the rightmost position. Thus printers that have the standard terminfo capability am defined should experience motion to the beginning of the previous line when a character is printed in the rightmost position under reverse vertical motion mode. The action when any other motion capabilities are used in reverse motion modes is not defined; thus, programs must exit reverse motion modes before using other motion capabilities. Two miscellaneous capabilities complete the list of new motion capabilities. One of these is needed for printers that move the current position to the beginning of a line when certain control characters, such as ``linefeed'' or ``formfeed,'' are used. The other is used for the capability of suspending the motion that normally occurs after printing a character. String Capabilities for Specifying Miscellaneous Motion ----------------------------------------------------------------- docr List of control characters causing cr zerom Prevent auto motion after printing next single character C. Margins Terminfo provides two strings for setting margins on terminals: one for the left margin and one for the right. Printers, however, have two additional margins, for the top and bottom of each page. Furthermore, instead of using motion strings to move the current position to a margin and then fixing the margin there, some printers require the specification of where a margin should be regardless of the current position. Therefore terminfo offers six additional strings for defining margins with printers. String Capabilities for Setting Margins ------------------------------------------- smgl Set left margin at current column smgr Set right margin at current column smgb Set bottom margin at current line smgt Set top margin at current line smgbp Set bottom margin at line N smglp Set left margin at column N smgrp Set right margin at column N smgtp Set top margin at line N The last four strings each require one or more parameters that give the position of the margin or margins to set. If both of smglp and smgrp are defined, each requires a single parameter, N, that gives the column number of the left and right margin, respectively. If both of smgtp and smgbp are defined, they are used to set the top and bottom margin, respectively: smgtp requires a single parameter, N, the line number of the top margin; however, smgbp requires two parameters, N and M, that each give the line number of the bottom margin, the first counting from the top of the page and the second counting from the bottom. This accommodates the two methods used by different manufacturers to specify the bottom margin. When coding a terminfo entry for a printer that has a settable bottom margin, only the first or second parameter should be used, depending on the printer. When writing an application that uses smgbp to set the bottom margin, both arguments must be given. If only one of smglp and smgrp is defined, then it requires two parameters, the column numbers of the left and right margins, in that order. Likewise, if only one of smgtp and smgbp is set, then it requires two parameters that give the top and bottom margins, in that order, counting from the top of the page. Thus when coding a terminfo entry for a printer that requires setting both left and right or top and bottom margins simultaneously, only one of smglp and smgrp, or smgtp and smgbp, should be defined; the other capability of the pair should not be included in the entry. When writing an application that uses these string capabilities, each pair should first be checked to see if both members of the pair are defined or if only one is defined; the defined capabilities should then be instantiated accordingly. In counting lines or columns, line zero is the top line and column zero is the leftmost column. A zero value for the second argument with smgbp means the bottom line of the page. All margins can be cleared with mgc. D. Shadows, Italics, Wide Characters, Superscripts, Subscripts Five new sets of string capabilities are used to describe the methods printers have of enhancing printed text. String Capabilities for Specifying Enhanced Printing ----------------------------------------------------- sshm Enter shadow-printing mode rshm Exit shadow-printing mode sitm Enter italicizing mode ritm Exit italicizing mode swidm Enter wide character mode rwidm Exit wide character mode ssupm Enter superscript mode rsupm Exit superscript mode supcs List of characters available as superscripts ssubm Enter subscript mode rsubm Exit subscript mode subcs List of characters available as subscripts If a printer requires the sshm control sequence before every character to be shadow-printed, the rshm string should be left undefined. Thus programs that find a control sequence in sshm but none in rshm should use the sshm control sequence before every character to be shadow-printed; otherwise, the sshm control sequence should be used once before the set of characters to be shadow- printed, followed by rshm. The same is also true of each of the sitm/ritm, swidm/rwidm, ssupm/rsupm, and ssubm/rsubm pairs. Note that terminfo also has a capability for printing emboldened text (bold). While shadow printing and emboldened printing are similar in that they ``darken'' the text, many printers produce these two types of print in slightly different ways. Generally, emboldened printing is done by overstriking the same character one or more times. Shadow printing likewise usually involves overstriking, but with a slight movement up and/or to the side so that the character is ``fatter.'' Terminfo requires that enhanced printing modes be independent, so that it would be possible, for instance, to shadow print italicized subscripts. As mentioned earlier, the amount of motion automatically made after printing a wide character should be given in the numeric capability widcs. If only a subset of the printable ASCII characters can be printed as superscripts or subscripts, they should be listed in the supcs or subcs strings, respectively. If the ssupm (or ssubm) string contains control sequences, but the corresponding supcs (or subcs) string is undefined, a program can assume that all printable ASCII characters are available as superscripts (or subscripts). Automatic motion made after printing a superscript or subscript must be the same as for regular characters. Thus, for example, printing any of the following two-character sequences will result in equivalent motion: Bi Bi Bi Note that the existing msgr boolean capability describes whether motion control sequences can be used while in ``standout mode.'' This capability has been extended to cover the enhanced printing modes added here. msgr should be set for those printers that accept any motion control sequences without affecting shadow, italicized, widened, superscript, or subscript printing. Conversely, if msgr is not set, a program should exit these modes before attempting any motion. E. Alternate Character Sets In addition to allowing you to define line graphics (described in the "Line Graphics" section), terminfo lets you define alternate character sets. The following capabilities cover printers and terminals with multiple selectable or definable character sets. String and Boolean Capabilities for Specifying Alternate Character Sets ---------------------------------------------------------- scs Select character set N scsd Start definition of character set N, M characters defc Define character A, B dots wide, descender D rcsd End definition of character set N csnm List of character set names daisy If set, printer has manually changed print wheels The scs, rcsd, and csnm strings each require a single parameter, N, a number from 0 to 63 that identifies the character set. The scsd string also requires the parameter N and another, M, that gives the number of characters in the set. The defc string requires three parameters: A gives the ASCII code representation for the character, B gives the width of the character in dots, and D is zero or one depending on whether the character is a ``descender'' or not. The defc string is also followed by a string of ``image data'' bytes that describe how the character looks (see below). Character set 0 is the default character set present after the printer has been initialized. Not every printer has 64 character sets, of course; using scs with an argument that doesn't select an available character set should cause a null result from tparm(). If a character set has to be defined before it can be used, the scsd control sequence must be used before defining the character set, and rcsd must be used after. They should also cause a null result from tparm() when used with an argument N that doesn't apply. If a character set still has to be selected after being defined, the scs control sequence must follow the rcsd control sequence. By examining the results of using each of the scs, scsd, and rcsd strings with a character set number in a call to tparm(), a program can determine which of the three are needed. Between use of the scsd and rcsd strings, the defc string should be used to define each character. To print any character on printers covered by terminfo, the ASCII code is sent to the printer. This is true for characters in an alternate set as well as ``normal'' characters. Thus the definition of a character includes the ASCII code that represents it. In addition, the width of the character in dots is given, along with an indication of whether the character should descend below the print line (such as the lower case letter g in most character sets). The width of the character in dots also indicates the number of image data bytes that will follow the defc string. These image data bytes indicate where in a dot-matrix pattern ink should be applied to ``draw'' the character; the number of these bytes and their form are defined below in the "Dot-Matrix Graphics" section. It's easiest for the creator of terminfo entries to refer to each character set by number; however, these numbers will be meaningless to the application developer. The csnm string alleviates this problem by providing names for each number. When used with a character set number in a call to tparm(), the csnm string will produce the equivalent name. These names should be used as a reference only. No naming convention is specified, although anyone who creates a terminfo entry for a printer should use names consistent with the names found in user documents for the printer. Application developers should allow a user to specify a character set by number (leaving it up to the user to examine the csnm string to determine the correct number), or by name, where the application examines the csnm string to determine the corresponding character set number. The boolean daisy indicates printers that have manually changed print wheels or font cartridges. However, the capabilities described above are likely to be used only with dot-matrix printers. F. Dot-Matrix Graphics Dot-matrix printers typically have the capability of reproducing ``raster graphics'' images. Three new numeric capabilities and three new string capabilities help a program draw raster graphics images independent of the type of dot-matrix printer or the number of pins or dots the printer can handle at one time. Numeric and String Capabilities for Specifying Dot-Matrix Graphics -------------------------------------------------------- npins Number of pins, N, in print head spinv Spacing of pins vertically in pins per inch spinh Spacing of dots horizontally in dots per inch porder Matches software bits to print head pins sbim Start printing bit image graphics, B bits wide rbim End printing bit image graphics The sbim string requires a single parameter, B, the width of the image in dots. The model of dot-matrix or raster graphics that terminfo presents is similar to the technique used for most dot-matrix printers: Each pass of the printer's print head is assumed to produce a dot-matrix that is N dots high and B dots wide. This is typically a wide, squat, rectangle of dots. The height of this rectangle in dots will vary from one printer to the next; this is given in the npins numeric capability. The size of the rectangle in fractions of an inch will also vary; it can be deduced from the spinv and spinh numeric capabilities. With these three values an application can divide a complete raster graphics image into several horizontal strips, perhaps interpolating to account for different dot spacing vertically and horizontally. The sbim and rbim strings start and end a dot-matrix image, respectively. The sbim string requires a single parameter that gives the width of the dot-matrix in dots. A sequence of ``image data'' bytes is sent to the printer after the sbim string and before the rbim string. The number of bytes is an integral multiple of the width of the dot-matrix; the multiple and the form of each byte are determined by the porder string as described below. The porder string is a comma-separated list of pin numbers optionally followed by a numerical offset. The offset, if given, is separated from the list with a semicolon. The position of each pin number in the list corresponds to a bit in an eight-bit data byte. The pins are numbered consecutively from 1 to npins, with 1 being the top pin. Note that the term ``pin'' is used loosely here; ``ink-jet'' dot- matrix printers don't have pins, but can be considered to have an equivalent method of applying a single dot of ink to paper. The bit positions in porder are in groups of eight; the first position of each group is the most significant bit and the last position is the least significant bit. An application produces eight-bit bytes in the order of the groups in porder. An application computes the ``image data'' bytes from its internal image, mapping vertical dot positions in each print head pass into eight-bit bytes, using a 1 bit where ink should be applied and 0 where no ink should be applied. This can be reversed (0 bit for ink, 1 bit for no ink) by giving a negative pin number in porder. If a position is skipped in porder, a 0 bit is used. If a position has a lower case `x' instead of a pin number, a 1 bit is used in the skipped position. For consistency, a lower case `o' can be used to represent a 0 filled (no-ink) bit. There must be a multiple of 8 bit positions used or skipped in porder; if not, 0 bits are used to fill the last byte in the least significant bits. The offset, if given, is added to each data byte; the offset can be negative. Some examples may help clarify the use of the porder string. The AT&T 470, AT&T 475 and C.Itoh 8510 printers provide eight pins for graphics. The pins are identified top to bottom by the 8 bits in a byte, from least significant to most. The porder strings for these printers would be 8,7,6,5,4,3,2,1. The AT&T 478 and AT&T 479 printers also provide eight pins for graphics. However, the pins are identified in the reverse order. The porder strings for these printers would be 1,2,3,4,5,6,7,8. The AT&T 5310, AT&T 5320, DEC LA100, and DEC LN03 printers provide six pins for graphics. The pins are identified top to bottom by the decimal values 1, 2, 4, 8, 16 and 32. These correspond to the low six bits in an 8-bit byte, although the decimal values are further offset by the value 63. The porder string for these printers would be ,,6,5,4,3,2,1;63, or alternately o,o,6,5,4,3,2,1;63. G. Effect of Changing Printing Resolution If the control sequences to change the character pitch or the line pitch are used, the pin or dot spacing may change: String and Boolean Capabilities for Changing the Character and Line Pitches ---------------------------------------- cpi Change character pitch cpix If set, cpi changes spinh lpi Change line pitch lpix If set, lpi changes spinv Programs that use cpi or lpi should recalculate the dot spacing: Dot-Matrix Graphics Effects of Changing the Character and Line Pitches ---------------------------------------------------- Before After ---------------------------------------------------- Using cpi with cpix clear: spinh ' spinh Using cpi with cpix set: spinh ' spinh=spinh '·orhii' Using lpi with lpix clear: spinv ' spinv Using lpi with lpix set: spinv ' spinv=spinv '·orhii' Using chr: spinh ' spinh Using cvr: spinv ' spinv orhi' and orhi are the values of the horizontal resolution in steps per inch, before using cpi and after using cpi, respectively. Likewise, orvi' and orvi are the values of the vertical resolution in steps per inch, before using lpi and after using lpi, respectively. Thus, the changes in the dots per inch for dot-matrix graphics follow the changes in steps per inch for printer resolution. H. Print Quality Many dot-matrix printers can alter the dot spacing of printed text to produce ``near-letter-quality'' printing or ``draft quality'' printing. Usually it is important to be able to choose one or the other because the rate of printing generally falls off as the quality improves. There are three new string capabilities used to describe these print quality levels. String Capabilities for Specifying Print Quality ----------------------------------------- snlq Set near-letter-quality printing snrmq Set normal quality printing sdrfq Set draft quality printing The capabilities are listed in decreasing levels of quality. If a printer doesn't have all three levels, one or two of the strings should be left undefined as appropriate. I. Printing Rate and Buffer Size Because there is no standard protocol that can be used to keep a program synchronized with a printer, and because modern printers can buffer data before printing it, a program generally cannot determine at any time what has been printed. However, two new numeric capabilities can help a program estimate what has been printed. Numeric Capabilities for Specifying Print Rate and Buffer Size ---------------------------------------------------- cps Nominal print rate in characters per second bufsz Buffer capacity in characters cps is the nominal or average rate at which the printer prints characters; if this value is not given, the rate should be estimated at one-tenth the prevailing baud rate. bufsz is the maximum number of subsequent characters buffered before the guaranteed printing of an earlier character, assuming proper flow control has been used. If this value is not given it is assumed that the printer does not buffer characters, but prints them as they are received. As an example, if a printer has a 1000-character buffer, then sending the letter a followed by 1000 additional characters is guaranteed to cause the letter a to print. If the same printer prints at the rate of 100 characters per second, then it should take 10 seconds to print all the characters in the buffer, less if the buffer is not full. By keeping track of the characters sent to a printer, and determining the print rate and buffer size, a program can synchronize itself with the printer. Note that most printer manufacturers advertise the maximum print rate, not the nominal print rate. A good way to get a value for cps is to generate a few pages of text, count the number of printable characters, and then see how long it takes to print the text. Applications that use these values should recognize the variability in print rate. Straight text, in short lines, with no embedded control sequences will probably print at close to the advertised print rate and probably faster than the rate in cps. Graphics data with a lot of control sequences, or very long lines of text, will print at well below the advertised rate and below the rate in cps. If the application is using cps to decide how long it should take a printer to print a block of text, the application should pad the estimate. If the application is using cps to decide how much text has already been printed, it should shrink the estimate. The application will thus err in favor of the user, who wants, above all, to see all the output in its correct place. J. Setting Lines per Page Most printers have some way of setting form length, so terminfo provides a string capability for defining the number of lines per page. String Capabilities for Specifying Lines per Page ----------------------------------- slines Set N lines per page. slines requires one parameter N, the number of lines per page. TERMINFO/TERMCAP CORRESPONDENCE The table below presents the correspondence between terminfo and termcap(5) codes. The first two columns correspond to the first two columns in the previously presented table of terminfo capabilities. The last column shows the Termcap Code, which is the two-letter code that corresponds to the termcap(5) capability. The table is sorted alphabetically by Capname. Variable Cap- Termcap name Code acs_chars acsc ac auto_right_margin am am back_color_erase bce be bell bel bl bit_image_carriage_return bicr Yv bit_image_newline binel Zz bit_image_repeat birep Zy bit_image_entwining bitwin Yo bit_image_type bitype Yp enter_blink_mode blink mb enter_bold_mode bold md buttons btns BT buffer_capacity bufsz Ya auto_left_margin bw bw back_tab cbt bt can_change ccc cc change_res_horz chr ZC hard_cursor chts HC cursor_invisible civis vi clear_screen clear cl command_character cmdch CC cursor_normal cnorm ve color_names colornm Yw max_colors colors Co columns cols co change_char_pitch cpi ZA cpi_changes_res cpix YF print_rate cps Ym carriage_return cr cr cr_cancels_micro_mode crxm YB code_set_init csin ci char_set_names csnm Zy change_scroll_region csr cs parm_left_cursor cub LE cursor_left cub1 le parm_down_cursor cud DO cursor_down cud1 do parm_right_cursor cuf RI cursor_right cuf1 nd cursor_address cup cm parm_up_cursor cuu UP cursor_up cuu1 up change_res_vert cvr ZD cursor_visible cvvis vs create_window cwin CW memory_above da da has_print_wheel daisy YC memory_below db db parm_dch dch DC delete_character dch1 dc display_clock dclk DK define_bit_image_region defbi Yx define_char defc ZE device_type devt dv dial_phone dial DI enter_dim_mode dim mh display_pc_char dispc S1 parm_delete_line dl DL delete_line dl1 dl these_cause_cr docr Zw dis_status_line dsl ds erase_chars ech ec clr_eos ed cd clr_eol el ce clr_bol el1 cb ena_acs enacs eA end_bit_image_region endbi Yy erase_overstrike eo eo status_line_esc_ok eslok es form_feed ff ff flash_screen flash vb label_format fln Lf from_status_line fsl fs get_mouse getm Gm generic_type gn gn hard_copy hc hc down_half_line hd hd hue_lightness_saturation hls hl cursor_home home ho flash_hook hook fh column_address hpa ch has_status_line hs hs tab ht ta set_tab hts st up_half_line hu hu hangup hup HU tilde_glitch hz hz parm_ich ich IC insert_character ich1 ic init_file if if parm_insert_line il AL insert_line il1 al insert_null_glitch in in scroll_forward ind sf parm_index indn SF initialize_color initc Ic initialize_pair initp Ip enter_secure_mode invis mk insert_padding ip ip init_prog iprog iP init_1string is1 i1 init_2string is2 is init_3string is3 i3 init_tabs it it key_sbeg kBEG &9 key_scancel kCAN &0 key_scommand kCMD *1 key_scopy kCPY *2 key_screate kCRT *3 key_sdc kDC *4 key_sdl kDL *5 key_send kEND *7 key_seol kEOL *8 key_sexit kEXT *9 key_sfind kFND *0 key_shelp kHLP #1 key_shome kHOM #2 key_sic kIC #3 key_sleft kLFT #4 key_smove kMOV %b key_smessage kMSG %a key_snext kNXT %c key_soptions kOPT %d key_sprint kPRT %f key_sprevious kPRV %e key_sredo kRDO %g key_srsume kRES %j key_sright kRIT %i key_sreplace kRPL %h key_ssave kSAV !1 key_ssuspend kSPD !2 key_sundo kUND !3 key_a1 ka1 K1 key_a3 ka3 K3 key_b2 kb2 K2 key_beg kbeg @1 key_backspace kbs kb key_c1 kc1 K4 key_c3 kc3 K5 key_cancel kcan @2 key_btab kcbt kB key_close kclo @3 key_clear kclr kC key_command kcmd @4 key_copy kcpy @5 key_create kcrt @6 key_ctab kctab kt key_left kcub1 kl key_down kcud1 kd key_right kcuf1 kr key_up kcuu1 ku key_dc kdch1 kD key_dl kdl1 kL key_eos ked kS key_eol kel kE key_end kend @7 key_enter kent @8 key_exit kext @9 key_f0 kf0 k0 key_f1 kf1 k1 key_f10 kf10 k; key_f11 kf11 F1 key_f12 kf12 F2 key_f13 kf13 F3 key_f14 kf14 F4 key_f15 kf15 F5 key_f16 kf16 F6 key_f17 kf17 F7 key_f18 kf18 F8 key_f19 kf19 F9 key_f2 kf2 k2 key_f20 kf20 FA key_f21 kf21 FB key_f22 kf22 FC key_f23 kf23 FD key_f24 kf24 FE key_f25 kf25 FF key_f26 kf26 FG key_f27 kf27 FH key_f28 kf28 FI key_f29 kf29 FJ key_f3 kf3 k3 key_f30 kf30 FK key_f31 kf31 FL key_f32 kf32 FM key_f33 kf33 FN key_f34 kf34 FO key_f35 kf35 FP key_f36 kf36 FQ key_f37 kf37 FR key_f38 kf38 FS key_f39 kf39 FT key_f4 kf4 k4 key_f40 kf40 FU key_f41 kf41 FV key_f42 kf42 FW key_f43 kf43 FX key_f44 kf44 FY key_f45 kf45 FZ key_f46 kf46 Fa key_f47 kf47 Fb key_f48 kf48 Fc key_f49 kf49 Fd key_f5 kf5 k5 key_f50 kf50 Fe key_f51 kf51 Ff key_f52 kf52 Fg key_f53 kf53 Fh key_f54 kf54 Fi key_f55 kf55 Fj key_f56 kf56 Fk key_f57 kf57 Fl key_f58 kf58 Fm key_f59 kf59 Fn key_f6 kf6 k6 key_f60 kf60 Fo key_f61 kf61 Fp key_f62 kf62 Fq key_f63 kf63 Fr key_f7 kf7 k7 key_f8 kf8 k8 key_f9 kf9 k9 key_find kfnd @0 key_help khlp %1 key_home khome kh key_stab khts kT key_ic kich1 kI key_il kil1 kA key_sf kind kF key_ll kll kH has_meta_key km km key_mouse kmous Km key_move kmov %4 key_mark kmrk %2 key_message kmsg %3 key_npage knp kN key_next knxt %5 key_open kopn %6 key_options kopt %7 key_ppage kpp kP key_print kprt %9 key_previous kprv %8 key_redo krdo %0 key_reference kref &1 key_resume kres &5 key_refresh krfr &2 key_sr kri kR key_eic krmir kM key_replace krpl &3 key_restart krst &4 key_save ksav &6 key_select kslt *6 key_suspend kspd &7 key_catab ktbc ka key_undo kund &8 lab_f0 lf0 l0 lab_f1 lf1 l1 lab_f10 lf10 la lab_f2 lf2 l2 lab_f3 lf3 l3 lab_f4 lf4 l4 lab_f5 lf5 l5 lab_f6 lf6 l6 lab_f7 lf7 l7 lab_f8 lf8 l8 lab_f9 lf9 l9 label_height lh lh lines lines li cursor_to_ll ll ll lines_of_memory lm lm change_line_pitch lpi ZB lpi_changes_res lpix YG label_width lw lw max_attributes ma ma max_micro_address maddr Yd print_screen mc0 ps prtr_off mc4 pf prtr_on mc5 po prtr_silent mc5i 5i prtr_non mc5p pO micro_col_size mcs Yf parm_left_micro mcub Zg micro_left mcub1 Za parm_down_micro mcud Zf micro_down mcud1 ZZ parm_right_micro mcuf Zh micro_right mcuf1 Zb parm_up_micro mcuu Zi micro_up mcuu1 Zd clear_margins mgc MC micro_column_address mhpa ZY mouse_info minfo Mi move_insert_mode mir mi max_micro_jump mjump Ye micro_line_size mls Yg cursor_mem_address mrcup CM move_standout_mode msgr ms micro_row_address mvpa Zc no_color_video ncv NC non_dest_scroll_region ndscr ND newline nel nw num_labels nlab Nl no_pad_char npc NP number_of_pins npins Yh non_rev_rmcup nrrmc NR needs_xon_xoff nxon nx orig_colors oc oc orig_pair op op output_res_char orc Yi output_res_horz_inch orhi Yk output_res_line orl Yj output_res_vert_inch orvi Yl over_strike os os pad_char pad pc max_pairs pairs pa fixed_pause pause PA padding_baud_rate pb pb pc_term_options pctrm S6 pkey_key pfkey pk pkey_local pfloc pl pkey_xmit pfx px pkey_plab pfxl xl plab_norm pln pn order_of_pins porder Ze enter_protected_mode prot mp pulse pulse PU quick_dial qdial QD stop_bit_image rbim Zs restore_cursor rc rc stop_char_set_def rcsd Zt repeat_char rep rp req_mouse_pos reqmp RQ enter_reverse_mode rev mr reset_file rf rf req_for_input rfi RF scroll_reverse ri sr parm_rindex rin SR exit_italics_mode ritm ZR exit_leftward_mode rlm ZS exit_alt_charset_mode rmacs ae exit_am_mode rmam RA remove_clock rmclk RC exit_ca_mode rmcup te exit_delete_mode rmdc ed exit_micro_mode rmicm ZT exit_insert_mode rmir ei keypad_local rmkx ke label_off rmln LF meta_off rmm mo char_padding rmp rP exit_pc_charset_mode rmpch S3 exit_scancode_mode rmsc S5 exit_standout_mode rmso se exit_underline_mode rmul ue exit_xon_mode rmxon RX reset_1string rs1 r1 reset_2string rs2 r2 reset_3string rs3 r3 exit_shadow_mode rshm ZU exit_subscript_mode rsubm ZV exit_superscript_mode rsupm ZW exit_upward_mode rum ZX exit_doublewide_mode rwidm ZQ set0_des_seq s0ds s0 set1_des_seq s1ds s1 set2_des_seq s2ds s2 set3_des_seq s3ds s3 semi_auto_right_margin sam YE start_bit_image sbim Zq save_cursor sc sc scancode_escape scesc S7 alt_scancode_esc scesca S8 set_clock sclk SC set_color_pair scp sp select_char_set scs Zj start_char_set_def scsd Zr enter_draft_quality sdrfq ZG set_a_background setab AB set_a_foreground setaf AF set_background setb Sb set_color_band setcolor Yz set_foreground setf Sf set_attributes sgr sa exit_attribute_mode sgr0 me enter_italics_mode sitm ZH enter_leftward_mode slm ZI enter_alt_charset_mode smacs as enter_am_mode smam SA enter_ca_mode smcup ti enter_delete_mode smdc dm set_bottom_margin smgb Zk set_bottom_margin_parm smgbp Zl set_left_margin smgl ML set_left_margin_parm smglp Zm set_lr_margin smglr ML set_right_margin smgr MR set_right_margin_parm smgrp Zn set_top_margin smgt Zo set_tb_margin smgtb MT set_top_margin_parm smgtp Zp enter_micro_mode smicm ZJ enter_insert_mode smir im keypad_xmit smkx ks label_on smln LO meta_on smm mm enter_pc_charset_mode smpch S2 enter_scancode_mode smsc S4 enter_standout_mode smso so enter_underline_mode smul us enter_xon_mode smxon SX enter_near_letter_quality snlq ZK enter_normal_quality snrmq ZL dot_horz_spacing spinh Yc dot_vert_spacing spinv Yb enter_shadow_mode sshm ZM enter_subscript_mode ssubm ZN enter_superscript_mode ssupm ZO subscript_characters subcs Zu enter_upward_mode sum ZP superscript_characters supcs Zv enter_doublewide_mode swidm ZF clear_all_tabs tbc ct tone tone TO to_status_line tsl ts user0 u0 u0 user1 u1 u1 user2 u2 u2 user3 u3 u3 user4 u4 u4 user5 u5 u5 user6 u6 u6 user7 u7 u7 user8 u8 u8 user9 u9 u9 underline_char uc uc transparent_underline ul ul row_address vpa cv virtual_terminal vt vt wait_tone wait WA wide_char_size widcs Yn set_window wind wi goto_window wingo WG maximum_windows wnum MW width_status_line wsl ws eat_newline_glitch xenl xn ceol_standout_glitch xhp xs col_addr_glitch xhpa YA magic_cookie_glitch xmc sg xoff_character xoffc XF xon_xoff xon xo xon_character xonc XN no_esc_ctlc xsb xb dest_tabs_magic_smso xt xt row_addr_glitch xvpa YD zero_motion zerom Zx FILES /usr/lib/terminfo/?/* compiled device description database /usr/src/cmd/terminfo/*.ti source device descriptions /usr/lib/tabset/* tab settings for some devices, in a format appropriate to be output to the device (escape sequences that set margins and tabs) SEE ALSO curses(3X), printf(3S), term(5), profile(4), termcap(5). captoinfo(1M), infocmp(1M), tic(1M), termio(7), ttcompat(7). tput(1). CAUTIONS As described in the "Tabs and Initialization" section above, a device's initialization strings, is1, is2, and is3, if defined, must be output before a curses(3X) program is run. An available mechanism for outputting such strings is tput init (see tput(1) and profile(4)). If a null character (\0) is encountered in a string, the null and all characters after it are lost. Therefore it is not possible to code a null character (\0) in a string capability and send it to a device (either a terminal or a printer). The suggestion of sending \0200 where \0 (null) is needed can succeed only if the device ignores the eighth bit. For example, because all eight bits are used in the standard international ISO character set, devices that adhere to this standard will treat \0200 differently from \0. Tampering with entries in /usr/lib/terminfo/?/* (for example, changing or removing an entry) can affect programs such as vi(1) that expect the entry to be present and correct. In particular, removing the description for the dumb terminal causes unexpected problems. Licensed material--property of copyright holder(s)

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