1user_caps(5)                  File Formats Manual                 user_caps(5)
2
3
4

NAME

6       user_caps - user-defined terminfo capabilities
7

SYNOPSIS

9       tic -x, infocmp -x
10

DESCRIPTION

12   Background
13       Before  ncurses 5.0, terminfo databases used a fixed repertoire of ter‐
14       minal capabilities designed for the SVr2 terminal database in 1984, and
15       extended  in stages through SVr4 (1989), and standardized in the Single
16       Unix Specification beginning in 1995.
17
18       Most of the extensions in this fixed repertoire were additions  to  the
19       tables of boolean, numeric and string capabilities.  Rather than change
20       the meaning of an existing capability, a new name was added.  The  ter‐
21       minfo  database  uses a binary format; binary compatibility was ensured
22       by using a header which gave the number of items in the tables for each
23       type of capability.  The standardization was incomplete:
24
25       ·   The binary format itself is not described in the X/Open Curses doc‐
26           umentation.  Only the source format is described.
27
28           Library developers rely upon the SVr4 documentation,  and  reverse-
29           engineering the compiled terminfo files to match the binary format.
30
31       ·   Lacking a standard for the binary format, most implementations copy
32           the SVr2 binary format, which uses 16-bit signed integers,  and  is
33           limited to 4096-byte entries.
34
35           The  format  cannot  represent very large numeric capabilities, nor
36           can it represent large numbers of special keyboard definitions.
37
38       ·   The tables of capability names differ between implementations.
39
40           Although they may provide all of the standard capability names, the
41           position  in the tables differs because some features were added as
42           needed, while others were added  (out  of  order)  to  comply  with
43           X/Open Curses.
44
45           While  ncurses' repertoire of predefined capabilities is closest to
46           Solaris, Solaris's terminfo database has a few differences from the
47           list published by X/Open Curses.
48
49       During the 1990s, some users were reluctant to use terminfo in spite of
50       its performance advantages over termcap:
51
52       ·   The fixed repertoire prevented users from adding features for unan‐
53           ticipated terminal improvements (or required them to reuse existing
54           capabilities as a workaround).
55
56       ·   The limitation  to  16-bit  signed  integers  was  also  mentioned.
57           Because  termcap  stores everything as a string, it could represent
58           larger numbers.
59
60       Although termcap's extensibility was rarely  used  (it  was  never  the
61       speaker  who had actually used the feature), the criticism had a point.
62       ncurses 5.0 provided a way to detect nonstandard  capabilities,  deter‐
63       mine  their  type and optionally store and retrieve them in a way which
64       did not interfere with other applications.  These are  referred  to  as
65       user-defined  capabilities  because  no  modifications to the toolset's
66       predefined capability names are needed.
67
68       The ncurses utilities tic and infocmp have a command-line  option  “-x”
69       to   control   whether  the  nonstandard  capabilities  are  stored  or
70       retrieved.  A library function use_extended_names is provided  for  the
71       same purpose.
72
73       When  compiling  a  terminal database, if “-x” is set, tic will store a
74       user-defined capability if the capability name is not one of the prede‐
75       fined names.
76
77       Because  ncurses  provides  a  termcap  library  interface, these user-
78       defined capabilities may be visible to termcap applications:
79
80       ·   The  termcap  interface  (like  all  implementations  of   termcap)
81           requires that the capability names are 2-characters.
82
83           When  the capability is simple enough for use in a termcap applica‐
84           tion, it is provided as a 2-character name.
85
86       ·   There are other user-defined capabilities which refer  to  features
87           not  usable  in  termcap, e.g., parameterized strings that use more
88           than two parameters or use more than the trivial expression support
89           provided  by termcap.  For these, the terminfo database should have
90           only capability names with 3 or more characters.
91
92       ·   Some terminals can send distinct strings for special keys (cursor-,
93           keypad-  or  function-keys) depending on modifier keys (shift, con‐
94           trol, etc.).  While terminfo and termcap have a set  of  60  prede‐
95           fined  function-key  names,  to  which  a  series  of  keys  can be
96           assigned, that is insufficient for more than a  dozen  keys  multi‐
97           plied  by more than a couple of modifier combinations.  The ncurses
98           database uses a convention based on xterm to provide extended  spe‐
99           cial-key names.
100
101           Fitting  that  into termcap's limitation of 2-character names would
102           be pointless.  These extended keys are  available  only  with  ter‐
103           minfo.
104
105   Recognized capabilities
106       The  ncurses  library  uses the user-definable capabilities.  While the
107       terminfo database may have other  extensions,  ncurses  makes  explicit
108       checks for these:
109
110          AX boolean,  asserts  that the terminal interprets SGR 39 and SGR 49
111             by resetting the foreground and background  color,  respectively,
112             to the default.
113
114             This is a feature recognized by the screen program as well.
115
116          E3 string,  tells  how  to  clear  the terminal's scrollback buffer.
117             When present, the clear(1) program sends this before clearing the
118             terminal.
119
120             The command “tput clear” does the same thing.
121
122          RGB
123             boolean,  number  or  string, to assert that the set_a_foreground
124             and set_a_background capabilities correspond  to  direct  colors,
125             using an RGB (red/green/blue) convention.  This capability allows
126             the color_content function to return appropriate  values  without
127             requiring the application to initialize colors using init_color.
128
129             The capability type determines the values which ncurses sees:
130
131             boolean
132                implies  that  the  number of bits for red, green and blue are
133                the same.  Using the maximum number of  colors,  ncurses  adds
134                two, divides that sum by three, and assigns the result to red,
135                green and blue in that order.
136
137                If the number of bits needed for the number of colors is not a
138                multiple  of  three,  the  blue (and green) components lose in
139                comparison to red.
140
141             number
142                tells ncurses what result to add to red, green and  blue.   If
143                ncurses runs out of bits, blue (and green) lose just as in the
144                boolean case.
145
146             string
147                explicitly list the number of bits used  for  red,  green  and
148                blue components as a slash-separated list of decimal integers.
149
150             Because  there  are  several  RGB  encodings in use, applications
151             which make assumptions about the number of  bits  per  color  are
152             unlikely  to  work reliably.  As a trivial case, for example, one
153             could define RGB#1 to represent the standard eight  ANSI  colors,
154             i.e., one bit per color.
155
156          U8 number,  asserts  that  ncurses must use Unicode values for line-
157             drawing characters, and that it should ignore the alternate char‐
158             acter  set capabilities when the locale uses UTF-8 encoding.  For
159             more information, see the discussion  of  NCURSES_NO_UTF8_ACS  in
160             ncurses(3X).
161
162             Set this capability to a nonzero value to enable it.
163
164          XM string, override ncurses's built-in string which enables/disables
165             xterm mouse mode.
166
167   Extended key-definitions
168       Several terminals provide the ability to send distinct strings for com‐
169       binations  of  modified  special  keys.   There is no standard for what
170       those keys can send.
171
172       Since 1999, xterm has supported shift, control, alt, and meta modifiers
173       which produce distinct special-key strings.  In a terminal description,
174       ncurses has no special knowledge of the modifiers  used.   Applications
175       can  use the naming convention established for xterm to find these spe‐
176       cial keys in the terminal description.
177
178       Starting with the curses convention that key names begin with  “k”  and
179       that  shifted  special  keys  are  an uppercase name, ncurses' terminal
180       database defines these names to which a suffix is added:
181
182            Name   Description
183            ───────────────────────────────────────────────────────────────
184            kDC    special form of kdch1 (delete character)
185            kDN    special form of kcud1 (cursor down)
186            kEND   special form of kend (End)
187            kHOM   special form of khome (Home)
188            kLFT   special form of kcub1 (cursor-left or cursor-back)
189            kNXT   special form of knext (Next, or Page-Down)
190            kPRV   special form of kprev (Prev, or Page-Up)
191            kRIT   special form of kcuf1 (cursor-right, or cursor-forward)
192            kUP    special form of kcuu1 (cursor-up)
193
194       These are the suffixes used to denote the modifiers:
195
196            Value   Description
197            ──────────────────────────────────
198            2       Shift
199            3       Alt
200
201            4       Shift + Alt
202            5       Control
203            6       Shift + Control
204            7       Alt + Control
205            8       Shift + Alt + Control
206            9       Meta
207            10      Meta + Shift
208            11      Meta + Alt
209            12      Meta + Alt + Shift
210            13      Meta + Ctrl
211            14      Meta + Ctrl + Shift
212            15      Meta + Ctrl + Alt
213            16      Meta + Ctrl + Alt + Shift
214
215       None of these are predefined; terminal descriptions can refer to  names
216       which ncurses will allocate at runtime to key-codes.  To use these keys
217       in an ncurses program, an application could do this:
218
219       ·   using a list of extended key names, ask tigetstr(3X) for their val‐
220           ues, and
221
222       ·   given  the  list  of  values,  ask key_defined(3X) for the key-code
223           which would be returned for those keys by wgetch(3X).
224

PORTABILITY

226       The “-x” extension feature of tic and infocmp has been adopted in  Net‐
227       BSD  curses.  That implementation stores user-defined capabilities, but
228       makes no use of these capabilities itself.
229

SEE ALSO

231       tic(1), infocmp(1).
232

AUTHORS

234       Thomas E. Dickey
235       beginning with ncurses 5.0 (1999)
236
237
238
239                                                                  user_caps(5)
Impressum