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