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