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