1terminfo(5)                      File Formats                      terminfo(5)
2
3
4

NAME

6       terminfo - terminal capability database
7

SYNOPSIS

9       /usr/share/terminfo/*/*
10

DESCRIPTION

12       Terminfo  is  a  database describing terminals, used by screen-oriented
13       programs such as nvi(1), lynx(1), mutt(1), and  other  curses  applica‐
14       tions,  using  high-level calls to libraries such as curses(3X).  It is
15       also used via low-level calls by non-curses applications which  may  be
16       screen-oriented (such as clear(1)) or non-screen (such as tabs(1)).
17
18       Terminfo describes terminals by giving a set of capabilities which they
19       have, by specifying how to perform screen operations, and by specifying
20       padding requirements and initialization sequences.
21
22       This manual describes ncurses version 6.4 (patch 20230520).
23
24   Terminfo Entry Syntax
25       Entries in terminfo consist of a sequence of fields:
26
27       •   Each  field  ends  with a comma “,” (embedded commas may be escaped
28           with a backslash or written as “\054”).
29
30       •   White space between fields is ignored.
31
32       •   The first field in a terminfo entry begins in the first column.
33
34       •   Newlines and leading whitespace (spaces or tabs) may  be  used  for
35           formatting  entries for readability.  These are removed from parsed
36           entries.
37
38           The infocmp -f and -W options rely on this to  format  if-then-else
39           expressions,  or to enforce maximum line-width.  The resulting for‐
40           matted terminal description can be read by tic.
41
42       •   The first field for each terminal gives the names which  are  known
43           for the terminal, separated by “|” characters.
44
45           The first name given is the most common abbreviation for the termi‐
46           nal (its primary name), the last name given should be a  long  name
47           fully  identifying  the terminal (see longname(3X)), and all others
48           are treated as synonyms (aliases) for the primary terminal name.
49
50           X/Open Curses advises that all names but  the  last  should  be  in
51           lower  case  and  contain no blanks; the last name may well contain
52           upper case and blanks for readability.
53
54           This implementation is not so strict; it allows mixed case  in  the
55           primary name and aliases.  If the last name has no embedded blanks,
56           it allows that to be both an alias and a  verbose  name  (but  will
57           warn about this ambiguity).
58
59       •   Lines  beginning with a “#” in the first column are treated as com‐
60           ments.
61
62           While comment lines are legal at any point, the output of captoinfo
63           and  infotocap  (aliases  for tic) will move comments so they occur
64           only between entries.
65
66       Terminal names (except for the last, verbose entry)  should  be  chosen
67       using the following conventions.  The particular piece of hardware mak‐
68       ing up the terminal should have a root name, thus “hp2621”.  This  name
69       should not contain hyphens.  Modes that the hardware can be in, or user
70       preferences, should be indicated by appending a hyphen and a mode  suf‐
71       fix.  Thus, a vt100 in 132-column mode would be vt100-w.  The following
72       suffixes should be used where possible:
73
74            Suffix                  Meaning                   Example
75            -nn      Number of lines on the screen            aaa-60
76            -np      Number of pages of memory                c100-4p
77            -am      With automargins (usually the default)   vt100-am
78            -m       Mono mode; suppress color                ansi-m
79            -mc      Magic cookie; spaces when highlighting   wy30-mc
80            -na      No arrow keys (leave them in local)      c100-na
81            -nam     Without automatic margins                vt100-nam
82            -nl      No status line                           att4415-nl
83            -ns      No status line                           hp2626-ns
84            -rv      Reverse video                            c100-rv
85            -s       Enable status line                       vt100-s
86            -vb      Use visible bell instead of beep         wy370-vb
87            -w       Wide mode (> 80 columns, usually 132)    vt100-w
88
89       For more on terminal naming conventions, see the term(7) manual page.
90
91   Terminfo Capabilities Syntax
92       The terminfo entry consists of  several  capabilities,  i.e.,  features
93       that  the  terminal  has, or methods for exercising the terminal's fea‐
94       tures.
95
96       After the first field (giving the name(s) of the terminal entry), there
97       should be one or more capability fields.  These are boolean, numeric or
98       string names with corresponding values:
99
100       •   Boolean capabilities are true  when  present,  false  when  absent.
101           There is no explicit value for boolean capabilities.
102
103       •   Numeric  capabilities  have  a  “#” following the name, then an un‐
104           signed decimal integer value.
105
106       •   String capabilities have a “=” following the name, then  an  string
107           of characters making up the capability value.
108
109           String  capabilities  can be split into multiple lines, just as the
110           fields comprising a terminal  entry  can  be  split  into  multiple
111           lines.   While  blanks  between fields are ignored, blanks embedded
112           within a string value are retained, except for leading blanks on  a
113           line.
114
115       Any  capability can be canceled, i.e., suppressed from the terminal en‐
116       try, by following its name with “@” rather than a capability value.
117
118   Similar Terminals
119       If there are two very similar terminals, one (the variant) can  be  de‐
120       fined  as being just like the other (the base) with certain exceptions.
121       In the definition of the variant, the  string  capability  use  can  be
122       given with the name of the base terminal:
123
124       •   The  capabilities  given before use override those in the base type
125           named by use.
126
127       •   If there are multiple use capabilities, they are merged in  reverse
128           order.   That  is,  the rightmost use reference is processed first,
129           then the one to its left, and so forth.
130
131       •   Capabilities given explicitly in the entry override  those  brought
132           in by use references.
133
134       A capability can be canceled by placing xx@ to the left of the use ref‐
135       erence that imports it, where xx is the capability.  For  example,  the
136       entry
137
138              2621-nl, smkx@, rmkx@, use=2621,
139
140       defines a 2621-nl that does not have the smkx or rmkx capabilities, and
141       hence does not turn on the function key labels  when  in  visual  mode.
142       This  is  useful  for  different modes for a terminal, or for different
143       user preferences.
144
145       An entry included via use can contain canceled capabilities, which have
146       the  same  effect as if those cancels were inline in the using terminal
147       entry.
148
149   Predefined Capabilities
150       The following is a complete table of the  capabilities  included  in  a
151       terminfo  description  block  and available to terminfo-using code.  In
152       each line of the table,
153
154       The variable is the name by  which  the  programmer  (at  the  terminfo
155       level) accesses the capability.
156
157       The  capname is the short name used in the text of the database, and is
158       used by a person updating the database.   Whenever  possible,  capnames
159       are chosen to be the same as or similar to the ANSI X3.64-1979 standard
160       (now superseded by  ECMA-48,  which  uses  identical  or  very  similar
161       names).   Semantics  are also intended to match those of the specifica‐
162       tion.
163
164       The termcap code is the old termcap capability name (some  capabilities
165       are new, and have names which termcap did not originate).
166
167       Capability  names have no hard length limit, but an informal limit of 5
168       characters has been adopted to keep them short and to allow the tabs in
169       the source file Caps to line up nicely.
170
171       Finally,  the description field attempts to convey the semantics of the
172       capability.  You may find some codes in the description field:
173
174       (P)    indicates that padding may be specified
175
176       #[1-9] in the description field indicates that  the  string  is  passed
177              through tparm(3X) with parameters as given (#i).
178
179              If  no  parameters  are  listed  in the description, passing the
180              string through tparm(3X) may give unexpected results,  e.g.,  if
181              it contains percent (%%) signs.
182
183       (P*)   indicates  that  padding may vary in proportion to the number of
184              lines affected
185
186       (#i)   indicates the ith parameter.
187
188
189       These are the boolean capabilities:
190
191
192                  Variable            Cap-      TCap       Description
193                  Booleans            name      Code
194          auto_left_margin            bw        bw     cub1 wraps from col‐
195                                                       umn 0 to last column
196          auto_right_margin           am        am     terminal has auto‐
197                                                       matic margins
198
199          back_color_erase            bce       ut     screen erased with
200                                                       background color
201          can_change                  ccc       cc     terminal can re-de‐
202                                                       fine existing colors
203          ceol_standout_glitch        xhp       xs     standout not erased
204                                                       by overwriting (hp)
205          col_addr_glitch             xhpa      YA     only positive motion
206                                                       for hpa/mhpa caps
207          cpi_changes_res             cpix      YF     changing character
208                                                       pitch changes reso‐
209                                                       lution
210          cr_cancels_micro_mode       crxm      YB     using cr turns off
211                                                       micro mode
212          dest_tabs_magic_smso        xt        xt     tabs destructive,
213                                                       magic so char
214                                                       (t1061)
215          eat_newline_glitch          xenl      xn     newline ignored af‐
216                                                       ter 80 cols (con‐
217                                                       cept)
218          erase_overstrike            eo        eo     can erase over‐
219                                                       strikes with a blank
220          generic_type                gn        gn     generic line type
221          hard_copy                   hc        hc     hardcopy terminal
222          hard_cursor                 chts      HC     cursor is hard to
223                                                       see
224          has_meta_key                km        km     Has a meta key
225                                                       (i.e., sets 8th-bit)
226          has_print_wheel             daisy     YC     printer needs opera‐
227                                                       tor to change char‐
228                                                       acter set
229          has_status_line             hs        hs     has extra status
230                                                       line
231          hue_lightness_saturation    hls       hl     terminal uses only
232                                                       HLS color notation
233                                                       (Tektronix)
234          insert_null_glitch          in        in     insert mode distin‐
235                                                       guishes nulls
236          lpi_changes_res             lpix      YG     changing line pitch
237                                                       changes resolution
238          memory_above                da        da     display may be re‐
239                                                       tained above the
240                                                       screen
241          memory_below                db        db     display may be re‐
242                                                       tained below the
243                                                       screen
244          move_insert_mode            mir       mi     safe to move while
245                                                       in insert mode
246          move_standout_mode          msgr      ms     safe to move while
247                                                       in standout mode
248          needs_xon_xoff              nxon      nx     padding will not
249                                                       work, xon/xoff re‐
250                                                       quired
251          no_esc_ctlc                 xsb       xb     beehive (f1=escape,
252                                                       f2=ctrl C)
253          no_pad_char                 npc       NP     pad character does
254                                                       not exist
255          non_dest_scroll_region      ndscr     ND     scrolling region is
256                                                       non-destructive
257          non_rev_rmcup               nrrmc     NR     smcup does not re‐
258                                                       verse rmcup
259          over_strike                 os        os     terminal can over‐
260                                                       strike
261          prtr_silent                 mc5i      5i     printer will not
262                                                       echo on screen
263
264
265          row_addr_glitch             xvpa      YD     only positive motion
266                                                       for vpa/mvpa caps
267          semi_auto_right_margin      sam       YE     printing in last
268                                                       column causes cr
269          status_line_esc_ok          eslok     es     escape can be used
270                                                       on the status line
271          tilde_glitch                hz        hz     cannot print ~'s
272                                                       (Hazeltine)
273          transparent_underline       ul        ul     underline character
274                                                       overstrikes
275          xon_xoff                    xon       xo     terminal uses
276                                                       xon/xoff handshaking
277
278       These are the numeric capabilities:
279
280
281                  Variable            Cap-      TCap       Description
282                   Numeric            name      Code
283          columns                     cols      co     number of columns in
284                                                       a line
285          init_tabs                   it        it     tabs initially every
286                                                       # spaces
287          label_height                lh        lh     rows in each label
288          label_width                 lw        lw     columns in each la‐
289                                                       bel
290          lines                       lines     li     number of lines on
291                                                       screen or page
292          lines_of_memory             lm        lm     lines of memory if >
293                                                       line. 0 means varies
294          magic_cookie_glitch         xmc       sg     number of blank
295                                                       characters left by
296                                                       smso or rmso
297          max_attributes              ma        ma     maximum combined at‐
298                                                       tributes terminal
299                                                       can handle
300          max_colors                  colors    Co     maximum number of
301                                                       colors on screen
302          max_pairs                   pairs     pa     maximum number of
303                                                       color-pairs on the
304                                                       screen
305          maximum_windows             wnum      MW     maximum number of
306                                                       definable windows
307          no_color_video              ncv       NC     video attributes
308                                                       that cannot be used
309                                                       with colors
310          num_labels                  nlab      Nl     number of labels on
311                                                       screen
312          padding_baud_rate           pb        pb     lowest baud rate
313                                                       where padding needed
314          virtual_terminal            vt        vt     virtual terminal
315                                                       number (CB/unix)
316          width_status_line           wsl       ws     number of columns in
317                                                       status line
318
319       The following numeric capabilities  are  present  in  the  SVr4.0  term
320       structure,  but  are  not yet documented in the man page.  They came in
321       with SVr4's printer support.
322
323
324                  Variable            Cap-      TCap       Description
325                   Numeric            name      Code
326          bit_image_entwining         bitwin    Yo     number of passes for
327                                                       each bit-image row
328          bit_image_type              bitype    Yp     type of bit-image
329                                                       device
330
331          buffer_capacity             bufsz     Ya     numbers of bytes
332                                                       buffered before
333                                                       printing
334          buttons                     btns      BT     number of buttons on
335                                                       mouse
336          dot_horz_spacing            spinh     Yc     spacing of dots hor‐
337                                                       izontally in dots
338                                                       per inch
339          dot_vert_spacing            spinv     Yb     spacing of pins ver‐
340                                                       tically in pins per
341                                                       inch
342          max_micro_address           maddr     Yd     maximum value in mi‐
343                                                       cro_..._address
344          max_micro_jump              mjump     Ye     maximum value in
345                                                       parm_..._micro
346          micro_col_size              mcs       Yf     character step size
347                                                       when in micro mode
348          micro_line_size             mls       Yg     line step size when
349                                                       in micro mode
350          number_of_pins              npins     Yh     numbers of pins in
351                                                       print-head
352          output_res_char             orc       Yi     horizontal resolu‐
353                                                       tion in units per
354                                                       line
355          output_res_horz_inch        orhi      Yk     horizontal resolu‐
356                                                       tion in units per
357                                                       inch
358          output_res_line             orl       Yj     vertical resolution
359                                                       in units per line
360          output_res_vert_inch        orvi      Yl     vertical resolution
361                                                       in units per inch
362          print_rate                  cps       Ym     print rate in char‐
363                                                       acters per second
364          wide_char_size              widcs     Yn     character step size
365                                                       when in double wide
366                                                       mode
367
368       These are the string capabilities:
369
370
371                  Variable            Cap-      TCap       Description
372                   String             name      Code
373          acs_chars                   acsc      ac     graphics charset
374                                                       pairs, based on
375                                                       vt100
376          back_tab                    cbt       bt     back tab (P)
377          bell                        bel       bl     audible signal
378                                                       (bell) (P)
379          carriage_return             cr        cr     carriage return (P*)
380                                                       (P*)
381          change_char_pitch           cpi       ZA     Change number of
382                                                       characters per inch
383                                                       to #1
384          change_line_pitch           lpi       ZB     Change number of
385                                                       lines per inch to #1
386          change_res_horz             chr       ZC     Change horizontal
387                                                       resolution to #1
388          change_res_vert             cvr       ZD     Change vertical res‐
389                                                       olution to #1
390          change_scroll_region        csr       cs     change region to
391                                                       line #1 to line #2
392                                                       (P)
393          char_padding                rmp       rP     like ip but when in
394                                                       insert mode
395
396
397          clear_all_tabs              tbc       ct     clear all tab stops
398                                                       (P)
399          clear_margins               mgc       MC     clear right and left
400                                                       soft margins
401          clear_screen                clear     cl     clear screen and
402                                                       home cursor (P*)
403          clr_bol                     el1       cb     Clear to beginning
404                                                       of line
405          clr_eol                     el        ce     clear to end of line
406                                                       (P)
407          clr_eos                     ed        cd     clear to end of
408                                                       screen (P*)
409          column_address              hpa       ch     horizontal position
410                                                       #1, absolute (P)
411          command_character           cmdch     CC     terminal settable
412                                                       cmd character in
413                                                       prototype !?
414          create_window               cwin      CW     define a window #1
415                                                       from #2,#3 to #4,#5
416          cursor_address              cup       cm     move to row #1 col‐
417                                                       umns #2
418          cursor_down                 cud1      do     down one line
419          cursor_home                 home      ho     home cursor (if no
420                                                       cup)
421          cursor_invisible            civis     vi     make cursor invisi‐
422                                                       ble
423          cursor_left                 cub1      le     move left one space
424          cursor_mem_address          mrcup     CM     memory relative cur‐
425                                                       sor addressing, move
426                                                       to row #1 columns #2
427          cursor_normal               cnorm     ve     make cursor appear
428                                                       normal (undo
429                                                       civis/cvvis)
430          cursor_right                cuf1      nd     non-destructive
431                                                       space (move right
432                                                       one space)
433          cursor_to_ll                ll        ll     last line, first
434                                                       column (if no cup)
435          cursor_up                   cuu1      up     up one line
436          cursor_visible              cvvis     vs     make cursor very
437                                                       visible
438          define_char                 defc      ZE     Define a character
439                                                       #1, #2 dots wide,
440                                                       descender #3
441          delete_character            dch1      dc     delete character
442                                                       (P*)
443          delete_line                 dl1       dl     delete line (P*)
444          dial_phone                  dial      DI     dial number #1
445          dis_status_line             dsl       ds     disable status line
446          display_clock               dclk      DK     display clock
447          down_half_line              hd        hd     half a line down
448          ena_acs                     enacs     eA     enable alternate
449                                                       char set
450          enter_alt_charset_mode      smacs     as     start alternate
451                                                       character set (P)
452          enter_am_mode               smam      SA     turn on automatic
453                                                       margins
454          enter_blink_mode            blink     mb     turn on blinking
455          enter_bold_mode             bold      md     turn on bold (extra
456                                                       bright) mode
457          enter_ca_mode               smcup     ti     string to start pro‐
458                                                       grams using cup
459          enter_delete_mode           smdc      dm     enter delete mode
460          enter_dim_mode              dim       mh     turn on half-bright
461                                                       mode
462
463          enter_doublewide_mode       swidm     ZF     Enter double-wide
464                                                       mode
465          enter_draft_quality         sdrfq     ZG     Enter draft-quality
466                                                       mode
467          enter_insert_mode           smir      im     enter insert mode
468          enter_italics_mode          sitm      ZH     Enter italic mode
469          enter_leftward_mode         slm       ZI     Start leftward car‐
470                                                       riage motion
471          enter_micro_mode            smicm     ZJ     Start micro-motion
472                                                       mode
473          enter_near_letter_quality   snlq      ZK     Enter NLQ mode
474          enter_normal_quality        snrmq     ZL     Enter normal-quality
475                                                       mode
476          enter_protected_mode        prot      mp     turn on protected
477                                                       mode
478          enter_reverse_mode          rev       mr     turn on reverse
479                                                       video mode
480          enter_secure_mode           invis     mk     turn on blank mode
481                                                       (characters invisi‐
482                                                       ble)
483          enter_shadow_mode           sshm      ZM     Enter shadow-print
484                                                       mode
485          enter_standout_mode         smso      so     begin standout mode
486          enter_subscript_mode        ssubm     ZN     Enter subscript mode
487          enter_superscript_mode      ssupm     ZO     Enter superscript
488                                                       mode
489          enter_underline_mode        smul      us     begin underline mode
490          enter_upward_mode           sum       ZP     Start upward car‐
491                                                       riage motion
492          enter_xon_mode              smxon     SX     turn on xon/xoff
493                                                       handshaking
494          erase_chars                 ech       ec     erase #1 characters
495                                                       (P)
496          exit_alt_charset_mode       rmacs     ae     end alternate char‐
497                                                       acter set (P)
498          exit_am_mode                rmam      RA     turn off automatic
499                                                       margins
500          exit_attribute_mode         sgr0      me     turn off all at‐
501                                                       tributes
502          exit_ca_mode                rmcup     te     strings to end pro‐
503                                                       grams using cup
504          exit_delete_mode            rmdc      ed     end delete mode
505          exit_doublewide_mode        rwidm     ZQ     End double-wide mode
506          exit_insert_mode            rmir      ei     exit insert mode
507          exit_italics_mode           ritm      ZR     End italic mode
508          exit_leftward_mode          rlm       ZS     End left-motion mode
509          exit_micro_mode             rmicm     ZT     End micro-motion
510                                                       mode
511          exit_shadow_mode            rshm      ZU     End shadow-print
512                                                       mode
513          exit_standout_mode          rmso      se     exit standout mode
514          exit_subscript_mode         rsubm     ZV     End subscript mode
515          exit_superscript_mode       rsupm     ZW     End superscript mode
516          exit_underline_mode         rmul      ue     exit underline mode
517          exit_upward_mode            rum       ZX     End reverse charac‐
518                                                       ter motion
519          exit_xon_mode               rmxon     RX     turn off xon/xoff
520                                                       handshaking
521          fixed_pause                 pause     PA     pause for 2-3 sec‐
522                                                       onds
523          flash_hook                  hook      fh     flash switch hook
524          flash_screen                flash     vb     visible bell (may
525                                                       not move cursor)
526          form_feed                   ff        ff     hardcopy terminal
527                                                       page eject (P*)
528
529          from_status_line            fsl       fs     return from status
530                                                       line
531          goto_window                 wingo     WG     go to window #1
532          hangup                      hup       HU     hang-up phone
533          init_1string                is1       i1     initialization
534                                                       string
535          init_2string                is2       is     initialization
536                                                       string
537          init_3string                is3       i3     initialization
538                                                       string
539          init_file                   if        if     name of initializa‐
540                                                       tion file
541          init_prog                   iprog     iP     path name of program
542                                                       for initialization
543          initialize_color            initc     Ic     initialize color #1
544                                                       to (#2,#3,#4)
545          initialize_pair             initp     Ip     Initialize color
546                                                       pair #1 to
547                                                       fg=(#2,#3,#4),
548                                                       bg=(#5,#6,#7)
549          insert_character            ich1      ic     insert character (P)
550          insert_line                 il1       al     insert line (P*)
551          insert_padding              ip        ip     insert padding after
552                                                       inserted character
553          key_a1                      ka1       K1     upper left of keypad
554          key_a3                      ka3       K3     upper right of key‐
555                                                       pad
556          key_b2                      kb2       K2     center of keypad
557          key_backspace               kbs       kb     backspace key
558          key_beg                     kbeg      @1     begin key
559          key_btab                    kcbt      kB     back-tab key
560          key_c1                      kc1       K4     lower left of keypad
561          key_c3                      kc3       K5     lower right of key‐
562                                                       pad
563          key_cancel                  kcan      @2     cancel key
564          key_catab                   ktbc      ka     clear-all-tabs key
565          key_clear                   kclr      kC     clear-screen or
566                                                       erase key
567          key_close                   kclo      @3     close key
568          key_command                 kcmd      @4     command key
569          key_copy                    kcpy      @5     copy key
570          key_create                  kcrt      @6     create key
571          key_ctab                    kctab     kt     clear-tab key
572          key_dc                      kdch1     kD     delete-character key
573          key_dl                      kdl1      kL     delete-line key
574          key_down                    kcud1     kd     down-arrow key
575          key_eic                     krmir     kM     sent by rmir or smir
576                                                       in insert mode
577          key_end                     kend      @7     end key
578          key_enter                   kent      @8     enter/send key
579          key_eol                     kel       kE     clear-to-end-of-line
580                                                       key
581          key_eos                     ked       kS     clear-to-end-of-
582                                                       screen key
583          key_exit                    kext      @9     exit key
584          key_f0                      kf0       k0     F0 function key
585          key_f1                      kf1       k1     F1 function key
586          key_f10                     kf10      k;     F10 function key
587          key_f11                     kf11      F1     F11 function key
588          key_f12                     kf12      F2     F12 function key
589          key_f13                     kf13      F3     F13 function key
590          key_f14                     kf14      F4     F14 function key
591          key_f15                     kf15      F5     F15 function key
592          key_f16                     kf16      F6     F16 function key
593          key_f17                     kf17      F7     F17 function key
594
595          key_f18                     kf18      F8     F18 function key
596          key_f19                     kf19      F9     F19 function key
597          key_f2                      kf2       k2     F2 function key
598          key_f20                     kf20      FA     F20 function key
599          key_f21                     kf21      FB     F21 function key
600          key_f22                     kf22      FC     F22 function key
601          key_f23                     kf23      FD     F23 function key
602          key_f24                     kf24      FE     F24 function key
603          key_f25                     kf25      FF     F25 function key
604          key_f26                     kf26      FG     F26 function key
605          key_f27                     kf27      FH     F27 function key
606          key_f28                     kf28      FI     F28 function key
607          key_f29                     kf29      FJ     F29 function key
608          key_f3                      kf3       k3     F3 function key
609          key_f30                     kf30      FK     F30 function key
610          key_f31                     kf31      FL     F31 function key
611          key_f32                     kf32      FM     F32 function key
612          key_f33                     kf33      FN     F33 function key
613          key_f34                     kf34      FO     F34 function key
614          key_f35                     kf35      FP     F35 function key
615          key_f36                     kf36      FQ     F36 function key
616          key_f37                     kf37      FR     F37 function key
617          key_f38                     kf38      FS     F38 function key
618          key_f39                     kf39      FT     F39 function key
619          key_f4                      kf4       k4     F4 function key
620          key_f40                     kf40      FU     F40 function key
621          key_f41                     kf41      FV     F41 function key
622          key_f42                     kf42      FW     F42 function key
623          key_f43                     kf43      FX     F43 function key
624          key_f44                     kf44      FY     F44 function key
625          key_f45                     kf45      FZ     F45 function key
626          key_f46                     kf46      Fa     F46 function key
627          key_f47                     kf47      Fb     F47 function key
628          key_f48                     kf48      Fc     F48 function key
629          key_f49                     kf49      Fd     F49 function key
630          key_f5                      kf5       k5     F5 function key
631          key_f50                     kf50      Fe     F50 function key
632          key_f51                     kf51      Ff     F51 function key
633          key_f52                     kf52      Fg     F52 function key
634          key_f53                     kf53      Fh     F53 function key
635          key_f54                     kf54      Fi     F54 function key
636          key_f55                     kf55      Fj     F55 function key
637          key_f56                     kf56      Fk     F56 function key
638          key_f57                     kf57      Fl     F57 function key
639          key_f58                     kf58      Fm     F58 function key
640          key_f59                     kf59      Fn     F59 function key
641          key_f6                      kf6       k6     F6 function key
642          key_f60                     kf60      Fo     F60 function key
643          key_f61                     kf61      Fp     F61 function key
644          key_f62                     kf62      Fq     F62 function key
645          key_f63                     kf63      Fr     F63 function key
646          key_f7                      kf7       k7     F7 function key
647          key_f8                      kf8       k8     F8 function key
648          key_f9                      kf9       k9     F9 function key
649          key_find                    kfnd      @0     find key
650          key_help                    khlp      %1     help key
651          key_home                    khome     kh     home key
652          key_ic                      kich1     kI     insert-character key
653          key_il                      kil1      kA     insert-line key
654          key_left                    kcub1     kl     left-arrow key
655          key_ll                      kll       kH     lower-left key (home
656                                                       down)
657          key_mark                    kmrk      %2     mark key
658          key_message                 kmsg      %3     message key
659          key_move                    kmov      %4     move key
660
661          key_next                    knxt      %5     next key
662          key_npage                   knp       kN     next-page key
663          key_open                    kopn      %6     open key
664          key_options                 kopt      %7     options key
665          key_ppage                   kpp       kP     previous-page key
666          key_previous                kprv      %8     previous key
667          key_print                   kprt      %9     print key
668          key_redo                    krdo      %0     redo key
669          key_reference               kref      &1     reference key
670          key_refresh                 krfr      &2     refresh key
671          key_replace                 krpl      &3     replace key
672          key_restart                 krst      &4     restart key
673          key_resume                  kres      &5     resume key
674          key_right                   kcuf1     kr     right-arrow key
675          key_save                    ksav      &6     save key
676          key_sbeg                    kBEG      &9     shifted begin key
677          key_scancel                 kCAN      &0     shifted cancel key
678          key_scommand                kCMD      *1     shifted command key
679          key_scopy                   kCPY      *2     shifted copy key
680          key_screate                 kCRT      *3     shifted create key
681          key_sdc                     kDC       *4     shifted delete-char‐
682                                                       acter key
683          key_sdl                     kDL       *5     shifted delete-line
684                                                       key
685          key_select                  kslt      *6     select key
686          key_send                    kEND      *7     shifted end key
687          key_seol                    kEOL      *8     shifted clear-to-
688                                                       end-of-line key
689          key_sexit                   kEXT      *9     shifted exit key
690          key_sf                      kind      kF     scroll-forward key
691          key_sfind                   kFND      *0     shifted find key
692          key_shelp                   kHLP      #1     shifted help key
693          key_shome                   kHOM      #2     shifted home key
694          key_sic                     kIC       #3     shifted insert-char‐
695                                                       acter key
696          key_sleft                   kLFT      #4     shifted left-arrow
697                                                       key
698          key_smessage                kMSG      %a     shifted message key
699          key_smove                   kMOV      %b     shifted move key
700          key_snext                   kNXT      %c     shifted next key
701          key_soptions                kOPT      %d     shifted options key
702          key_sprevious               kPRV      %e     shifted previous key
703          key_sprint                  kPRT      %f     shifted print key
704          key_sr                      kri       kR     scroll-backward key
705          key_sredo                   kRDO      %g     shifted redo key
706          key_sreplace                kRPL      %h     shifted replace key
707          key_sright                  kRIT      %i     shifted right-arrow
708                                                       key
709          key_srsume                  kRES      %j     shifted resume key
710          key_ssave                   kSAV      !1     shifted save key
711          key_ssuspend                kSPD      !2     shifted suspend key
712          key_stab                    khts      kT     set-tab key
713          key_sundo                   kUND      !3     shifted undo key
714          key_suspend                 kspd      &7     suspend key
715          key_undo                    kund      &8     undo key
716          key_up                      kcuu1     ku     up-arrow key
717          keypad_local                rmkx      ke     leave 'key‐
718                                                       board_transmit' mode
719          keypad_xmit                 smkx      ks     enter 'key‐
720                                                       board_transmit' mode
721          lab_f0                      lf0       l0     label on function
722                                                       key f0 if not f0
723          lab_f1                      lf1       l1     label on function
724                                                       key f1 if not f1
725
726
727          lab_f10                     lf10      la     label on function
728                                                       key f10 if not f10
729          lab_f2                      lf2       l2     label on function
730                                                       key f2 if not f2
731          lab_f3                      lf3       l3     label on function
732                                                       key f3 if not f3
733          lab_f4                      lf4       l4     label on function
734                                                       key f4 if not f4
735          lab_f5                      lf5       l5     label on function
736                                                       key f5 if not f5
737          lab_f6                      lf6       l6     label on function
738                                                       key f6 if not f6
739          lab_f7                      lf7       l7     label on function
740                                                       key f7 if not f7
741          lab_f8                      lf8       l8     label on function
742                                                       key f8 if not f8
743          lab_f9                      lf9       l9     label on function
744                                                       key f9 if not f9
745          label_format                fln       Lf     label format
746          label_off                   rmln      LF     turn off soft labels
747          label_on                    smln      LO     turn on soft labels
748          meta_off                    rmm       mo     turn off meta mode
749          meta_on                     smm       mm     turn on meta mode
750                                                       (8th-bit on)
751          micro_column_address        mhpa      ZY     Like column_address
752                                                       in micro mode
753          micro_down                  mcud1     ZZ     Like cursor_down in
754                                                       micro mode
755          micro_left                  mcub1     Za     Like cursor_left in
756                                                       micro mode
757          micro_right                 mcuf1     Zb     Like cursor_right in
758                                                       micro mode
759          micro_row_address           mvpa      Zc     Like row_address #1
760                                                       in micro mode
761          micro_up                    mcuu1     Zd     Like cursor_up in
762                                                       micro mode
763          newline                     nel       nw     newline (behave like
764                                                       cr followed by lf)
765          order_of_pins               porder    Ze     Match software bits
766                                                       to print-head pins
767          orig_colors                 oc        oc     Set all color pairs
768                                                       to the original ones
769          orig_pair                   op        op     Set default pair to
770                                                       its original value
771          pad_char                    pad       pc     padding char (in‐
772                                                       stead of null)
773          parm_dch                    dch       DC     delete #1 characters
774                                                       (P*)
775          parm_delete_line            dl        DL     delete #1 lines (P*)
776          parm_down_cursor            cud       DO     down #1 lines (P*)
777          parm_down_micro             mcud      Zf     Like parm_down_cur‐
778                                                       sor in micro mode
779          parm_ich                    ich       IC     insert #1 characters
780                                                       (P*)
781          parm_index                  indn      SF     scroll forward #1
782                                                       lines (P)
783          parm_insert_line            il        AL     insert #1 lines (P*)
784          parm_left_cursor            cub       LE     move #1 characters
785                                                       to the left (P)
786          parm_left_micro             mcub      Zg     Like parm_left_cur‐
787                                                       sor in micro mode
788          parm_right_cursor           cuf       RI     move #1 characters
789                                                       to the right (P*)
790          parm_right_micro            mcuf      Zh     Like parm_right_cur‐
791                                                       sor in micro mode
792
793          parm_rindex                 rin       SR     scroll back #1 lines
794                                                       (P)
795          parm_up_cursor              cuu       UP     up #1 lines (P*)
796          parm_up_micro               mcuu      Zi     Like parm_up_cursor
797                                                       in micro mode
798          pkey_key                    pfkey     pk     program function key
799                                                       #1 to type string #2
800          pkey_local                  pfloc     pl     program function key
801                                                       #1 to execute string
802                                                       #2
803          pkey_xmit                   pfx       px     program function key
804                                                       #1 to transmit
805                                                       string #2
806          plab_norm                   pln       pn     program label #1 to
807                                                       show string #2
808          print_screen                mc0       ps     print contents of
809                                                       screen
810          prtr_non                    mc5p      pO     turn on printer for
811                                                       #1 bytes
812          prtr_off                    mc4       pf     turn off printer
813          prtr_on                     mc5       po     turn on printer
814          pulse                       pulse     PU     select pulse dialing
815          quick_dial                  qdial     QD     dial number #1 with‐
816                                                       out checking
817          remove_clock                rmclk     RC     remove clock
818          repeat_char                 rep       rp     repeat char #1 #2
819                                                       times (P*)
820          req_for_input               rfi       RF     send next input char
821                                                       (for ptys)
822          reset_1string               rs1       r1     reset string
823          reset_2string               rs2       r2     reset string
824          reset_3string               rs3       r3     reset string
825          reset_file                  rf        rf     name of reset file
826          restore_cursor              rc        rc     restore cursor to
827                                                       position of last
828                                                       save_cursor
829          row_address                 vpa       cv     vertical position #1
830                                                       absolute (P)
831          save_cursor                 sc        sc     save current cursor
832                                                       position (P)
833          scroll_forward              ind       sf     scroll text up (P)
834          scroll_reverse              ri        sr     scroll text down (P)
835          select_char_set             scs       Zj     Select character
836                                                       set, #1
837          set_attributes              sgr       sa     define video at‐
838                                                       tributes #1-#9 (PG9)
839          set_background              setb      Sb     Set background color
840                                                       #1
841          set_bottom_margin           smgb      Zk     Set bottom margin at
842                                                       current line
843          set_bottom_margin_parm      smgbp     Zl     Set bottom margin at
844                                                       line #1 or (if smgtp
845                                                       is not given) #2
846                                                       lines from bottom
847          set_clock                   sclk      SC     set clock, #1 hrs #2
848                                                       mins #3 secs
849          set_color_pair              scp       sp     Set current color
850                                                       pair to #1
851          set_foreground              setf      Sf     Set foreground color
852                                                       #1
853          set_left_margin             smgl      ML     set left soft margin
854                                                       at current col‐
855                                                       umn.     (ML is not
856                                                       in BSD termcap).
857
858
859          set_left_margin_parm        smglp     Zm     Set left (right)
860                                                       margin at column #1
861          set_right_margin            smgr      MR     set right soft mar‐
862                                                       gin at current col‐
863                                                       umn
864          set_right_margin_parm       smgrp     Zn     Set right margin at
865                                                       column #1
866          set_tab                     hts       st     set a tab in every
867                                                       row, current columns
868          set_top_margin              smgt      Zo     Set top margin at
869                                                       current line
870          set_top_margin_parm         smgtp     Zp     Set top (bottom)
871                                                       margin at row #1
872          set_window                  wind      wi     current window is
873                                                       lines #1-#2 cols
874                                                       #3-#4
875          start_bit_image             sbim      Zq     Start printing bit
876                                                       image graphics
877          start_char_set_def          scsd      Zr     Start character set
878                                                       definition #1, with
879                                                       #2 characters in the
880                                                       set
881          stop_bit_image              rbim      Zs     Stop printing bit
882                                                       image graphics
883          stop_char_set_def           rcsd      Zt     End definition of
884                                                       character set #1
885          subscript_characters        subcs     Zu     List of subscript‐
886                                                       able characters
887          superscript_characters      supcs     Zv     List of superscript‐
888                                                       able characters
889          tab                         ht        ta     tab to next 8-space
890                                                       hardware tab stop
891          these_cause_cr              docr      Zw     Printing any of
892                                                       these characters
893                                                       causes CR
894          to_status_line              tsl       ts     move to status line,
895                                                       column #1
896          tone                        tone      TO     select touch tone
897                                                       dialing
898          underline_char              uc        uc     underline char and
899                                                       move past it
900          up_half_line                hu        hu     half a line up
901          user0                       u0        u0     User string #0
902          user1                       u1        u1     User string #1
903          user2                       u2        u2     User string #2
904          user3                       u3        u3     User string #3
905          user4                       u4        u4     User string #4
906          user5                       u5        u5     User string #5
907          user6                       u6        u6     User string #6
908          user7                       u7        u7     User string #7
909          user8                       u8        u8     User string #8
910          user9                       u9        u9     User string #9
911          wait_tone                   wait      WA     wait for dial-tone
912          xoff_character              xoffc     XF     XOFF character
913          xon_character               xonc      XN     XON character
914          zero_motion                 zerom     Zx     No motion for subse‐
915                                                       quent character
916
917       The following string capabilities are present in the SVr4.0 term struc‐
918       ture, but were originally not documented in the man page.
919
920
921                  Variable            Cap-       TCap      Description
922                   String             name       Code
923
924
925          alt_scancode_esc            scesa      S8     Alternate escape
926                                                        for scancode emu‐
927                                                        lation
928          bit_image_carriage_return   bicr       Yv     Move to beginning
929                                                        of same row
930          bit_image_newline           binel      Zz     Move to next row
931                                                        of the bit image
932          bit_image_repeat            birep      Xy     Repeat bit image
933                                                        cell #1 #2 times
934          char_set_names              csnm       Zy     Produce #1'th item
935                                                        from list of char‐
936                                                        acter set names
937          code_set_init               csin       ci     Init sequence for
938                                                        multiple codesets
939          color_names                 colornm    Yw     Give name for
940                                                        color #1
941          define_bit_image_region     defbi      Yx     Define rectangular
942                                                        bit image region
943          device_type                 devt       dv     Indicate lan‐
944                                                        guage/codeset sup‐
945                                                        port
946          display_pc_char             dispc      S1     Display PC charac‐
947                                                        ter #1
948          end_bit_image_region        endbi      Yy     End a bit-image
949                                                        region
950          enter_pc_charset_mode       smpch      S2     Enter PC character
951                                                        display mode
952          enter_scancode_mode         smsc       S4     Enter PC scancode
953                                                        mode
954          exit_pc_charset_mode        rmpch      S3     Exit PC character
955                                                        display mode
956          exit_scancode_mode          rmsc       S5     Exit PC scancode
957                                                        mode
958          get_mouse                   getm       Gm     Curses should get
959                                                        button events, pa‐
960                                                        rameter #1 not
961                                                        documented.
962          key_mouse                   kmous      Km     Mouse event has
963                                                        occurred
964          mouse_info                  minfo      Mi     Mouse status in‐
965                                                        formation
966          pc_term_options             pctrm      S6     PC terminal op‐
967                                                        tions
968          pkey_plab                   pfxl       xl     Program function
969                                                        key #1 to type
970                                                        string #2 and show
971                                                        string #3
972          req_mouse_pos               reqmp      RQ     Request mouse po‐
973                                                        sition
974          scancode_escape             scesc      S7     Escape for scan‐
975                                                        code emulation
976          set0_des_seq                s0ds       s0     Shift to codeset 0
977                                                        (EUC set 0, ASCII)
978          set1_des_seq                s1ds       s1     Shift to codeset 1
979          set2_des_seq                s2ds       s2     Shift to codeset 2
980          set3_des_seq                s3ds       s3     Shift to codeset 3
981          set_a_background            setab      AB     Set background
982                                                        color to #1, using
983                                                        ANSI escape
984          set_a_foreground            setaf      AF     Set foreground
985                                                        color to #1, using
986                                                        ANSI escape
987          set_color_band              setcolor   Yz     Change to ribbon
988                                                        color #1
989
990
991          set_lr_margin               smglr      ML     Set both left and
992                                                        right margins to
993                                                        #1, #2.  (ML is
994                                                        not in BSD term‐
995                                                        cap).
996          set_page_length             slines     YZ     Set page length to
997                                                        #1 lines
998          set_tb_margin               smgtb      MT     Sets both top and
999                                                        bottom margins to
1000                                                        #1, #2
1001
1002        The XSI Curses standard added these hardcopy capabilities.  They  were
1003        used  in  some post-4.1 versions of System V curses, e.g., Solaris 2.5
1004        and IRIX 6.x.  Except for YI, the ncurses termcap names for  them  are
1005        invented.   According to the XSI Curses standard, they have no termcap
1006        names.  If your compiled terminfo entries use these, they may  not  be
1007        binary-compatible with System V terminfo entries after SVr4.1; beware!
1008
1009
1010                  Variable            Cap-      TCap       Description
1011                   String             name      Code
1012          enter_horizontal_hl_mode    ehhlm     Xh     Enter horizontal
1013                                                       highlight mode
1014          enter_left_hl_mode          elhlm     Xl     Enter left highlight
1015                                                       mode
1016          enter_low_hl_mode           elohlm    Xo     Enter low highlight
1017                                                       mode
1018          enter_right_hl_mode         erhlm     Xr     Enter right high‐
1019                                                       light mode
1020          enter_top_hl_mode           ethlm     Xt     Enter top highlight
1021                                                       mode
1022          enter_vertical_hl_mode      evhlm     Xv     Enter vertical high‐
1023                                                       light mode
1024          set_a_attributes            sgr1      sA     Define second set of
1025                                                       video attributes
1026                                                       #1-#6
1027          set_pglen_inch              slength   YI     Set page length to
1028                                                       #1 hundredth of an
1029                                                       inch (some implemen‐
1030                                                       tations use sL for
1031                                                       termcap).
1032
1033   User-Defined Capabilities
1034       The  preceding  section  listed the predefined capabilities.  They deal
1035       with some special features for terminals no longer (or possibly  never)
1036       produced.   Occasionally  there are special features of newer terminals
1037       which are awkward or impossible to represent by reusing the  predefined
1038       capabilities.
1039
1040       ncurses  addresses  this  limitation by allowing user-defined capabili‐
1041       ties.  The tic and infocmp programs provide the -x option for this pur‐
1042       pose.  When -x is set, tic treats unknown capabilities as user-defined.
1043       That is, if tic encounters a capability name which it does  not  recog‐
1044       nize,  it  infers  its type (boolean, number or string) from the syntax
1045       and makes an extended table entry for  that  capability.   The  use_ex‐
1046       tended_names(3X)  function  makes this information conditionally avail‐
1047       able to applications.  The ncurses library provides  the  data  leaving
1048       most of the behavior to applications:
1049
1050       •   User-defined  capability  strings  whose  name  begins with “k” are
1051           treated as function keys.
1052
1053       •   The types (boolean, number, string) determined by tic  can  be  in‐
1054           ferred by successful calls on tigetflag, etc.
1055
1056       •   If the capability name happens to be two characters, the capability
1057           is also available through the termcap interface.
1058
1059       While termcap is said to be extensible because it does not use a prede‐
1060       fined set of capabilities, in practice it has been limited to the capa‐
1061       bilities defined by terminfo implementations.  As a rule,  user-defined
1062       capabilities intended for use by termcap applications should be limited
1063       to booleans and numbers to avoid running past the 1023 byte  limit  as‐
1064       sumed  by  termcap implementations and their applications.  In particu‐
1065       lar, providing extended sets of function keys  (past  the  60  numbered
1066       keys  and  the  handful  of  special named keys) is best done using the
1067       longer names available using terminfo.
1068
1069   A Sample Entry
1070       The following entry, describing an ANSI-standard terminal, is represen‐
1071       tative  of  what a terminfo entry for a modern terminal typically looks
1072       like.
1073
1074       ansi|ansi/pc-term compatible with color,
1075               am, mc5i, mir, msgr,
1076               colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64,
1077               acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260
1078                    j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303
1079                    u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376,
1080               bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J,
1081               cr=^M, cub=\E[%p1%dD, cub1=\E[D, cud=\E[%p1%dB, cud1=\E[B,
1082               cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
1083               cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P,
1084               dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
1085               el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG, ht=\E[I, hts=\EH,
1086               ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=^J,
1087               indn=\E[%p1%dS, invis=\E[8m, kbs=^H, kcbt=\E[Z, kcub1=\E[D,
1088               kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, khome=\E[H, kich1=\E[L,
1089               mc4=\E[4i, mc5=\E[5i, nel=\r\E[S, op=\E[39;49m,
1090               rep=%p1%c\E[%p2%{1}%-%db, rev=\E[7m, rin=\E[%p1%dT,
1091               rmacs=\E[10m, rmpch=\E[10m, rmso=\E[m, rmul=\E[m,
1092               s0ds=\E(B, s1ds=\E)B, s2ds=\E*B, s3ds=\E+B,
1093               setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
1094               sgr=\E[0;10%?%p1%t;7%;
1095                          %?%p2%t;4%;
1096                          %?%p3%t;7%;
1097                          %?%p4%t;5%;
1098                          %?%p6%t;1%;
1099                          %?%p7%t;8%;
1100                          %?%p9%t;11%;m,
1101               sgr0=\E[0;10m, smacs=\E[11m, smpch=\E[11m, smso=\E[7m,
1102               smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n,
1103               u8=\E[?%[;0123456789]c, u9=\E[c, vpa=\E[%i%p1%dd,
1104
1105       Entries may continue onto multiple lines by placing white space at  the
1106       beginning  of  each line except the first.  Comments may be included on
1107       lines beginning with “#”.  Capabilities in terminfo are of three types:
1108
1109       •   Boolean capabilities which indicate that the terminal has some par‐
1110           ticular feature,
1111
1112       •   numeric capabilities giving the size of the terminal or the size of
1113           particular delays, and
1114
1115       •   string capabilities, which give a sequence which  can  be  used  to
1116           perform particular terminal operations.
1117
1118   Types of Capabilities
1119       All capabilities have names.  For instance, the fact that ANSI-standard
1120       terminals have automatic margins (i.e., an automatic return  and  line-
1121       feed  when the end of a line is reached) is indicated by the capability
1122       am.  Hence the description of ansi includes am.   Numeric  capabilities
1123       are  followed  by  the  character  “#” and then a positive value.  Thus
1124       cols, which indicates the number of columns the terminal has, gives the
1125       value  “80” for ansi.  Values for numeric capabilities may be specified
1126       in decimal, octal or hexadecimal, using the C programming language con‐
1127       ventions (e.g., 255, 0377 and 0xff or 0xFF).
1128
1129       Finally,  string  valued capabilities, such as el (clear to end of line
1130       sequence) are given by the two-character  code,  an  “=”,  and  then  a
1131       string ending at the next following “,”.
1132
1133       A number of escape sequences are provided in the string valued capabil‐
1134       ities for easy encoding of characters there:
1135
1136       •   Both \E and \e map to an ESCAPE character,
1137
1138^x maps to a control-x for any appropriate x, and
1139
1140       •   the sequences
1141
1142             \n, \l, \r, \t, \b, \f, and \s
1143
1144           produce
1145
1146             newline, line-feed, return, tab, backspace, form-feed, and space,
1147
1148           respectively.
1149
1150       X/Open Curses does not say what “appropriate x” might be.  In practice,
1151       that  is a printable ASCII graphic character.  The special case “^?” is
1152       interpreted as DEL (127).  In all other cases, the character  value  is
1153       AND'd  with 0x1f, mapping to ASCII control codes in the range 0 through
1154       31.
1155
1156       Other escapes include
1157
1158\^ for ^,
1159
1160\\ for \,
1161
1162\, for comma,
1163
1164\: for :,
1165
1166       •   and \0 for null.
1167
1168           \0 will produce \200, which does not terminate a string but behaves
1169           as  a null character on most terminals, providing CS7 is specified.
1170           See stty(1).
1171
1172           The reason for this quirk is to maintain  binary  compatibility  of
1173           the  compiled  terminfo files with other implementations, e.g., the
1174           SVr4 systems, which document this.   Compiled  terminfo  files  use
1175           null-terminated strings, with no lengths.  Modifying this would re‐
1176           quire a new binary format, which would not work with  other  imple‐
1177           mentations.
1178
1179       Finally, characters may be given as three octal digits after a \.
1180
1181       A delay in milliseconds may appear anywhere in a string capability, en‐
1182       closed in $<..> brackets, as in el=\EK$<5>, and padding characters  are
1183       supplied by tputs(3X) to provide this delay.
1184
1185       •   The delay must be a number with at most one decimal place of preci‐
1186           sion; it may be followed by suffixes “*” or “/” or both.
1187
1188       •   A “*” indicates that the padding required is  proportional  to  the
1189           number  of lines affected by the operation, and the amount given is
1190           the per-affected-unit padding required.  (In  the  case  of  insert
1191           character, the factor is still the number of lines affected.)
1192
1193           Normally, padding is advisory if the device has the xon capability;
1194           it is used for cost computation but does not trigger delays.
1195
1196       •   A “/” suffix indicates that the padding is mandatory and  forces  a
1197           delay of the given number of milliseconds even on devices for which
1198           xon is present to indicate flow control.
1199
1200       Sometimes individual capabilities must be commented out.  To  do  this,
1201       put  a  period before the capability name.  For example, see the second
1202       ind in the example above.
1203
1204   Fetching Compiled Descriptions
1205       The ncurses library  searches  for  terminal  descriptions  in  several
1206       places.   It  uses only the first description found.  The library has a
1207       compiled-in list of places to search which can be overridden  by  envi‐
1208       ronment  variables.   Before starting to search, ncurses eliminates du‐
1209       plicates in its search list.
1210
1211       •   If the environment variable TERMINFO is set, it is  interpreted  as
1212           the pathname of a directory containing the compiled description you
1213           are working on.  Only that directory is searched.
1214
1215       •   If TERMINFO is not set, ncurses will instead look in the  directory
1216           $HOME/.terminfo for a compiled description.
1217
1218       •   Next,  if  the  environment  variable TERMINFO_DIRS is set, ncurses
1219           will interpret the contents of that variable as a  list  of  colon-
1220           separated directories (or database files) to be searched.
1221
1222           An  empty directory name (i.e., if the variable begins or ends with
1223           a colon, or contains adjacent colons) is interpreted as the  system
1224           location /usr/share/terminfo.
1225
1226       •   Finally, ncurses searches these compiled-in locations:
1227
1228           •   a list of directories (no default value), and
1229
1230           •   the  system  terminfo  directory, /usr/share/terminfo (the com‐
1231               piled-in default).
1232
1233   Preparing Descriptions
1234       We now outline how to prepare descriptions of terminals.  The most  ef‐
1235       fective  way  to prepare a terminal description is by imitating the de‐
1236       scription of a similar terminal in terminfo and to build up a  descrip‐
1237       tion  gradually,  using  partial  descriptions  with  vi  or some other
1238       screen-oriented program to check that they are correct.  Be aware  that
1239       a  very  unusual terminal may expose deficiencies in the ability of the
1240       terminfo file to describe it or bugs in the screen-handling code of the
1241       test program.
1242
1243       To  get the padding for insert line right (if the terminal manufacturer
1244       did not document it) a severe test is to edit  a  large  file  at  9600
1245       baud, delete 16 or so lines from the middle of the screen, then hit the
1246       “u” key several times quickly.  If the terminal messes up, more padding
1247       is usually needed.  A similar test can be used for insert character.
1248
1249   Basic Capabilities
1250       The  number  of  columns  on each line for the terminal is given by the
1251       cols numeric capability.  If the terminal is a CRT, then the number  of
1252       lines  on the screen is given by the lines capability.  If the terminal
1253       wraps around to the beginning of the next  line  when  it  reaches  the
1254       right  margin,  then it should have the am capability.  If the terminal
1255       can clear its screen, leaving the cursor in  the  home  position,  then
1256       this  is  given  by the clear string capability.  If the terminal over‐
1257       strikes (rather than clearing a position when  a  character  is  struck
1258       over)  then  it  should  have  the os capability.  If the terminal is a
1259       printing terminal, with no soft copy unit, give it both hc and os.  (os
1260       applies  to  storage scope terminals, such as TEKTRONIX 4010 series, as
1261       well as hard copy and APL terminals.)  If there is a code to  move  the
1262       cursor to the left edge of the current row, give this as cr.  (Normally
1263       this will be carriage return, control/M.)  If there is a code  to  pro‐
1264       duce an audible signal (bell, beep, etc) give this as bel.
1265
1266       If there is a code to move the cursor one position to the left (such as
1267       backspace) that capability should be given as cub1.   Similarly,  codes
1268       to  move  to the right, up, and down should be given as cuf1, cuu1, and
1269       cud1.  These local cursor motions should not alter the text  they  pass
1270       over,  for  example,  you  would  not normally use “cuf1= ” because the
1271       space would erase the character moved over.
1272
1273       A very important point here is that the local cursor motions encoded in
1274       terminfo  are  undefined  at  the left and top edges of a CRT terminal.
1275       Programs should never attempt to backspace around the left edge, unless
1276       bw  is given, and never attempt to go up locally off the top.  In order
1277       to scroll text up, a program will go to the bottom left corner  of  the
1278       screen and send the ind (index) string.
1279
1280       To  scroll  text  down,  a  program  goes to the top left corner of the
1281       screen and sends the ri (reverse index) string.  The strings ind and ri
1282       are undefined when not on their respective corners of the screen.
1283
1284       Parameterized  versions  of  the  scrolling  sequences are indn and rin
1285       which have the same semantics as ind and ri except that they  take  one
1286       parameter,  and scroll that many lines.  They are also undefined except
1287       at the appropriate edge of the screen.
1288
1289       The am capability tells whether the cursor sticks at the right edge  of
1290       the  screen when text is output, but this does not necessarily apply to
1291       a cuf1 from the last column.  The only local motion  which  is  defined
1292       from  the  left  edge is if bw is given, then a cub1 from the left edge
1293       will move to the right edge of the previous row.  If bw is  not  given,
1294       the  effect  is undefined.  This is useful for drawing a box around the
1295       edge of the screen, for example.  If the terminal has switch selectable
1296       automatic  margins,  the terminfo file usually assumes that this is on;
1297       i.e., am.  If the terminal has a command which moves to the first  col‐
1298       umn  of  the next line, that command can be given as nel (newline).  It
1299       does not matter if the command clears  the  remainder  of  the  current
1300       line,  so  if the terminal has no cr and lf it may still be possible to
1301       craft a working nel out of one or both of them.
1302
1303       These capabilities suffice to describe hard-copy and “glass-tty” termi‐
1304       nals.  Thus the model 33 teletype is described as
1305
1306       33|tty33|tty|model 33 teletype,
1307               bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,
1308
1309       while the Lear Siegler ADM-3 is described as
1310
1311       adm3|3|lsi adm3,
1312               am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
1313               ind=^J, lines#24,
1314
1315   Parameterized Strings
1316       Cursor  addressing and other strings requiring parameters in the termi‐
1317       nal are described by a parameterized string  capability,  with  printf-
1318       like escapes such as %x in it.  For example, to address the cursor, the
1319       cup capability is given, using two parameters: the row  and  column  to
1320       address  to.  (Rows and columns are numbered from zero and refer to the
1321       physical screen visible to the user, not to any unseen memory.)  If the
1322       terminal  has  memory relative cursor addressing, that can be indicated
1323       by mrcup.
1324
1325       The parameter mechanism uses a stack and special % codes to  manipulate
1326       it.   Typically  a  sequence  will  push one of the parameters onto the
1327       stack and then print it in some format.  Print (e.g., “%d”) is  a  spe‐
1328       cial case.  Other operations, including “%t” pop their operand from the
1329       stack.  It is noted that more complex operations are  often  necessary,
1330       e.g., in the sgr string.
1331
1332       The % encodings have the following meanings:
1333
1334       %%   outputs “%”
1335
1336       %[[:]flags][width[.precision]][doxXs]
1337            as  in  printf(3),  flags are [-+#] and space.  Use a “:” to allow
1338            the next character to be a “-” flag, avoiding interpreting “%-” as
1339            an operator.
1340
1341       %c   print pop() like %c in printf
1342
1343       %s   print pop() like %s in printf
1344
1345       %p[1-9]
1346            push i'th parameter
1347
1348       %P[a-z]
1349            set dynamic variable [a-z] to pop()
1350
1351       %g[a-z]
1352            get dynamic variable [a-z] and push it
1353
1354       %P[A-Z]
1355            set static variable [a-z] to pop()
1356
1357       %g[A-Z]
1358            get static variable [a-z] and push it
1359
1360            The  terms  “static”  and “dynamic” are misleading.  Historically,
1361            these are simply two different sets of variables, whose values are
1362            not  reset  between calls to tparm(3X).  However, that fact is not
1363            documented in other implementations.  Relying on it will adversely
1364            impact portability to other implementations:
1365
1366            •   SVr2  curses  supported dynamic variables.  Those are set only
1367                by a %P operator.  A %g for a  given  variable  without  first
1368                setting  it  with  %P will give unpredictable results, because
1369                dynamic variables are an  uninitialized  local  array  on  the
1370                stack in the tparm function.
1371
1372            •   SVr3.2  curses supported static variables.  Those are an array
1373                in the TERMINAL structure (declared in term.h), and are zeroed
1374                automatically when the setupterm function allocates the data.
1375
1376            •   SVr4 curses made no further improvements to the dynamic/static
1377                variable feature.
1378
1379            •   Solaris XPG4 curses does not distinguish between  dynamic  and
1380                static  variables.  They are the same.  Like SVr4 curses, XPG4
1381                curses does not initialize these explicitly.
1382
1383            •   Before version 6.3, ncurses stores  both  dynamic  and  static
1384                variables in persistent storage, initialized to zeros.
1385
1386            •   Beginning  with version 6.3, ncurses stores static and dynamic
1387                variables in the same manner as SVr4.
1388
1389                •   Unlike other implementations, ncurses zeros dynamic  vari‐
1390                    ables before the first %g or %P operator.
1391
1392                •   Like  SVr2,  the  scope of dynamic variables in ncurses is
1393                    within the current call to tparm.  Use static variables if
1394                    persistent storage is needed.
1395
1396       %'c' char constant c
1397
1398       %{nn}
1399            integer constant nn
1400
1401       %l   push strlen(pop)
1402
1403       %+, %-, %*, %/, %m
1404            arithmetic (%m is mod): push(pop() op pop())
1405
1406       %&, %|, %^
1407            bit operations (AND, OR and exclusive-OR): push(pop() op pop())
1408
1409       %=, %>, %<
1410            logical operations: push(pop() op pop())
1411
1412       %A, %O
1413            logical AND and OR operations (for conditionals)
1414
1415       %!, %~
1416            unary operations (logical and bit complement): push(op pop())
1417
1418       %i   add 1 to first two parameters (for ANSI terminals)
1419
1420       %? expr %t thenpart %e elsepart %;
1421            This forms an if-then-else.  The %e elsepart is optional.  Usually
1422            the %? expr part pushes a value onto the stack,  and  %t  pops  it
1423            from  the  stack,  testing if it is nonzero (true).  If it is zero
1424            (false), control passes to the %e (else) part.
1425
1426            It is possible to form else-if's a la Algol 68:
1427            %? c1 %t b1 %e c2 %t b2 %e c3 %t b3 %e c4 %t b4 %e %;
1428
1429            where ci are conditions, bi are bodies.
1430
1431            Use the -f option of tic or infocmp to see the  structure  of  if-
1432            then-else's.  Some strings, e.g., sgr can be very complicated when
1433            written on one line.  The -f option splits the string  into  lines
1434            with the parts indented.
1435
1436       Binary  operations  are  in postfix form with the operands in the usual
1437       order.  That is, to get x-5 one would use “%gx%{5}%-”.  %P and %g vari‐
1438       ables are persistent across escape-string evaluations.
1439
1440       Consider  the HP2645, which, to get to row 3 and column 12, needs to be
1441       sent \E&a12c03Y padded for 6 milliseconds.  Note that the order of  the
1442       rows  and  columns  is  inverted  here, and that the row and column are
1443       printed   as   two   digits.     Thus    its    cup    capability    is
1444       “cup=6\E&%p2%2dc%p1%2dY”.
1445
1446       The  Microterm ACT-IV needs the current row and column sent preceded by
1447       a  ^T,  with  the  row   and   column   simply   encoded   in   binary,
1448       “cup=^T%p1%c%p2%c”.   Terminals  which  use  “%c”  need  to  be able to
1449       backspace the cursor (cub1), and to move the cursor up one line on  the
1450       screen  (cuu1).   This  is  necessary  because it is not always safe to
1451       transmit \n ^D and \r, as the system may change or discard them.   (The
1452       library  routines  dealing with terminfo set tty modes so that tabs are
1453       never expanded, so \t is safe to send.  This turns out to be  essential
1454       for the Ann Arbor 4080.)
1455
1456       A  final example is the LSI ADM-3a, which uses row and column offset by
1457       a blank character, thus “cup=\E=%p1%' '%+%c%p2%' '%+%c”.  After sending
1458       “\E=”,  this  pushes  the first parameter, pushes the ASCII value for a
1459       space (32), adds them (pushing the sum on the stack in place of the two
1460       previous  values) and outputs that value as a character.  Then the same
1461       is done for the second parameter.  More complex arithmetic is  possible
1462       using the stack.
1463
1464   Cursor Motions
1465       If  the  terminal has a fast way to home the cursor (to very upper left
1466       corner of screen) then this can be given as home; similarly a fast  way
1467       of  getting  to the lower left-hand corner can be given as ll; this may
1468       involve going up with cuu1 from the home position, but a program should
1469       never do this itself (unless ll does) because it can make no assumption
1470       about the effect of moving up from the home position.   Note  that  the
1471       home  position is the same as addressing to (0,0): to the top left cor‐
1472       ner of the screen, not of memory.  (Thus, the \EH sequence on HP termi‐
1473       nals cannot be used for home.)
1474
1475       If the terminal has row or column absolute cursor addressing, these can
1476       be given as single parameter capabilities hpa (horizontal position  ab‐
1477       solute)  and  vpa  (vertical  position  absolute).  Sometimes these are
1478       shorter than the more general  two  parameter  sequence  (as  with  the
1479       hp2645)  and can be used in preference to cup.  If there are parameter‐
1480       ized local motions (e.g., move n spaces to  the  right)  these  can  be
1481       given  as cud, cub, cuf, and cuu with a single parameter indicating how
1482       many spaces to move.  These are primarily useful if the  terminal  does
1483       not have cup, such as the TEKTRONIX 4025.
1484
1485       If  the  terminal  needs to be in a special mode when running a program
1486       that uses these capabilities, the codes to enter and exit this mode can
1487       be  given as smcup and rmcup.  This arises, for example, from terminals
1488       like the Concept with more than one page of memory.   If  the  terminal
1489       has only memory relative cursor addressing and not screen relative cur‐
1490       sor addressing, a one screen-sized window must be fixed into the termi‐
1491       nal  for cursor addressing to work properly.  This is also used for the
1492       TEKTRONIX 4025, where smcup sets the command character to  be  the  one
1493       used  by  terminfo.   If the smcup sequence will not restore the screen
1494       after an rmcup sequence is output (to the state prior to outputting rm‐
1495       cup), specify nrrmc.
1496
1497   Margins
1498       SVr4  (and  X/Open Curses) list several string capabilities for setting
1499       margins.  Two were intended for use with  terminals,  and  another  six
1500       were intended for use with printers.
1501
1502       •   The two terminal capabilities assume that the terminal may have the
1503           capability of setting the left and/or right margin at  the  current
1504           cursor column position.
1505
1506       •   The printer capabilities assume that the printer may have two types
1507           of capability:
1508
1509           •   the ability to set a top and/or bottom margin using the current
1510               line position, and
1511
1512           •   parameterized  capabilities  for setting the top, bottom, left,
1513               right margins given the number of rows or columns.
1514
1515       In practice, the categorization into “terminal” and  “printer”  is  not
1516       suitable:
1517
1518       •   The  AT&T  SVr4  terminal  database  uses smgl four times, for AT&T
1519           hardware.
1520
1521           Three of the four are printers.   They  lack  the  ability  to  set
1522           left/right margins by specifying the column.
1523
1524       •   Other  (non-AT&T) terminals may support margins but using different
1525           assumptions from AT&T.
1526
1527           For instance, the DEC VT420 supports left/right margins,  but  only
1528           using a column parameter.  As an added complication, the VT420 uses
1529           two settings to fully enable left/right margins (left/right  margin
1530           mode,  and  origin  mode).   The  former enables the margins, which
1531           causes printed text to wrap  within  margins,  but  the  latter  is
1532           needed to prevent cursor-addressing outside those margins.
1533
1534       •   Both DEC VT420 left/right margins are set with a single control se‐
1535           quence.  If either is omitted, the corresponding margin is  set  to
1536           the left or right edge of the display (rather than leaving the mar‐
1537           gin unmodified).
1538
1539       These are the margin-related capabilities:
1540
1541                Name       Description
1542                ──────────────────────────────────────────────────────
1543                smgl       Set left margin at current column
1544                smgr       Set right margin at current column
1545                smgb       Set bottom margin at current line
1546                smgt       Set top margin at current line
1547                smgbp      Set bottom margin at line N
1548                smglp      Set left margin at column N
1549                smgrp      Set right margin at column N
1550                smgtp      Set top margin at line N
1551                smglr      Set both left and right margins to L and R
1552                smgtb      Set both top and bottom margins to T and B
1553
1554       When writing an application that uses these  string  capabilities,  the
1555       pairs  should be first checked to see if each capability in the pair is
1556       set or only one is set:
1557
1558       •   If both smglp and smgrp are set, each is used with a  single  argu‐
1559           ment, N, that gives the column number of the left and right margin,
1560           respectively.
1561
1562       •   If both smgtp and smgbp are set, each is used to set  the  top  and
1563           bottom margin, respectively:
1564
1565smgtp is used with a single argument, N, the line number of the
1566               top margin.
1567
1568smgbp is used with two arguments, N and M, that give  the  line
1569               number of the bottom margin, the first counting from the top of
1570               the page and the second counting from the bottom.  This  accom‐
1571               modates  the two styles of specifying the bottom margin in dif‐
1572               ferent manufacturers' printers.
1573
1574           When designing a terminfo entry for a printer that has  a  settable
1575           bottom  margin,  only  the first or second argument should be used,
1576           depending on the printer.  When developing an application that uses
1577           smgbp to set the bottom margin, both arguments must be given.
1578
1579       Conversely, when only one capability in the pair is set:
1580
1581       •   If only one of smglp and smgrp is set, then it is used with two ar‐
1582           guments, the column number of the left and right margins,  in  that
1583           order.
1584
1585       •   Likewise,  if  only  one of smgtp and smgbp is set, then it is used
1586           with two arguments that give the top and bottom  margins,  in  that
1587           order, counting from the top of the page.
1588
1589           When designing a terminfo entry for a printer that requires setting
1590           both left and right or top and bottom margins simultaneously,  only
1591           one  capability  in  the  pairs  smglp and smgrp or smgtp and smgbp
1592           should be defined, leaving the other unset.
1593
1594       Except for very old terminal descriptions, e.g.,  those  developed  for
1595       SVr4,  the scheme just described should be considered obsolete.  An im‐
1596       proved set of capabilities was added late in the SVr4  releases  (smglr
1597       and  smgtb),  which  explicitly  use  two  parameters  for  setting the
1598       left/right or top/bottom margins.
1599
1600       When setting margins, the line- and column-values are zero-based.
1601
1602       The mgc string capability should  be  defined.   Applications  such  as
1603       tabs(1) rely upon this to reset all margins.
1604
1605   Area Clears
1606       If  the  terminal can clear from the current position to the end of the
1607       line, leaving the cursor where it is, this should be given as  el.   If
1608       the  terminal  can  clear from the beginning of the line to the current
1609       position inclusive, leaving the cursor where  it  is,  this  should  be
1610       given  as  el1.  If the terminal can clear from the current position to
1611       the end of the display, then this should be given as ed.   Ed  is  only
1612       defined from the first column of a line.  (Thus, it can be simulated by
1613       a request to delete a large number of lines, if a true ed is not avail‐
1614       able.)
1615
1616   Insert/delete line and vertical motions
1617       If  the  terminal  can  open a new blank line before the line where the
1618       cursor is, this should be given as il1; this  is  done  only  from  the
1619       first  position  of  a  line.  The cursor must then appear on the newly
1620       blank line.  If the terminal can delete the line which  the  cursor  is
1621       on,  then this should be given as dl1; this is done only from the first
1622       position on the line to be deleted.  Versions of il1 and dl1 which take
1623       a single parameter and insert or delete that many lines can be given as
1624       il and dl.
1625
1626       If the terminal has a settable scrolling region (like  the  vt100)  the
1627       command  to  set  this  can be described with the csr capability, which
1628       takes two parameters: the top and bottom lines of the scrolling region.
1629       The cursor position is, alas, undefined after using this command.
1630
1631       It  is possible to get the effect of insert or delete line using csr on
1632       a properly chosen region; the sc and rc (save and restore cursor)  com‐
1633       mands  may  be  useful for ensuring that your synthesized insert/delete
1634       string does not move the cursor.  (Note that  the  ncurses(3X)  library
1635       does  this  synthesis  automatically,  so  you  need  not  compose  in‐
1636       sert/delete strings for an entry with csr).
1637
1638       Yet another way to construct insert and delete might be to use a combi‐
1639       nation  of  index  with the memory-lock feature found on some terminals
1640       (like the HP-700/90 series, which however also has insert/delete).
1641
1642       Inserting lines at the top or bottom of the screen can also be done us‐
1643       ing  ri or ind on many terminals without a true insert/delete line, and
1644       is often faster even on terminals with those features.
1645
1646       The boolean non_dest_scroll_region should be set if each scrolling win‐
1647       dow  is  effectively a view port on a screen-sized canvas.  To test for
1648       this capability, create a scrolling region in the middle of the screen,
1649       write  something  to the bottom line, move the cursor to the top of the
1650       region, and do ri followed by dl1 or ind.  If the data scrolled off the
1651       bottom  of  the  region by the ri re-appears, then scrolling is non-de‐
1652       structive.  System V and XSI Curses expect that ind, ri, indn, and  rin
1653       will  simulate  destructive scrolling; their documentation cautions you
1654       not to define csr unless this is true.  This curses  implementation  is
1655       more  liberal  and  will do explicit erases after scrolling if ndsrc is
1656       defined.
1657
1658       If the terminal has the ability to define a window as part  of  memory,
1659       which  all  commands  affect,  it  should be given as the parameterized
1660       string wind.  The four parameters are the starting and ending lines  in
1661       memory and the starting and ending columns in memory, in that order.
1662
1663       If the terminal can retain display memory above, then the da capability
1664       should be given; if display memory  can  be  retained  below,  then  db
1665       should  be given.  These indicate that deleting a line or scrolling may
1666       bring non-blank lines up from below or that scrolling back with ri  may
1667       bring down non-blank lines.
1668
1669   Insert/Delete Character
1670       There  are two basic kinds of intelligent terminals with respect to in‐
1671       sert/delete character which can be described using terminfo.  The  most
1672       common insert/delete character operations affect only the characters on
1673       the current line and shift characters off the end of the line  rigidly.
1674       Other terminals, such as the Concept 100 and the Perkin Elmer Owl, make
1675       a distinction between typed and untyped blanks on the screen,  shifting
1676       upon  an  insert or delete only to an untyped blank on the screen which
1677       is either eliminated, or expanded to two untyped blanks.
1678
1679       You can determine the kind of terminal you have by clearing the  screen
1680       and  then  typing  text separated by cursor motions.  Type “abc    def”
1681       using local cursor motions (not  spaces)  between  the  “abc”  and  the
1682       “def”.   Then position the cursor before the “abc” and put the terminal
1683       in insert mode.  If typing characters causes the rest of  the  line  to
1684       shift  rigidly  and  characters to fall off the end, then your terminal
1685       does not distinguish between blanks  and  untyped  positions.   If  the
1686       “abc”  shifts over to the “def” which then move together around the end
1687       of the current line and onto the next as you insert, you have the  sec‐
1688       ond  type  of terminal, and should give the capability in, which stands
1689       for “insert null”.
1690
1691       While these are two logically  separate  attributes  (one  line  versus
1692       multi-line  insert  mode,  and  special treatment of untyped spaces) we
1693       have seen no terminals whose insert mode cannot be described  with  the
1694       single attribute.
1695
1696       Terminfo  can  describe  both  terminals which have an insert mode, and
1697       terminals which send a simple sequence to open a blank position on  the
1698       current line.  Give as smir the sequence to get into insert mode.  Give
1699       as rmir the sequence to leave insert mode.  Now give as  ich1  any  se‐
1700       quence  needed  to  be sent just before sending the character to be in‐
1701       serted.  Most terminals with a true insert mode  will  not  give  ich1;
1702       terminals  which  send a sequence to open a screen position should give
1703       it here.
1704
1705       If your terminal has both, insert mode is usually preferable  to  ich1.
1706       Technically,  you should not give both unless the terminal actually re‐
1707       quires both to be used in combination.   Accordingly,  some  non-curses
1708       applications  get  confused if both are present; the symptom is doubled
1709       characters in an update using insert.  This requirement  is  now  rare;
1710       most  ich  sequences do not require previous smir, and most smir insert
1711       modes do not require ich1 before each character.   Therefore,  the  new
1712       curses  actually  assumes this is the case and uses either rmir/smir or
1713       ich/ich1 as appropriate (but not both).  If you have to write an  entry
1714       to be used under new curses for a terminal old enough to need both, in‐
1715       clude the rmir/smir sequences in ich1.
1716
1717       If post insert padding is needed, give this as a number of milliseconds
1718       in  ip (a string option).  Any other sequence which may need to be sent
1719       after an insert of a single character may also be given in ip.  If your
1720       terminal  needs  both  to be placed into an “insert mode” and a special
1721       code to precede each inserted character, then both smir/rmir  and  ich1
1722       can  be given, and both will be used.  The ich capability, with one pa‐
1723       rameter, n, will repeat the effects of ich1 n times.
1724
1725       If padding is necessary between characters typed while  not  in  insert
1726       mode, give this as a number of milliseconds padding in rmp.
1727
1728       It  is  occasionally  necessary  to move around while in insert mode to
1729       delete characters on the same line (e.g., if there is a tab  after  the
1730       insertion  position).   If  your terminal allows motion while in insert
1731       mode you can give the capability mir to  speed  up  inserting  in  this
1732       case.   Omitting  mir  will affect only speed.  Some terminals (notably
1733       Datamedia's) must not have mir because of the  way  their  insert  mode
1734       works.
1735
1736       Finally,  you  can  specify dch1 to delete a single character, dch with
1737       one parameter, n, to delete n characters, and  delete  mode  by  giving
1738       smdc  and  rmdc  to  enter  and exit delete mode (any mode the terminal
1739       needs to be placed in for dch1 to work).
1740
1741       A command to erase n characters  (equivalent  to  outputting  n  blanks
1742       without moving the cursor) can be given as ech with one parameter.
1743
1744   Highlighting, Underlining, and Visible Bells
1745       If your terminal has one or more kinds of display attributes, these can
1746       be represented in a number of different ways.  You  should  choose  one
1747       display  form  as  standout  mode,  representing a good, high contrast,
1748       easy-on-the-eyes, format for highlighting error messages and other  at‐
1749       tention getters.  (If you have a choice, reverse video plus half-bright
1750       is good, or reverse video alone.)  The  sequences  to  enter  and  exit
1751       standout mode are given as smso and rmso, respectively.  If the code to
1752       change into or out of standout mode leaves one or even two blank spaces
1753       on  the  screen, as the TVI 912 and Teleray 1061 do, then xmc should be
1754       given to tell how many spaces are left.
1755
1756       Codes to begin underlining and end underlining can be given as smul and
1757       rmul respectively.  If the terminal has a code to underline the current
1758       character and move the cursor one space to the right, such as  the  Mi‐
1759       croterm Mime, this can be given as uc.
1760
1761       Other  capabilities  to  enter various highlighting modes include blink
1762       (blinking) bold (bold or extra bright) dim (dim or  half-bright)  invis
1763       (blanking  or invisible text) prot (protected) rev (reverse video) sgr0
1764       (turn off all attribute modes) smacs  (enter  alternate  character  set
1765       mode) and rmacs (exit alternate character set mode).  Turning on any of
1766       these modes singly may or may not turn off other modes.
1767
1768       If there is a sequence to set arbitrary  combinations  of  modes,  this
1769       should be given as sgr (set attributes), taking 9 parameters.  Each pa‐
1770       rameter is either 0 or nonzero, as the corresponding attribute is on or
1771       off.   The  9  parameters  are, in order: standout, underline, reverse,
1772       blink, dim, bold, blank, protect, alternate  character  set.   Not  all
1773       modes need be supported by sgr, only those for which corresponding sep‐
1774       arate attribute commands exist.
1775
1776       For example, the DEC vt220 supports most of the modes:
1777
1778               tparm parameter      attribute        escape sequence
1779
1780               none                 none             \E[0m
1781               p1                   standout         \E[0;1;7m
1782               p2                   underline        \E[0;4m
1783               p3                   reverse          \E[0;7m
1784               p4                   blink            \E[0;5m
1785               p5                   dim              not available
1786               p6                   bold             \E[0;1m
1787               p7                   invis            \E[0;8m
1788               p8                   protect          not used
1789               p9                   altcharset       ^O (off) ^N (on)
1790
1791       We begin each escape sequence by turning off any existing modes,  since
1792       there  is  no quick way to determine whether they are active.  Standout
1793       is set up to be the combination of reverse and bold.  The vt220  termi‐
1794       nal  has  a protect mode, though it is not commonly used in sgr because
1795       it protects characters on the screen from  the  host's  erasures.   The
1796       altcharset  mode  also  is different in that it is either ^O or ^N, de‐
1797       pending on whether it is off or on.  If all modes are  turned  on,  the
1798       resulting sequence is \E[0;1;4;5;7;8m^N.
1799
1800       Some  sequences are common to different modes.  For example, ;7 is out‐
1801       put when either p1 or p3 is true, that is, if either  standout  or  re‐
1802       verse modes are turned on.
1803
1804       Writing out the above sequences, along with their dependencies yields
1805
1806            sequence             when to output      terminfo translation
1807
1808            \E[0                 always              \E[0
1809            ;1                   if p1 or p6         %?%p1%p6%|%t;1%;
1810            ;4                   if p2               %?%p2%|%t;4%;
1811            ;5                   if p4               %?%p4%|%t;5%;
1812            ;7                   if p1 or p3         %?%p1%p3%|%t;7%;
1813            ;8                   if p7               %?%p7%|%t;8%;
1814            m                    always              m
1815            ^N or ^O             if p9 ^N, else ^O   %?%p9%t^N%e^O%;
1816
1817       Putting this all together into the sgr sequence gives:
1818
1819           sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p4%t;5%;
1820               %?%p1%p3%|%t;7%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
1821
1822       Remember  that  if  you specify sgr, you must also specify sgr0.  Also,
1823       some implementations rely on sgr being given if sgr0 is, Not  all  ter‐
1824       minfo  entries  necessarily have an sgr string, however.  Many terminfo
1825       entries are derived from termcap entries which have no sgr string.  The
1826       only drawback to adding an sgr string is that termcap also assumes that
1827       sgr0 does not exit alternate character set mode.
1828
1829       Terminals with the “magic cookie” glitch (xmc) deposit  special  “cook‐
1830       ies” when they receive mode-setting sequences, which affect the display
1831       algorithm rather than having extra bits for each character.  Some  ter‐
1832       minals,  such  as  the  HP 2621, automatically leave standout mode when
1833       they move to a new line or the cursor  is  addressed.   Programs  using
1834       standout  mode  should  exit  standout mode before moving the cursor or
1835       sending a newline, unless the msgr capability,  asserting  that  it  is
1836       safe to move in standout mode, is present.
1837
1838       If  the  terminal has a way of flashing the screen to indicate an error
1839       quietly (a bell replacement) then this can be given as flash;  it  must
1840       not move the cursor.
1841
1842       If  the cursor needs to be made more visible than normal when it is not
1843       on the bottom line (to make, for example, a non-blinking underline into
1844       an  easier  to  find block or blinking underline) give this sequence as
1845       cvvis.  If there is a way to make the cursor completely invisible, give
1846       that  as  civis.  The capability cnorm should be given which undoes the
1847       effects of both of these modes.
1848
1849       If your terminal correctly generates  underlined  characters  (with  no
1850       special  codes  needed)  even  though  it does not overstrike, then you
1851       should give the capability ul.  If  a  character  overstriking  another
1852       leaves  both  characters  on the screen, specify the capability os.  If
1853       overstrikes are erasable with a blank, then this should be indicated by
1854       giving eo.
1855
1856   Keypad and Function Keys
1857       If  the  terminal  has  a keypad that transmits codes when the keys are
1858       pressed, this information can be given.  Note that it is  not  possible
1859       to handle terminals where the keypad only works in local (this applies,
1860       for example, to the unshifted HP 2621 keys).  If the keypad can be  set
1861       to transmit or not transmit, give these codes as smkx and rmkx.  Other‐
1862       wise the keypad is assumed to always transmit.
1863
1864       The codes sent by the left arrow, right arrow, up  arrow,  down  arrow,
1865       and home keys can be given as kcub1, kcuf1, kcuu1, kcud1, and khome re‐
1866       spectively.  If there are function keys such as f0, f1, ...,  f10,  the
1867       codes  they  send  can  be given as kf0, kf1, ..., kf10.  If these keys
1868       have labels other than the default f0 through f10, the  labels  can  be
1869       given as lf0, lf1, ..., lf10.
1870
1871       The codes transmitted by certain other special keys can be given:
1872
1873kll (home down),
1874
1875kbs (backspace),
1876
1877ktbc (clear all tabs),
1878
1879kctab (clear the tab stop in this column),
1880
1881kclr (clear screen or erase key),
1882
1883kdch1 (delete character),
1884
1885kdl1 (delete line),
1886
1887krmir (exit insert mode),
1888
1889kel (clear to end of line),
1890
1891ked (clear to end of screen),
1892
1893kich1 (insert character or enter insert mode),
1894
1895kil1 (insert line),
1896
1897knp (next page),
1898
1899kpp (previous page),
1900
1901kind (scroll forward/down),
1902
1903kri (scroll backward/up),
1904
1905khts (set a tab stop in this column).
1906
1907       In  addition,  if  the  keypad has a 3 by 3 array of keys including the
1908       four arrow keys, the other five keys can be given  as  ka1,  ka3,  kb2,
1909       kc1,  and  kc3.  These keys are useful when the effects of a 3 by 3 di‐
1910       rectional pad are needed.
1911
1912       Strings to program function keys can be given as pfkey, pfloc, and pfx.
1913       A  string to program screen labels should be specified as pln.  Each of
1914       these strings takes two parameters: the function key number to  program
1915       (from 0 to 10) and the string to program it with.  Function key numbers
1916       out of this range may program undefined keys in  a  terminal  dependent
1917       manner.   The  difference between the capabilities is that pfkey causes
1918       pressing the given key to be the same as  the  user  typing  the  given
1919       string;  pfloc  causes the string to be executed by the terminal in lo‐
1920       cal; and pfx causes the string to be transmitted to the computer.
1921
1922       The capabilities nlab, lw and lh  define  the  number  of  programmable
1923       screen  labels  and  their  width and height.  If there are commands to
1924       turn the labels on and off, give them in smln and rmln.  smln  is  nor‐
1925       mally  output  after  one  or  more pln sequences to make sure that the
1926       change becomes visible.
1927
1928   Tabs and Initialization
1929       A few capabilities are used only for tabs:
1930
1931       •   If the terminal has hardware tabs, the command to  advance  to  the
1932           next tab stop can be given as ht (usually control/I).
1933
1934       •   A “back-tab” command which moves leftward to the preceding tab stop
1935           can be given as cbt.
1936
1937           By convention, if the teletype modes indicate that tabs  are  being
1938           expanded  by  the  computer rather than being sent to the terminal,
1939           programs should not use ht or cbt even if they are  present,  since
1940           the user may not have the tab stops properly set.
1941
1942       •   If  the  terminal has hardware tabs which are initially set every n
1943           spaces when the terminal is powered up, the numeric parameter it is
1944           given, showing the number of spaces the tabs are set to.
1945
1946           The it capability is normally used by the tset command to determine
1947           whether to set the mode for hardware tab expansion, and whether  to
1948           set the tab stops.  If the terminal has tab stops that can be saved
1949           in non-volatile memory, the terminfo description  can  assume  that
1950           they are properly set.
1951
1952       Other capabilities include
1953
1954is1, is2, and is3, initialization strings for the terminal,
1955
1956iprog,  the path name of a program to be run to initialize the ter‐
1957           minal,
1958
1959       •   and if, the name of a file containing long initialization strings.
1960
1961       These strings are expected to set the terminal  into  modes  consistent
1962       with  the  rest of the terminfo description.  They are normally sent to
1963       the terminal, by the init option of the tput  program,  each  time  the
1964       user logs in.  They will be printed in the following order:
1965
1966              run the program
1967                     iprog
1968
1969              output
1970                     is1 and
1971                     is2
1972
1973              set the margins using
1974                     mgc or
1975                     smglp and smgrp or
1976                     smgl and smgr
1977
1978              set tabs using
1979                     tbc and hts
1980
1981              print the file
1982                     if
1983
1984              and finally output
1985                     is3.
1986
1987       Most  initialization  is  done with is2.  Special terminal modes can be
1988       set up without duplicating strings by putting the common  sequences  in
1989       is2 and special cases in is1 and is3.
1990
1991       A  set  of  sequences  that  does a harder reset from a totally unknown
1992       state can be given as rs1, rs2, rf and rs3, analogous to is1 , is2 , if
1993       and  is3  respectively.   These  strings  are output by reset option of
1994       tput, or by the reset program (an alias of tset), which  is  used  when
1995       the terminal gets into a wedged state.  Commands are normally placed in
1996       rs1, rs2 rs3 and rf only if they produce annoying effects on the screen
1997       and are not necessary when logging in.  For example, the command to set
1998       the vt100 into 80-column mode would normally be part  of  is2,  but  it
1999       causes  an  annoying  glitch  of  the screen and is not normally needed
2000       since the terminal is usually already in 80-column mode.
2001
2002       The reset program writes strings including iprog, etc., in the same or‐
2003       der  as the init program, using rs1, etc., instead of is1, etc.  If any
2004       of rs1, rs2, rs3, or rf reset capability strings are missing, the reset
2005       program  falls  back  upon  the corresponding initialization capability
2006       string.
2007
2008       If there are commands to set and clear tab stops, they can be given  as
2009       tbc (clear all tab stops) and hts (set a tab stop in the current column
2010       of every row).  If a more complex sequence is needed to  set  the  tabs
2011       than can be described by this, the sequence can be placed in is2 or if.
2012
2013       The  tput  reset  command uses the same capability strings as the reset
2014       command, although the two programs (tput and reset)  provide  different
2015       command-line options.
2016
2017       In practice, these terminfo capabilities are not often used in initial‐
2018       ization of tabs (though they are required for the tabs program):
2019
2020       •   Almost all hardware terminals (at least those which supported tabs)
2021           initialized those to every eight columns:
2022
2023           The  only exception was the AT&T 2300 series, which set tabs to ev‐
2024           ery five columns.
2025
2026       •   In particular, developers of the hardware terminals which are  com‐
2027           monly  used  as models for modern terminal emulators provided docu‐
2028           mentation demonstrating that eight columns were the standard.
2029
2030       •   Because of this, the terminal initialization programs tput and tset
2031           use  the  tbc  (clear_all_tabs)  and hts (set_tab) capabilities di‐
2032           rectly only when the it (init_tabs) capability is set  to  a  value
2033           other than eight.
2034
2035   Delays and Padding
2036       Many  older  and slower terminals do not support either XON/XOFF or DTR
2037       handshaking, including hard copy terminals and some very  archaic  CRTs
2038       (including,  for example, DEC VT100s).  These may require padding char‐
2039       acters after certain cursor motions and screen changes.
2040
2041       If the terminal uses xon/xoff handshaking for flow control (that is, it
2042       automatically  emits  ^S  back  to  the host when its input buffers are
2043       close to full), set xon.  This capability suppresses  the  emission  of
2044       padding.   You can also set it for memory-mapped console devices effec‐
2045       tively that do not have a  speed  limit.   Padding  information  should
2046       still be included so that routines can make better decisions about rel‐
2047       ative costs, but actual pad characters will not be transmitted.
2048
2049       If pb (padding baud rate) is given, padding is suppressed at baud rates
2050       below  the  value  of  pb.  If the entry has no padding baud rate, then
2051       whether padding is emitted or not is completely controlled by xon.
2052
2053       If the terminal requires other than a null (zero) character as  a  pad,
2054       then  this  can  be  given as pad.  Only the first character of the pad
2055       string is used.
2056
2057   Status Lines
2058       Some terminals have an extra “status line” which is not  normally  used
2059       by software (and thus not counted in the terminal's lines capability).
2060
2061       The  simplest case is a status line which is cursor-addressable but not
2062       part of the main scrolling region on the screen; the Heathkit H19 has a
2063       status  line  of  this  kind,  as  would a 24-line VT100 with a 23-line
2064       scrolling region set up on initialization.  This situation is indicated
2065       by the hs capability.
2066
2067       Some  terminals  with status lines need special sequences to access the
2068       status line.  These may be expressed as a string with single  parameter
2069       tsl  which takes the cursor to a given zero-origin column on the status
2070       line.  The capability fsl must return to the main-screen  cursor  posi‐
2071       tions  before the last tsl.  You may need to embed the string values of
2072       sc (save cursor) and rc (restore cursor) in tsl and fsl  to  accomplish
2073       this.
2074
2075       The  status  line is normally assumed to be the same width as the width
2076       of the terminal.  If this is untrue, you can specify it  with  the  nu‐
2077       meric capability wsl.
2078
2079       A command to erase or blank the status line may be specified as dsl.
2080
2081       The  boolean  capability  eslok  specifies that escape sequences, tabs,
2082       etc., work ordinarily in the status line.
2083
2084       The ncurses implementation does not yet use any of these  capabilities.
2085       They are documented here in case they ever become important.
2086
2087   Line Graphics
2088       Many  terminals have alternate character sets useful for forms-drawing.
2089       Terminfo and curses have built-in support for most of the drawing char‐
2090       acters  supported  by  the  VT100,  with  some characters from the AT&T
2091       4410v1 added.  This alternate character set may  be  specified  by  the
2092       acsc capability.
2093
2094         Glyph                       ACS            Ascii     acsc     acsc
2095         Name                        Name           Default   Char     Value
2096         ────────────────────────────────────────────────────────────────────
2097         arrow pointing right        ACS_RARROW     >         +        0x2b
2098         arrow pointing left         ACS_LARROW     <         ,        0x2c
2099         arrow pointing up           ACS_UARROW     ^         -        0x2d
2100         arrow pointing down         ACS_DARROW     v         .        0x2e
2101         solid square block          ACS_BLOCK      #         0        0x30
2102         diamond                     ACS_DIAMOND    +         `        0x60
2103         checker board (stipple)     ACS_CKBOARD    :         a        0x61
2104         degree symbol               ACS_DEGREE     \         f        0x66
2105         plus/minus                  ACS_PLMINUS    #         g        0x67
2106         board of squares            ACS_BOARD      #         h        0x68
2107         lantern symbol              ACS_LANTERN    #         i        0x69
2108         lower right corner          ACS_LRCORNER   +         j        0x6a
2109         upper right corner          ACS_URCORNER   +         k        0x6b
2110         upper left corner           ACS_ULCORNER   +         l        0x6c
2111         lower left corner           ACS_LLCORNER   +         m        0x6d
2112         large plus or crossover     ACS_PLUS       +         n        0x6e
2113         scan line 1                 ACS_S1         ~         o        0x6f
2114         scan line 3                 ACS_S3         -         p        0x70
2115         horizontal line             ACS_HLINE      -         q        0x71
2116         scan line 7                 ACS_S7         -         r        0x72
2117         scan line 9                 ACS_S9         _         s        0x73
2118         tee pointing right          ACS_LTEE       +         t        0x74
2119         tee pointing left           ACS_RTEE       +         u        0x75
2120         tee pointing up             ACS_BTEE       +         v        0x76
2121         tee pointing down           ACS_TTEE       +         w        0x77
2122         vertical line               ACS_VLINE      |         x        0x78
2123         less-than-or-equal-to       ACS_LEQUAL     <         y        0x79
2124         greater-than-or-equal-to    ACS_GEQUAL     >         z        0x7a
2125         greek pi                    ACS_PI         *         {        0x7b
2126         not-equal                   ACS_NEQUAL     !         |        0x7c
2127         UK pound sign               ACS_STERLING   f         }        0x7d
2128         bullet                      ACS_BULLET     o         ~        0x7e
2129
2130       A few notes apply to the table itself:
2131
2132       •   X/Open  Curses  incorrectly  states that the mapping for lantern is
2133           uppercase “I” although Unix implementations use the  lowercase  “i”
2134           mapping.
2135
2136       •   The  DEC  VT100  implemented graphics using the alternate character
2137           set feature, temporarily switching modes and sending characters  in
2138           the range 0x60 (96) to 0x7e (126) (the acsc Value column in the ta‐
2139           ble).
2140
2141       •   The AT&T terminal added graphics characters outside that range.
2142
2143           Some of the characters within the range do  not  match  the  VT100;
2144           presumably  they  were  used in the AT&T terminal: board of squares
2145           replaces the VT100 newline symbol, while  lantern  symbol  replaces
2146           the VT100 vertical tab symbol.  The other VT100 symbols for control
2147           characters (horizontal tab, carriage return and line-feed) are  not
2148           (re)used in curses.
2149
2150       The  best  way to define a new device's graphics set is to add a column
2151       to a copy of this table for your terminal, giving the  character  which
2152       (when  emitted  between  smacs/rmacs  switches) will be rendered as the
2153       corresponding graphic.  Then read off the VT100/your terminal character
2154       pairs right to left in sequence; these become the ACSC string.
2155
2156   Color Handling
2157       The  curses  library  functions init_pair and init_color manipulate the
2158       color  pairs  and  color  values  discussed  in   this   section   (see
2159       curs_color(3X) for details on these and related functions).
2160
2161       Most color terminals are either “Tektronix-like” or “HP-like”:
2162
2163       •   Tektronix-like terminals have a predefined set of N colors (where N
2164           is usually 8), and can set character-cell foreground and background
2165           characters independently, mixing them into N * N color-pairs.
2166
2167       •   On  HP-like  terminals,  the user must set each color pair up sepa‐
2168           rately (foreground and background are not independently  settable).
2169           Up to M color-pairs may be set up from 2*M different colors.  ANSI-
2170           compatible terminals are Tektronix-like.
2171
2172       Some basic color capabilities are independent of the color method.  The
2173       numeric  capabilities  colors  and pairs specify the maximum numbers of
2174       colors and color-pairs that can be displayed  simultaneously.   The  op
2175       (original pair) string resets foreground and background colors to their
2176       default values for the terminal.  The oc string resets  all  colors  or
2177       color-pairs  to  their default values for the terminal.  Some terminals
2178       (including many PC terminal emulators) erase screen areas with the cur‐
2179       rent  background  color  rather  than  the power-up default background;
2180       these should have the boolean capability bce.
2181
2182       While the curses library works with color pairs (reflecting the inabil‐
2183       ity  of  some  devices to set foreground and background colors indepen‐
2184       dently), there are separate capabilities for setting these features:
2185
2186       •   To change the current foreground or  background  color  on  a  Tek‐
2187           tronix-type  terminal,  use  setaf  (set ANSI foreground) and setab
2188           (set ANSI background) or setf (set foreground) and setb (set  back‐
2189           ground).   These  take  one  parameter, the color number.  The SVr4
2190           documentation describes only setaf/setab; the XPG4 draft says  that
2191           "If  the  terminal supports ANSI escape sequences to set background
2192           and foreground, they should be coded as setaf  and  setab,  respec‐
2193           tively.
2194
2195       •   If  the  terminal supports other escape sequences to set background
2196           and foreground, they should be coded  as  setf  and  setb,  respec‐
2197           tively.   The  vidputs  and the refresh(3X) functions use the setaf
2198           and setab capabilities if they are defined.
2199
2200       The setaf/setab and setf/setb capabilities take a single numeric  argu‐
2201       ment  each.  Argument values 0-7 of setaf/setab are portably defined as
2202       follows (the middle column is the symbolic  #define  available  in  the
2203       header  for the curses or ncurses libraries).  The terminal hardware is
2204       free to map these as it likes, but the RGB values indicate normal loca‐
2205       tions in color space.
2206
2207                    Color       #define       Value       RGB
2208                    black     COLOR_BLACK       0     0, 0, 0
2209                    red       COLOR_RED         1     max,0,0
2210                    green     COLOR_GREEN       2     0,max,0
2211                    yellow    COLOR_YELLOW      3     max,max,0
2212                    blue      COLOR_BLUE        4     0,0,max
2213                    magenta   COLOR_MAGENTA     5     max,0,max
2214
2215                    cyan      COLOR_CYAN        6     0,max,max
2216                    white     COLOR_WHITE       7     max,max,max
2217
2218       The argument values of setf/setb historically correspond to a different
2219       mapping, i.e.,
2220
2221                    Color       #define       Value       RGB
2222                    black     COLOR_BLACK       0     0, 0, 0
2223                    blue      COLOR_BLUE        1     0,0,max
2224                    green     COLOR_GREEN       2     0,max,0
2225                    cyan      COLOR_CYAN        3     0,max,max
2226                    red       COLOR_RED         4     max,0,0
2227                    magenta   COLOR_MAGENTA     5     max,0,max
2228                    yellow    COLOR_YELLOW      6     max,max,0
2229                    white     COLOR_WHITE       7     max,max,max
2230
2231       It is important to not confuse the two sets of color capabilities; oth‐
2232       erwise red/blue will be interchanged on the display.
2233
2234       On  an  HP-like terminal, use scp with a color-pair number parameter to
2235       set which color pair is current.
2236
2237       Some terminals allow the color values to be modified:
2238
2239       •   On a Tektronix-like terminal, the capability ccc may be present  to
2240           indicate  that colors can be modified.  If so, the initc capability
2241           will take a color number (0 to colors - 1)and three more parameters
2242           which  describe the color.  These three parameters default to being
2243           interpreted as RGB (Red, Green, Blue) values.  If the boolean capa‐
2244           bility  hls  is  present,  they are instead as HLS (Hue, Lightness,
2245           Saturation) indices.  The ranges are terminal-dependent.
2246
2247       •   On an HP-like terminal, initp may give a capability for changing  a
2248           color-pair value.  It will take seven parameters; a color-pair num‐
2249           ber (0 to max_pairs - 1), and two triples  describing  first  back‐
2250           ground  and then foreground colors.  These parameters must be (Red,
2251           Green, Blue) or (Hue, Lightness, Saturation) depending on hls.
2252
2253       On some color terminals, colors collide with highlights.  You can  reg‐
2254       ister  these collisions with the ncv capability.  This is a bit-mask of
2255       attributes not to be used when colors are enabled.  The  correspondence
2256       with the attributes understood by curses is as follows:
2257
2258                  Attribute              Bit   Decimal      Set by
2259                  A_STANDOUT             0     1            sgr
2260                  A_UNDERLINE            1     2            sgr
2261                  A_REVERSE              2     4            sgr
2262                  A_BLINK                3     8            sgr
2263                  A_DIM                  4     16           sgr
2264                  A_BOLD                 5     32           sgr
2265                  A_INVIS                6     64           sgr
2266                  A_PROTECT              7     128          sgr
2267                  A_ALTCHARSET           8     256          sgr
2268                  A_HORIZONTAL           9     512          sgr1
2269                  A_LEFT                 10    1024         sgr1
2270                  A_LOW                  11    2048         sgr1
2271                  A_RIGHT                12    4096         sgr1
2272                  A_TOP                  13    8192         sgr1
2273                  A_VERTICAL             14    16384        sgr1
2274                  A_ITALIC               15    32768        sitm
2275
2276       For  example, on many IBM PC consoles, the underline attribute collides
2277       with the foreground color blue and is  not  available  in  color  mode.
2278       These should have an ncv capability of 2.
2279
2280       SVr4  curses does nothing with ncv, ncurses recognizes it and optimizes
2281       the output in favor of colors.
2282
2283   Miscellaneous
2284       If the terminal requires other than a null (zero) character as  a  pad,
2285       then  this  can  be  given as pad.  Only the first character of the pad
2286       string is used.  If the terminal does not have a pad character, specify
2287       npc.   Note that ncurses implements the termcap-compatible PC variable;
2288       though the application may set this value to  something  other  than  a
2289       null,  ncurses will test npc first and use napms if the terminal has no
2290       pad character.
2291
2292       If the terminal can move up or down half a line, this can be  indicated
2293       with hu (half-line up) and hd (half-line down).  This is primarily use‐
2294       ful for superscripts and subscripts on hard-copy terminals.  If a hard-
2295       copy  terminal  can eject to the next page (form feed), give this as ff
2296       (usually control/L).
2297
2298       If there is a command to repeat a given character  a  given  number  of
2299       times  (to  save  time transmitting a large number of identical charac‐
2300       ters) this can be indicated with the  parameterized  string  rep.   The
2301       first  parameter  is the character to be repeated and the second is the
2302       number of times to repeat it.  Thus, tparm(repeat_char, 'x', 10) is the
2303       same as “xxxxxxxxxx”.
2304
2305       If the terminal has a settable command character, such as the TEKTRONIX
2306       4025, this can be indicated with cmdch.  A prototype command  character
2307       is  chosen  which is used in all capabilities.  This character is given
2308       in the cmdch capability to identify it.  The  following  convention  is
2309       supported on some UNIX systems: The environment is to be searched for a
2310       CC variable, and if found, all occurrences of the  prototype  character
2311       are replaced with the character in the environment variable.
2312
2313       Terminal  descriptions  that  do not represent a specific kind of known
2314       terminal, such as switch, dialup, patch, and  network,  should  include
2315       the  gn (generic) capability so that programs can complain that they do
2316       not know how to talk to the terminal.  (This capability does not  apply
2317       to  virtual  terminal  descriptions  for which the escape sequences are
2318       known.)
2319
2320       If the terminal has a “meta key” which acts as a shift key, setting the
2321       8th  bit  of any character transmitted, this fact can be indicated with
2322       km.  Otherwise, software will assume that the 8th bit is parity and  it
2323       will  usually be cleared.  If strings exist to turn this “meta mode” on
2324       and off, they can be given as smm and rmm.
2325
2326       If the terminal has more lines of memory than will fit on the screen at
2327       once,  the number of lines of memory can be indicated with lm.  A value
2328       of lm#0 indicates that the number of lines is not fixed, but that there
2329       is still more memory than fits on the screen.
2330
2331       If  the terminal is one of those supported by the UNIX virtual terminal
2332       protocol, the terminal number can be given as vt.
2333
2334       Media copy strings which control an auxiliary printer connected to  the
2335       terminal  can  be  given as mc0: print the contents of the screen, mc4:
2336       turn off the printer, and mc5: turn on the printer.  When  the  printer
2337       is  on,  all text sent to the terminal will be sent to the printer.  It
2338       is undefined whether the text is also displayed on the terminal  screen
2339       when  the  printer  is  on.   A variation mc5p takes one parameter, and
2340       leaves the printer on for as many characters as the value of the param‐
2341       eter, then turns the printer off.  The parameter should not exceed 255.
2342       All text, including mc4, is transparently passed to the  printer  while
2343       an mc5p is in effect.
2344
2345   Glitches and Braindamage
2346       Hazeltine  terminals, which do not allow “~” characters to be displayed
2347       should indicate hz.
2348
2349       Terminals which ignore a line-feed immediately after an am  wrap,  such
2350       as the Concept and vt100, should indicate xenl.
2351
2352       If  el  is  required  to get rid of standout (instead of merely writing
2353       normal text on top of it), xhp should be given.
2354
2355       Teleray terminals, where tabs turn all characters moved over to blanks,
2356       should  indicate  xt (destructive tabs).  Note: the variable indicating
2357       this is now “dest_tabs_magic_smso”; in  older  versions,  it  was  tel‐
2358       eray_glitch.  This glitch is also taken to mean that it is not possible
2359       to position the cursor on top of a “magic cookie”, that to erase stand‐
2360       out  mode  it  is instead necessary to use delete and insert line.  The
2361       ncurses implementation ignores this glitch.
2362
2363       The Beehive Superbee, which is unable to correctly transmit the  escape
2364       or  control/C  characters,  has xsb, indicating that the f1 key is used
2365       for escape and f2 for control/C.  (Only  certain  Superbees  have  this
2366       problem,  depending on the ROM.)  Note that in older terminfo versions,
2367       this capability was called “beehive_glitch”; it is now “no_esc_ctl_c”.
2368
2369       Other specific terminal problems may be corrected by adding more  capa‐
2370       bilities of the form xx.
2371
2372   Pitfalls of Long Entries
2373       Long  terminfo  entries are unlikely to be a problem; to date, no entry
2374       has even approached terminfo's 4096-byte string-table maximum.   Unfor‐
2375       tunately,  the  termcap translations are much more strictly limited (to
2376       1023 bytes), thus termcap translations of  long  terminfo  entries  can
2377       cause problems.
2378
2379       The  man  pages  for  4.3BSD and older versions of tgetent instruct the
2380       user to allocate a 1024-byte buffer for the termcap entry.   The  entry
2381       gets  null-terminated by the termcap library, so that makes the maximum
2382       safe length for a termcap entry 1k-1 (1023) bytes.  Depending  on  what
2383       the  application  and the termcap library being used does, and where in
2384       the termcap file the terminal type that tgetent is  searching  for  is,
2385       several bad things can happen.
2386
2387       Some  termcap libraries print a warning message or exit if they find an
2388       entry that's longer than 1023 bytes; others do not; others truncate the
2389       entries  to  1023  bytes.  Some application programs allocate more than
2390       the recommended 1K for the termcap entry; others do not.
2391
2392       Each termcap entry has two important sizes associated with  it:  before
2393       “tc”  expansion, and after “tc” expansion.  “tc” is the capability that
2394       tacks on another termcap entry to the end of the current one, to add on
2395       its capabilities.  If a termcap entry does not use the “tc” capability,
2396       then of course the two lengths are the same.
2397
2398       The “before tc expansion” length is the most important one, because  it
2399       affects  more than just users of that particular terminal.  This is the
2400       length of the entry as it exists in /etc/termcap, minus the  backslash-
2401       newline pairs, which tgetent strips out while reading it.  Some termcap
2402       libraries strip off the final newline, too (GNU termcap does not).  Now
2403       suppose:
2404
2405       •   a termcap entry before expansion is more than 1023 bytes long,
2406
2407       •   and the application has only allocated a 1k buffer,
2408
2409       •   and  the termcap library (like the one in BSD/OS 1.1 and GNU) reads
2410           the whole entry into the buffer, no matter what its length, to  see
2411           if it is the entry it wants,
2412
2413       •   and  tgetent  is  searching  for a terminal type that either is the
2414           long entry, appears in the termcap file after the  long  entry,  or
2415           does  not  appear in the file at all (so that tgetent has to search
2416           the whole termcap file).
2417
2418       Then tgetent will overwrite memory, perhaps  its  stack,  and  probably
2419       core  dump the program.  Programs like telnet are particularly vulnera‐
2420       ble; modern telnets pass along values like the terminal type  automati‐
2421       cally.   The  results are almost as undesirable with a termcap library,
2422       like SunOS 4.1.3 and Ultrix 4.4, that prints warning messages  when  it
2423       reads  an  overly  long  termcap entry.  If a termcap library truncates
2424       long entries, like OSF/1 3.0, it is immune to dying here but  will  re‐
2425       turn incorrect data for the terminal.
2426
2427       The  “after  tc  expansion”  length  will  have a similar effect to the
2428       above, but only for people who actually set TERM to that terminal type,
2429       since  tgetent  only  does “tc” expansion once it is found the terminal
2430       type it was looking for, not while searching.
2431
2432       In summary, a termcap entry that is longer than 1023 bytes  can  cause,
2433       on  various  combinations of termcap libraries and applications, a core
2434       dump, warnings, or incorrect operation.  If it is too long even  before
2435       “tc”  expansion,  it will have this effect even for users of some other
2436       terminal types and users whose TERM variable does not  have  a  termcap
2437       entry.
2438
2439       When  in  -C (translate to termcap) mode, the ncurses implementation of
2440       tic(1M) issues warning messages when the pre-tc  length  of  a  termcap
2441       translation  is  too  long.  The -c (check) option also checks resolved
2442       (after tc expansion) lengths.
2443
2444   Binary Compatibility
2445       It is not wise to count on portability of binary terminfo  entries  be‐
2446       tween commercial UNIX versions.  The problem is that there are at least
2447       two versions of terminfo (under HP-UX and AIX) which diverged from Sys‐
2448       tem V terminfo after SVr1, and have added extension capabilities to the
2449       string table that (in the binary format) collide with System V and  XSI
2450       Curses extensions.
2451

EXTENSIONS

2453       Searching   for  terminal  descriptions  in  $HOME/.terminfo  and  TER‐
2454       MINFO_DIRS is not supported by older implementations.
2455
2456       Some SVr4 curses implementations, and all previous to SVr4, do not  in‐
2457       terpret the %A and %O operators in parameter strings.
2458
2459       SVr4/XPG4 do not specify whether msgr licenses movement while in an al‐
2460       ternate-character-set mode (such modes may, among other things, map  CR
2461       and  NL  to characters that do not trigger local motions).  The ncurses
2462       implementation ignores msgr in ALTCHARSET mode.  This raises the possi‐
2463       bility  that  an XPG4 implementation making the opposite interpretation
2464       may need terminfo entries made for ncurses to have msgr turned off.
2465
2466       The ncurses library handles insert-character and insert-character modes
2467       in  a  slightly  non-standard way to get better update efficiency.  See
2468       the Insert/Delete Character subsection above.
2469
2470       The parameter substitutions for set_clock  and  display_clock  are  not
2471       documented  in  SVr4 or the XSI Curses standard.  They are deduced from
2472       the documentation for the AT&T 505 terminal.
2473
2474       Be careful assigning the kmous capability.  The ncurses  library  wants
2475       to  interpret  it as KEY_MOUSE, for use by terminals and emulators like
2476       xterm that can return mouse-tracking information in the  keyboard-input
2477       stream.
2478
2479       X/Open Curses does not mention italics.  Portable applications must as‐
2480       sume that numeric capabilities are signed 16-bit values.  This includes
2481       the  no_color_video  (ncv)  capability.   The 32768 mask value used for
2482       italics with ncv can be confused with an absent or cancelled  ncv.   If
2483       italics  should work with colors, then the ncv value must be specified,
2484       even if it is zero.
2485
2486       Different commercial ports of terminfo  and  curses  support  different
2487       subsets of the XSI Curses standard and (in some cases) different exten‐
2488       sion sets.  Here is a summary, accurate as of October 1995:
2489
2490SVR4, Solaris, ncurses -- These support all SVr4 capabilities.
2491
2492SGI -- Supports the SVr4 set, adds one undocumented extended string
2493           capability (set_pglen).
2494
2495SVr1, Ultrix -- These support a restricted subset of terminfo capa‐
2496           bilities.  The  booleans  end  with  xon_xoff;  the  numerics  with
2497           width_status_line; and the strings with prtr_non.
2498
2499HP/UX  --  Supports  the  SVr1  subset,  plus the SVr[234] numerics
2500           num_labels,  label_height,  label_width,  plus  function  keys   11
2501           through  63, plus plab_norm, label_on, and label_off, plus some in‐
2502           compatible extensions in the string table.
2503
2504AIX -- Supports the SVr1 subset, plus function keys 11 through  63,
2505           plus a number of incompatible string table extensions.
2506
2507OSF -- Supports both the SVr4 set and the AIX extensions.
2508

FILES

2510       /usr/share/terminfo/?/*  files containing terminal descriptions
2511

SEE ALSO

2513       infocmp(1M),  tabs(1),  tic(1M), curses(3X), curs_color(3X), curs_vari‐
2514       ables(3X), printf(3), term_variables(3X).  term(5).  user_caps(5).
2515

AUTHORS

2517       Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.  Based on pcurses
2518       by Pavel Curtis.
2519
2520
2521
2522                                                                   terminfo(5)
Impressum