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