]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/tic.1m
ncurses 6.4 - patch 20230701
[ncurses.git] / man / tic.1m
1 .\"***************************************************************************
2 .\" Copyright 2018-2022,2023 Thomas E. Dickey                                *
3 .\" Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: tic.1m,v 1.87 2023/07/01 15:46:10 tom Exp $
31 .TH @TIC@ 1M 2023-07-01 "ncurses 6.4" "User commands"
32 .ie \n(.g .ds `` \(lq
33 .el       .ds `` ``
34 .ie \n(.g .ds '' \(rq
35 .el       .ds '' ''
36 .ds n 5
37 .ds d @TERMINFO@
38 .de bP
39 .ie n  .IP \(bu 4
40 .el    .IP \(bu 2
41 ..
42 .SH NAME
43 \fB@TIC@\fP \- the \fIterminfo\fP entry-description compiler
44 .SH SYNOPSIS
45 \fB@TIC@\fP
46 [\fB\-\
47 0\
48 1\
49 C\
50 D\
51 G\
52 I\
53 K\
54 L\
55 N\
56 T\
57 U\
58 V\
59 W\
60 a\
61 c\
62 f\
63 g\
64 q\
65 r\
66 s\
67 t\
68 x\
69 \fP]
70 [\fB\-e\fP \fInames\fP]
71 [\fB\-o\fP \fIdir\fP]
72 [\fB\-Q\fP[\fIn\fP]]
73 [\fB\-R\fP \fIsubset\fP]
74 [\fB\-v\fP[\fIn\fP]]
75 [\fB\-w\fP[\fIn\fP]]
76 \fIfile\fP
77 .SH DESCRIPTION
78 The \fB@TIC@\fP command translates a \fBterminfo\fP file from source
79 format into compiled format.
80 The compiled format is necessary for use with
81 the library routines in \fBncurses\fP(3X).
82 .PP
83 As described in \fBterm\fP(\*n), the database may be either a directory
84 tree (one file per terminal entry) or a hashed database (one record per entry).
85 The \fB@TIC@\fP command writes only one type of entry,
86 depending on how it was built:
87 .bP
88 For directory trees, the top-level directory, e.g., /usr/share/terminfo,
89 specifies the location of the database.
90 .bP
91 For hashed databases, a filename is needed.
92 If the given file is not found by that name,
93 but can be found by adding the suffix ".db",
94 then that is used.
95 .IP
96 The default name for the hashed database is the same as the
97 default directory name (only adding a ".db" suffix).
98 .PP
99 In either case (directory or hashed database),
100 \fB@TIC@\fP will create the container if it does not exist.
101 For a directory, this would be the \*(``terminfo\*('' leaf,
102 versus a "terminfo.db" file.
103 .PP
104 The results are normally placed in the system terminfo database \fB\*d\fP.
105 The compiled terminal description can be placed
106 in a different terminfo database.
107 There are two ways to achieve this:
108 .bP
109 First, you may override the system default either by
110 using the \fB\-o\fP option,
111 or by setting the variable \fBTERMINFO\fP
112 in your shell environment to a valid database location.
113 .bP
114 Secondly, if \fB@TIC@\fP cannot write in \fI\*d\fP
115 or the location specified using your TERMINFO variable,
116 it looks for the directory \fI$HOME/.terminfo\fP
117 (or hashed database \fI$HOME/.terminfo.db)\fP;
118 if that location exists, the entry is placed there.
119 .PP
120 Libraries that read terminfo entries are expected to check in succession
121 .bP
122 a location specified with the TERMINFO environment variable,
123 .bP
124 \fI$HOME/.terminfo\fP,
125 .bP
126 directories listed in the TERMINFO_DIRS environment variable,
127 .bP
128 a compiled-in list of directories (@TERMINFO_DIRS@), and
129 .bP
130 the system terminfo database (\fI\*d\fP).
131 .SS ALIASES
132 This is the same program as @INFOTOCAP@ and @CAPTOINFO@;
133 usually those are linked to, or copied from this program:
134 .bP
135 When invoked as @INFOTOCAP@, @TIC@ sets the \fB\-I\fP option.
136 .bP
137 When invoked as @CAPTOINFO@, @TIC@ sets the \fB\-C\fP option.
138 .SS OPTIONS
139 .TP
140 \fB\-0\fP
141 restricts the output to a single line
142 .TP
143 \fB\-1\fP
144 restricts the output to a single column
145 .TP
146 \fB\-a\fP
147 tells \fB@TIC@\fP to retain commented-out capabilities rather than discarding
148 them.
149 Capabilities are commented by prefixing them with a period.
150 This sets the \fB\-x\fP option, because it treats the commented-out
151 entries as user-defined names.
152 If the source is termcap, accept the 2-character names required by version 6.
153 Otherwise these are ignored.
154 .TP
155 \fB\-C\fP
156 Force source translation to termcap format.
157 Note: this differs from the \fB\-C\fP
158 option of \fB@INFOCMP@\fP(1M) in that it does not merely translate capability
159 names, but also translates terminfo strings to termcap format.
160 Capabilities
161 that are not translatable are left in the entry under their terminfo names
162 but commented out with two preceding dots.
163 The actual format used incorporates some improvements for escaped characters
164 from terminfo format.
165 For a stricter BSD-compatible translation, add the \fB\-K\fP option.
166 .IP
167 If this is combined with \fB\-c\fP, \fB@TIC@\fP makes additional checks
168 to report cases where the terminfo values do not have an exact equivalent
169 in termcap form.
170 For example:
171 .RS
172 .bP
173 \fBsgr\fP usually will not convert, because termcap lacks the ability to
174 work with more than two parameters, and because termcap lacks many of
175 the arithmetic/logical operators used in terminfo.
176 .bP
177 capabilities with more than one delay or with delays before the end of
178 the string will not convert completely.
179 .RE
180 .TP
181 \fB\-c\fP
182 tells \fB@TIC@\fP to only check \fIfile\fP for errors,
183 including syntax problems and bad use-links.
184 If you specify \fB\-C\fP (\fB\-I\fP) with this option, the code
185 will print warnings about entries which, after use resolution, are more than
186 1023 (4096) bytes long.
187 Due to a fixed buffer length in older termcap libraries,
188 as well as buggy checking for the buffer length
189 (and a documented limit in terminfo),
190 these entries may cause core
191 dumps with other implementations.
192 .IP
193 \fB@TIC@\fP checks string capabilities to ensure that those with parameters
194 will be valid expressions.
195 It does this check only for the predefined string capabilities;
196 those which are defined with the \fB\-x\fP option are ignored.
197 .TP
198 \fB\-D\fP
199 tells \fB@TIC@\fP to print the database locations that it knows about, and exit.
200 The first location shown is the one to which it would write compiled
201 terminal descriptions.
202 If \fB@TIC@\fP is not able to find a writable database location
203 according to the rules summarized above,
204 it will print a diagnostic and exit with an error rather than
205 printing a list of database locations.
206 .TP
207 \fB\-e \fInames\fR
208 Limit writes and translations to the following comma-separated list of
209 terminals.
210 If any name or alias of a terminal matches one of the names in
211 the list, the entry will be written or translated as normal.
212 Otherwise no output will be generated for it.
213 The option value is interpreted as a file containing the list if it
214 contains a '/'.
215 (Note: depending on how @TIC@ was compiled,
216 this option may require \fB\-I\fP or \fB\-C\fP.)
217 .TP
218 \fB\-f\fP
219 Display complex terminfo strings which contain if/then/else/endif expressions
220 indented for readability.
221 .TP
222 \fB\-G\fP
223 Display constant literals in decimal form
224 rather than their character equivalents.
225 .TP
226 \fB\-g\fP
227 Display constant character literals in quoted form
228 rather than their decimal equivalents.
229 .TP
230 \fB\-I\fP
231 Force source translation to terminfo format.
232 .TP
233 \fB\-K\fP
234 Suppress some longstanding ncurses extensions to termcap format,
235 e.g., "\\s" for space.
236 .TP
237 \fB\-L\fP
238 Force source translation to terminfo format
239 using the long C variable names listed in <\fBterm.h\fP>
240 .TP
241 \fB\-N\fP
242 Disable smart defaults.
243 Normally, when translating from termcap to terminfo, the compiler makes
244 a number of assumptions about the defaults of string capabilities
245 \fBreset1_string\fP, \fBcarriage_return\fP, \fBcursor_left\fP,
246 \fBcursor_down\fP, \fBscroll_forward\fP, \fBtab\fP, \fBnewline\fP,
247 \fBkey_backspace\fP, \fBkey_left\fP, and \fBkey_down\fP, then attempts
248 to use obsolete termcap capabilities to deduce correct values.
249 It also
250 normally suppresses output of obsolete termcap capabilities such as \fBbs\fP.
251 This option forces a more literal translation that also preserves the
252 obsolete capabilities.
253 .TP
254 \fB\-o\fIdir\fR
255 Write compiled entries to given database location.
256 Overrides the TERMINFO environment variable.
257 .TP
258 \fB\-Q\fIn\fR
259 Rather than show source in terminfo (text) format,
260 print the compiled (binary) format in hexadecimal or base64 form,
261 depending on the option's value:
262 .RS 8
263 .TP 3
264 1
265 hexadecimal
266 .TP 3
267 2
268 base64
269 .TP 3
270 3
271 hexadecimal and base64
272 .RE
273 .TP
274 \fB\-q\fP
275 Suppress comments and blank lines when showing translated source.
276 .TP
277 \fB\-R\fIsubset\fR
278 Restrict output to a given subset.
279 This option is for use with archaic
280 versions of terminfo like those on SVr1, Ultrix, or HP-UX that do not support
281 the full set of SVR4/XSI Curses terminfo; and outright broken ports like AIX 3.x
282 that have their own extensions incompatible with SVr4/XSI.
283 Available subsets
284 are \*(``SVr1\*('', \*(``Ultrix\*('', \*(``HP\*('', \*(``BSD\*('' and \*(``AIX\*('';
285 see \fBterminfo\fP(\*n) for details.
286 .TP
287 \fB\-r\fP
288 Force entry resolution (so there are no remaining tc capabilities) even
289 when doing translation to termcap format.
290 This may be needed if you are
291 preparing a termcap file for a termcap library (such as GNU termcap through
292 version 1.3 or BSD termcap through 4.3BSD) that does not handle multiple
293 tc capabilities per entry.
294 .TP
295 \fB\-s\fP
296 Summarize the compile by showing the database location into which entries
297 are written, and the number of entries which are compiled.
298 .TP
299 \fB\-T\fP
300 eliminates size-restrictions on the generated text.
301 This is mainly useful for testing and analysis, since the compiled
302 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
303 .TP
304 \fB\-t\fP
305 tells \fB@TIC@\fP to discard commented-out capabilities.
306 Normally when translating from terminfo to termcap,
307 untranslatable capabilities are commented-out.
308 .TP 5
309 \fB\-U\fP
310 tells \fB@TIC@\fP to not post-process the data after parsing the source file.
311 Normally, it infers data which is commonly missing in older terminfo data,
312 or in termcaps.
313 .TP
314 \fB\-V\fP
315 reports the version of ncurses which was used in this program, and exits.
316 .TP
317 \fB\-v\fIn\fR
318 specifies that (verbose) output be written to standard error trace
319 information showing \fB@TIC@\fP's progress.
320 .IP
321 The optional parameter \fIn\fP is a number from 1 to 9, inclusive,
322 indicating the desired level of detail of information.
323 .RS
324 .bP
325 If ncurses is built without tracing support, the optional parameter is ignored.
326 .bP
327 If \fIn\fP is omitted, the default level is 1.
328 .bP
329 If \fIn\fP is specified and greater than 1, the level of
330 detail is increased, and the output is written (with tracing information)
331 to the \*(``trace\*('' file.
332 .RE
333 .RS
334 .PP
335 The debug flag levels are as follows:
336 .TP 4
337 1
338 Names of files created and linked
339 .TP
340 2
341 Information related to the \*(``use\*('' facility
342 .TP
343 3
344 Statistics from the hashing algorithm
345 .TP
346 4
347 Details of extended capabilities
348 .TP
349 5
350 (unused)
351 .TP
352 6
353 (unused)
354 .TP
355 7
356 Entries into the string-table
357 .TP
358 8
359 List of tokens encountered by scanner
360 .TP
361 9
362 All values computed in construction of the hash table
363 .RE
364 .TP
365 \fB\-W\fP
366 By itself, the \fB\-w\fP option will not force long strings to be wrapped.
367 Use the \fB\-W\fP option to do this.
368 .IP
369 If you specify both \fB\-f\fP and \fB\-W\fP options,
370 the latter is ignored when \fB\-f\fP has already split the line.
371 .TP
372 \fB\-w\fIn\fR
373 specifies the width of the output.
374 The parameter is optional.
375 If it is omitted, it defaults to 60.
376 .TP
377 \fB\-x\fP
378 Treat unknown capabilities as user-defined (see \fBuser_caps(\*n)\fP).
379 That is, if you supply a capability name which \fB@TIC@\fP does not recognize,
380 it will infer its type (boolean, number or string) from the syntax and
381 make an extended table entry for that.
382 User-defined capability strings
383 whose name begins with \*(``k\*('' are treated as function keys.
384 .SS PARAMETERS
385 .TP
386 \fIfile\fP
387 contains one or more \fBterminfo\fP terminal descriptions in source
388 format [see \fBterminfo\fP(\*n)].
389 Each description in the file
390 describes the capabilities of a particular terminal.
391 .IP
392 If \fIfile\fP is \*(``-\*('', then the data is read from the standard input.
393 The \fIfile\fP parameter may also be the path of a character-device.
394 .SS PROCESSING
395 All but one of the capabilities recognized by \fB@TIC@\fP are documented
396 in \fBterminfo\fP(\*n).
397 The exception is the \fBuse\fP capability.
398 .PP
399 When a \fBuse\fP=\fIentry\fP\-\fIname\fP field is discovered in a
400 terminal entry currently being compiled, \fB@TIC@\fP reads in the binary
401 from \fB\*d\fP to complete the entry.
402 (Entries created from
403 \fIfile\fP will be used first.
404 \fB@TIC@\fP duplicates the capabilities in
405 \fIentry\fP\-\fIname\fP for the current entry, with the exception of
406 those capabilities that explicitly are defined in the current entry.
407 .PP
408 When an entry, e.g., \fBentry_name_1\fP, contains a
409 \fBuse=\fIentry\fR_\fIname\fR_\fI2\fR field, any canceled
410 capabilities in \fIentry\fR_\fIname\fR_\fI2\fP must also appear in
411 \fBentry_name_1\fP before \fBuse=\fP for these capabilities to be
412 canceled in \fBentry_name_1\fP.
413 .PP
414 Total compiled entries cannot exceed 4096 bytes.
415 The name field cannot
416 exceed 512 bytes.
417 Terminal names exceeding the maximum alias length
418 (32 characters on systems with long filenames, 14 characters otherwise)
419 will be truncated to the maximum alias length
420 and a warning message will be printed.
421 .SH HISTORY
422 System V Release 2 provided a \fBtic\fP utility.
423 It accepted a single option: \fB\-v\fP (optionally followed by a number).
424 According to Ross Ridge's comment in \fImytinfo\fP,
425 this version of \fBtic\fP was
426 unable to represent cancelled capabilities.
427 .PP
428 System V Release 3 provided a different \fBtic\fP utility,
429 written by Pavel Curtis,
430 (originally named \*(``compile\*('' in \fIpcurses\fP).
431 This added an option \fB\-c\fP to check the file for
432 errors, with the caveat that errors in \*(``use=\*('' links
433 would not be reported.
434 System V Release 3 documented a few warning messages which
435 did not appear in \fIpcurses\fP.
436 While the program itself was changed little as development
437 continued with System V Release 4,
438 the table of capabilities grew from 180 (\fIpcurses\fP) to 464 (Solaris).
439 .PP
440 In early development of ncurses (1993),
441 Zeyd Ben-Halim used the table from \fImytinfo\fP to
442 extend the \fIpcurses\fP table to 469 capabilities
443 (456 matched SVr4, 8 were only in SVr4, 13 were not in SVr4).
444 Of those 13, 11 were ultimately discarded
445 (perhaps to match the draft of X/Open Curses).
446 The exceptions were
447 \fBmemory_lock_above\fP and
448 \fBmemory_unlock\fP (see \fBuser_caps\fP(5)).
449 .PP
450 Eric Raymond incorporated parts of \fImytinfo\fP into ncurses
451 to implement the termcap-to-terminfo source conversion,
452 and extended that to begin development of
453 the corresponding terminfo-to-termcap source conversion,
454 Thomas Dickey completed that development over the course of several years.
455 .PP
456 In 1999, Thomas Dickey added the \fB\-x\fP option
457 to support user-defined capabilities.
458 .PP
459 In 2010, Roy Marples provided a \fBtic\fP program
460 and terminfo library for NetBSD.
461 That implementation adapts several features from ncurses,
462 including \fB@TIC@\fP's \fB\-x\fP option.
463 .PP
464 The \fB\-c\fP option tells \fB@TIC@\fP to check for problems in the
465 terminfo source file.
466 Continued development provides additional checks:
467 .bP
468 \fIpcurses\fP had 8 warnings
469 .bP
470 ncurses in 1996 had 16 warnings
471 .bP
472 Solaris (SVr4) curses has 28 warnings
473 .bP
474 NetBSD tic in 2019 has 19 warnings.
475 .bP
476 ncurses in 2019 has 96 warnings
477 .PP
478 The checking done in ncurses' \fB@TIC@\fP helps with the conversion to
479 termcap, as well as pointing out errors and inconsistencies.
480 It is also used to ensure consistency with the user-defined capabilities.
481 There are 527 distinct capabilities in ncurses' terminal database;
482 128 of those are user-defined.
483 .SH PORTABILITY
484 X/Open Curses, Issue 7 (2009) provides a brief description of \fBtic\fP.
485 It lists one option: \fB\-c\fP.
486 The omission of \fB\-v\fP is unexpected.
487 The change history states that the description is derived from True64 UNIX.
488 According to its manual pages, that system also supported the \fB\-v\fP option.
489 .PP
490 Shortly after Issue 7 was released, Tru64 was discontinued.
491 As of 2019, the surviving implementations of \fBtic\fP
492 are SVr4 (AIX, HP-UX and Solaris),
493 ncurses
494 and NetBSD curses.
495 The SVr4 \fBtic\fP programs all support the \fB\-v\fP option.
496 The NetBSD \fBtic\fP program follows X/Open's documentation,
497 omitting the \fB\-v\fP option.
498 .PP
499 The X/Open rationale states that some implementations of \fBtic\fP
500 read terminal descriptions from the standard input if the \fIfile\fP
501 parameter is omitted.
502 None of these implementations do that.
503 Further, it comments that some may choose to read from \*(''./terminfo.src\*(''
504 but that is obsolescent behavior from SVr2,
505 and is not (for example) a documented feature of SVr3.
506 .SS COMPATIBILITY
507 There is some evidence that historic \fB@TIC@\fP implementations treated
508 description fields with no whitespace in them as additional aliases or
509 short names.
510 This \fB@TIC@\fP does not do that, but it does warn when
511 description fields may be treated that way and check them for dangerous
512 characters.
513 .SS EXTENSIONS
514 Unlike the SVr4 \fB@TIC@\fP command, this implementation can actually
515 compile termcap sources.
516 In fact, entries in terminfo and termcap syntax can
517 be mixed in a single source file.
518 See \fBterminfo\fP(\*n) for the list of
519 termcap names taken to be equivalent to terminfo names.
520 .PP
521 The SVr4 manual pages are not clear on the resolution rules for \fBuse\fP
522 capabilities.
523 This implementation of \fB@TIC@\fP will find \fBuse\fP targets anywhere
524 in the source file, or anywhere in the file tree rooted at \fBTERMINFO\fP (if
525 \fBTERMINFO\fP is defined),
526 or in the user's \fI$HOME/.terminfo\fP database
527 (if it exists),
528 or (finally) anywhere in the system's file tree of
529 compiled entries.
530 .PP
531 The error messages from this \fB@TIC@\fP have the same format as GNU C
532 error messages, and can be parsed by GNU Emacs's compile facility.
533 .PP
534 Aside from \fB\-c\fP and \fB\-v\fP, options are not portable:
535 .bP
536 Most of @TIC@'s options
537 are not supported by SVr4 \fBtic\fP:
538 .sp
539 .RS
540 \fB\-0\fP
541 \fB\-1\fP
542 \fB\-C\fP
543 \fB\-G\fP
544 \fB\-I\fP
545 \fB\-N\fP
546 \fB\-R\fP
547 \fB\-T\fP
548 \fB\-V\fP
549 \fB\-a\fP
550 \fB\-e\fP
551 \fB\-f\fP
552 \fB\-g\fP
553 \fB\-o\fP
554 \fB\-r\fP
555 \fB\-s\fP
556 \fB\-t\fP
557 \fB\-x\fP
558 .RE
559 .bP
560 The NetBSD \fBtic\fP  supports a few of the ncurses options
561 .sp
562 .RS
563 \fB\-a\fP
564 \fB\-o\fP
565 \fB\-x\fP
566 .RE
567 .IP
568 and adds \fB\-S\fP
569 (a feature which does the same thing
570 as @INFOCMP@'s \fB\-e\fP and \fB\-E\fP options).
571 .PP
572 The SVr4 \fB\-c\fP mode does not report bad \*(``use=\*('' links.
573 .PP
574 System V does not compile entries to or read entries from your
575 \fI$HOME/.terminfo\fP database unless TERMINFO is explicitly set to it.
576 .SH FILES
577 .TP 5
578 \fB\*d/?/*\fP
579 Compiled terminal description database.
580 .SH SEE ALSO
581 \fB@CAPTOINFO@\fP(1M),
582 \fB@INFOCMP@\fP(1M),
583 \fB@INFOTOCAP@\fP(1M),
584 \fB@TOE@\fP(1M),
585 \fBcurses\fP(3X),
586 \fBterm\fP(\*n).
587 \fBterminfo\fP(\*n).
588 \fBuser_caps\fP(\*n).
589 .PP
590 This describes \fBncurses\fP
591 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
592 .SH AUTHOR
593 Eric S. Raymond <esr@snark.thyrsus.com>
594 and
595 .br
596 Thomas E. Dickey <dickey@invisible-island.net>