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