]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/tput.1
ncurses 6.2 - patch 20210102
[ncurses.git] / man / tput.1
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright 2018,2020 Thomas E. Dickey                                     *
4 .\" Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
5 .\"                                                                          *
6 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
7 .\" copy of this software and associated documentation files (the            *
8 .\" "Software"), to deal in the Software without restriction, including      *
9 .\" without limitation the rights to use, copy, modify, merge, publish,      *
10 .\" distribute, distribute with modifications, sublicense, and/or sell       *
11 .\" copies of the Software, and to permit persons to whom the Software is    *
12 .\" furnished to do so, subject to the following conditions:                 *
13 .\"                                                                          *
14 .\" The above copyright notice and this permission notice shall be included  *
15 .\" in all copies or substantial portions of the Software.                   *
16 .\"                                                                          *
17 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
18 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
19 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
20 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
21 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
22 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
23 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
24 .\"                                                                          *
25 .\" Except as contained in this notice, the name(s) of the above copyright   *
26 .\" holders shall not be used in advertising or otherwise to promote the     *
27 .\" sale, use or other dealings in this Software without prior written       *
28 .\" authorization.                                                           *
29 .\"***************************************************************************
30 .\"
31 .\" $Id: tput.1,v 1.65 2020/12/19 22:17:47 tom Exp $
32 .TH @TPUT@ 1 ""
33 .ds d @TERMINFO@
34 .ds n 1
35 .ie \n(.g .ds `` \(lq
36 .el       .ds `` ``
37 .ie \n(.g .ds '' \(rq
38 .el       .ds '' ''
39 .de bP
40 .ie n  .IP \(bu 4
41 .el    .IP \(bu 2
42 ..
43 .SH NAME
44 \fB@TPUT@\fR, \fBreset\fR \- initialize a terminal or query terminfo database
45 .SH SYNOPSIS
46 \fB@TPUT@\fR [\fB\-T\fR\fItype\fR] \fIcapname\fR [\fIparameters\fR]
47 .br
48 \fB@TPUT@\fR [\fB\-T\fR\fItype\fR] [\fB\-x\fP] \fBclear\fR
49 .br
50 \fB@TPUT@\fR [\fB\-T\fR\fItype\fR] \fBinit\fR
51 .br
52 \fB@TPUT@\fR [\fB\-T\fR\fItype\fR] \fBreset\fR
53 .br
54 \fB@TPUT@\fR [\fB\-T\fR\fItype\fR] \fBlongname\fR
55 .br
56 \fB@TPUT@ \-S\fR  \fB<<\fR
57 .br
58 \fB@TPUT@ \-V\fR
59 .br
60 .SH DESCRIPTION
61 The \fB@TPUT@\fR utility uses the \fBterminfo\fR database to make the
62 values of terminal-dependent capabilities and information available to
63 the shell (see \fBsh\fR(1)), to initialize or reset the terminal, or
64 return the long name of the requested terminal type.
65 The result depends upon the capability's type:
66 .RS 3
67 .TP 5
68 string
69 \fB@TPUT@\fR writes the string to the standard output.
70 No trailing newline is supplied.
71 .TP
72 integer
73 \fB@TPUT@\fR writes the decimal value to the standard output,
74 with a trailing newline.
75 .TP
76 boolean
77 \fB@TPUT@\fR simply sets the exit code
78 (\fB0\fR for TRUE if the terminal has the capability,
79 \fB1\fR for FALSE if it does not),
80 and writes nothing to the standard output.
81 .RE
82 .PP
83 Before using a value returned on the standard output,
84 the application should test the exit code
85 (e.g., \fB$?\fR, see \fBsh\fR(1)) to be sure it is \fB0\fR.
86 (See the \fBEXIT CODES\fR and \fBDIAGNOSTICS\fR sections.)
87 For a complete list of capabilities
88 and the \fIcapname\fR associated with each, see \fBterminfo\fR(5).
89 .SS Options
90 .TP
91 \fB\-S\fR
92 allows more than one capability per invocation of \fB@TPUT@\fR.  The
93 capabilities must be passed to \fB@TPUT@\fR from the standard input
94 instead of from the command line (see example).
95 Only one \fIcapname\fR is allowed per line.
96 The \fB\-S\fR option changes the
97 meaning of the \fB0\fR and \fB1\fR boolean and string exit codes (see the
98 EXIT CODES section).
99 .IP
100 Because some capabilities may use
101 \fIstring\fP parameters rather than \fInumbers\fP,
102 \fB@TPUT@\fR uses a table and the presence of parameters in its input
103 to decide whether to use \fBtparm\fR(3X),
104 and how to interpret the parameters.
105 .TP
106 \fB\-T\fR\fItype\fR
107 indicates the \fItype\fR of terminal.
108 Normally this option is
109 unnecessary, because the default is taken from the environment
110 variable \fBTERM\fR.
111 If \fB\-T\fR is specified, then the shell
112 variables \fBLINES\fR and \fBCOLUMNS\fR will also be ignored.
113 .TP
114 \fB\-V\fR
115 reports the version of ncurses which was used in this program, and exits.
116 .TP
117 .B \-x
118 do not attempt to clear the terminal's scrollback buffer
119 using the extended \*(``E3\*('' capability.
120 .SS Commands
121 A few commands (\fBinit\fP, \fBreset\fP and \fBlongname\fP) are
122 special; they are defined by the \fB@TPUT@\fP program.
123 The others are the names of \fIcapabilities\fP from the terminal database
124 (see \fBterminfo\fR(5) for a list).
125 Although \fBinit\fP and \fBreset\fP resemble capability names,
126 \fB@TPUT@\fP uses several capabilities to perform these special functions.
127 .TP
128 \fIcapname\fR
129 indicates the capability from the terminal database.
130 .IP
131 If the capability is a string that takes parameters, the arguments
132 following the capability will be used as parameters for the string.
133 .IP
134 Most parameters are numbers.
135 Only a few terminal capabilities require string parameters;
136 \fB@TPUT@\fR uses a table to decide which to pass as strings.
137 Normally \fB@TPUT@\fR uses \fBtparm\fR(3X) to perform the substitution.
138 If no parameters are given for the capability,
139 \fB@TPUT@\fR writes the string without performing the substitution.
140 .TP
141 \fBinit\fR
142 If the terminal database is present and an entry for the user's
143 terminal exists (see \fB\-T\fR\fItype\fR, above), the following will
144 occur:
145 .RS
146 .TP 5
147 (1)
148 first, \fB@TPUT@\fR retrieves the current terminal mode settings
149 for your terminal.
150 It does this by successively testing
151 .RS
152 .bP
153 the standard error,
154 .bP
155 standard output,
156 .bP
157 standard input and
158 .bP
159 ultimately \*(``/dev/tty\*(''
160 .RE
161 .IP
162 to obtain terminal settings.
163 Having retrieved these settings, \fB@TPUT@\fP remembers which
164 file descriptor to use when updating settings.
165 .TP
166 (2)
167 if the window size cannot be obtained from the operating system,
168 but the terminal description (or environment, e.g., \fBLINES\fP
169 and \fBCOLUMNS\fP variables specify this),
170 update the operating system's notion of the window size.
171 .TP
172 (3)
173 the terminal modes will be updated:
174 .RS
175 .bP
176 any delays (e.g., newline) specified in the entry will
177 be set in the tty driver,
178 .bP
179 tabs expansion will be turned on or off according to
180 the specification in the entry, and
181 .bP
182 if tabs are not expanded,
183 standard tabs will be set (every 8 spaces).
184 .RE
185 .TP
186 (4)
187 if present, the terminal's initialization strings will be
188 output as detailed in the \fBterminfo\fR(5) section on
189 .IR "Tabs and Initialization" ,
190 .TP
191 (5)
192 output is flushed.
193 .RE
194 .IP
195 If an entry does not
196 contain the information needed for any of these activities,
197 that activity will silently be skipped.
198 .TP
199 \fBreset\fR
200 This is similar to \fBinit\fP, with two differences:
201 .RS
202 .TP 5
203 (1)
204 before any other initialization,
205 the terminal modes will be reset to a \*(``sane\*('' state:
206 .RS
207 .bP
208 set cooked and echo modes,
209 .bP
210 turn off cbreak and raw modes,
211 .bP
212 turn on newline translation and
213 .bP
214 reset any unset special characters to their default values
215 .RE
216 .TP 5
217 (2)
218 Instead of putting out \fIinitialization\fP strings, the terminal's
219 \fIreset\fP strings will be output if present
220 (\fBrs1\fR, \fBrs2\fR, \fBrs3\fR, \fBrf\fR).
221 If the \fIreset\fP strings are not present, but \fIinitialization\fP
222 strings are, the \fIinitialization\fP strings will be output.
223 .RE
224 .IP
225 Otherwise, \fBreset\fR acts identically to \fBinit\fR.
226 .TP
227 \fBlongname\fR
228 If the terminal database is present and an entry for the
229 user's terminal exists (see \fB\-T\fR\fItype\fR above), then the long name
230 of the terminal will be put out.
231 The long name is the last
232 name in the first line of the terminal's description in the
233 \fBterminfo\fR database [see \fBterm\fR(5)].
234 .SS Aliases
235 \fB@TPUT@\fR handles the \fBclear\fP, \fBinit\fP and \fBreset\fP
236 commands specially:
237 it allows for the possibility that it is invoked by a link with those names.
238 .PP
239 If \fB@TPUT@\fR is invoked by a link named \fBreset\fR, this has the
240 same effect as \fB@TPUT@ reset\fR.
241 The \fB@TSET@\fR(\*n) utility also treats a link named \fBreset\fP specially.
242 .PP
243 Before ncurses 6.1, the two utilities were different from each other:
244 .bP
245 \fB@TSET@\fP utility reset the terminal modes and special characters
246 (not done with \fB@TPUT@\fP).
247 .bP
248 On the other hand, \fB@TSET@\fP's repertoire of terminal capabilities for
249 resetting the terminal was more limited,
250 i.e., only \fBreset_1string\fP, \fBreset_2string\fP and \fBreset_file\fP
251 in contrast to the tab-stops and margins which are set by this utility.
252 .bP
253 The \fBreset\fP program is usually an alias for \fB@TSET@\fP,
254 because of this difference with resetting terminal modes and special characters.
255 .PP
256 With the changes made for ncurses 6.1, the \fIreset\fP feature of the
257 two programs is (mostly) the same.
258 A few differences remain:
259 .bP
260 The \fB@TSET@\fP program waits one second when resetting,
261 in case it happens to be a hardware terminal.
262 .bP
263 The two programs write the terminal initialization strings
264 to different streams (i.e., the standard error for \fB@TSET@\fP and the
265 standard output for \fB@TPUT@\fP).
266 .IP
267 \fBNote:\fP although these programs write to different streams,
268 redirecting their output to a file will capture only part of their actions.
269 The changes to the terminal modes are not affected by redirecting the output.
270 .PP
271 If \fB@TPUT@\fR is invoked by a link named \fBinit\fR, this has the
272 same effect as \fB@TPUT@ init\fR.
273 Again, you are less likely to use that link because another program
274 named \fBinit\fP has a more well-established use.
275 .SS Terminal Size
276 .PP
277 Besides the special commands (e.g., \fBclear\fP),
278 @TPUT@ treats certain terminfo capabilities specially:
279 \fBlines\fP and \fBcols\fP.
280 @TPUT@ calls \fBsetupterm\fP(3X) to obtain the terminal size:
281 .bP
282 first, it gets the size from the terminal database
283 (which generally is not provided for terminal emulators
284 which do not have a fixed window size)
285 .bP
286 then it asks the operating system for the terminal's size
287 (which generally works, unless connecting via a serial line which
288 does not support \fINAWS\fP: negotiations about window size).
289 .bP
290 finally, it inspects the environment variables \fBLINES\fP and \fBCOLUMNS\fP
291 which may override the terminal size.
292 .PP
293 If the \fB\-T\fP option is given
294 @TPUT@ ignores the environment variables by calling \fBuse_tioctl(TRUE)\fP,
295 relying upon the operating system (or finally, the terminal database).
296 .SH EXAMPLES
297 .TP 5
298 \fB@TPUT@ init\fR
299 Initialize the terminal according to the type of
300 terminal in the environmental variable \fBTERM\fR.  This
301 command should be included in everyone's .profile after
302 the environmental variable \fBTERM\fR has been exported, as
303 illustrated on the \fBprofile\fR(5) manual page.
304 .TP 5
305 \fB@TPUT@ \-T5620 reset\fR
306 Reset an AT&T 5620 terminal, overriding the type of
307 terminal in the environmental variable \fBTERM\fR.
308 .TP 5
309 \fB@TPUT@ cup 0 0\fR
310 Send the sequence to move the cursor to row \fB0\fR, column \fB0\fR
311 (the upper left corner of the screen, usually known as the \*(``home\*(''
312 cursor position).
313 .TP 5
314 \fB@TPUT@ clear\fR
315 Echo the clear-screen sequence for the current terminal.
316 .TP 5
317 \fB@TPUT@ cols\fR
318 Print the number of columns for the current terminal.
319 .TP 5
320 \fB@TPUT@ \-T450 cols\fR
321 Print the number of columns for the 450 terminal.
322 .TP 5
323 \fBbold=`@TPUT@ smso` offbold=`@TPUT@ rmso`\fR
324 Set the shell variables \fBbold\fR, to begin stand-out mode
325 sequence, and \fBoffbold\fR, to end standout mode sequence,
326 for the current terminal.
327 This might be followed by a
328 prompt: \fBecho "${bold}Please type in your name: ${offbold}\\c"\fR
329 .TP 5
330 \fB@TPUT@ hc\fR
331 Set exit code to indicate if the current terminal is a hard copy terminal.
332 .TP 5
333 \fB@TPUT@ cup 23 4\fR
334 Send the sequence to move the cursor to row 23, column 4.
335 .TP 5
336 \fB@TPUT@ cup\fR
337 Send the terminfo string for cursor-movement, with no parameters substituted.
338 .TP 5
339 \fB@TPUT@ longname\fR
340 Print the long name from the \fBterminfo\fR database for the
341 type of terminal specified in the environmental
342 variable \fBTERM\fR.
343 .PP
344 .RS 5
345 \fB@TPUT@ \-S <<!\fR
346 .br
347 \fB> clear\fR
348 .br
349 \fB> cup 10 10\fR
350 .br
351 \fB> bold\fR
352 .br
353 \fB> !\fR
354 .RE
355 .TP 5
356 \&
357 This example shows \fB@TPUT@\fR processing several capabilities
358 in one invocation.
359 It clears the screen,
360 moves the cursor to position 10, 10
361 and turns on bold (extra bright) mode.
362 The list is terminated by an exclamation mark (\fB!\fR) on a line by itself.
363 .SH FILES
364 .TP
365 \fB\*d\fR
366 compiled terminal description database
367 .TP
368 \fB@DATADIR@/tabset/*\fR
369 tab settings for some terminals, in a format
370 appropriate to be output to the terminal (escape
371 sequences that set margins and tabs); for more
372 information, see the
373 .IR "Tabs and Initialization" ,
374 section of \fBterminfo\fR(5)
375 .SH EXIT CODES
376 If the \fB\-S\fR option is used,
377 \fB@TPUT@\fR checks for errors from each line,
378 and if any errors are found, will set the exit code to 4 plus the
379 number of lines with errors.
380 If no errors are found, the exit code is \fB0\fR.
381 No indication of which line failed can be given so
382 exit code \fB1\fR will never appear.
383 Exit codes \fB2\fR, \fB3\fR, and
384 \fB4\fR retain their usual interpretation.
385 If the \fB\-S\fR option is not used,
386 the exit code depends on the type of \fIcapname\fR:
387 .RS 3
388 .TP
389 .I boolean
390 a value of \fB0\fR is set for TRUE and \fB1\fR for FALSE.
391 .TP
392 .I string
393 a value of \fB0\fR is set if the
394 \fIcapname\fR is defined for this terminal \fItype\fR (the value of
395 \fIcapname\fR is returned on standard output);
396 a value of \fB1\fR is set if \fIcapname\fR
397 is not defined for this terminal \fItype\fR
398 (nothing is written to standard output).
399 .TP
400 .I integer
401 a value of \fB0\fR is always set,
402 whether or not \fIcapname\fR is defined for this terminal \fItype\fR.
403 To determine if \fIcapname\fR is defined for this terminal \fItype\fR,
404 the user must test the value written to standard output.
405 A value of \fB\-1\fR
406 means that \fIcapname\fR is not defined for this terminal \fItype\fR.
407 .TP
408 .I other
409 \fBreset\fR or \fBinit\fR may fail to find their respective files.
410 In that case, the exit code is set to 4 + \fBerrno\fR.
411 .RE
412 .PP
413 Any other exit code indicates an error; see the DIAGNOSTICS section.
414 .SH DIAGNOSTICS
415 \fB@TPUT@\fR prints the following error messages and sets the corresponding exit
416 codes.
417 .PP
418 .ne 15
419 .TS
420 l l.
421 exit code       error message
422 =
423 \fB0\fR T{
424 (\fIcapname\fR is a numeric variable that is not specified in the
425 \fBterminfo\fR(5) database for this terminal type, e.g.
426 \fB@TPUT@ \-T450 lines\fR and \fB@TPUT@ \-T2621 xmc\fR)
427 T}
428 \fB1\fR no error message is printed, see the \fBEXIT CODES\fR section.
429 \fB2\fR usage error
430 \fB3\fR unknown terminal \fItype\fR or no \fBterminfo\fR database
431 \fB4\fR unknown \fBterminfo\fR capability \fIcapname\fR
432 \fB>4\fR        error occurred in \-S
433 =
434 .TE
435 .SH HISTORY
436 The \fBtput\fP command was begun by Bill Joy in 1980.
437 The initial version only cleared the screen.
438 .PP
439 AT&T System V provided a different \fBtput\fP command,
440 whose \fBinit\fP and \fBreset\fP  subcommands
441 (more than half the program) were incorporated from
442 the \fBreset\fP feature of BSD \fBtset\fP written by Eric Allman.
443 .PP
444 Keith Bostic replaced the BSD \fBtput\fP command in 1989
445 with a new implementation
446 based on the AT&T System V program \fBtput\fP.
447 Like the AT&T program, Bostic's version
448 accepted some parameters named for \fIterminfo capabilities\fP
449 (\fBclear\fP, \fBinit\fP, \fBlongname\fP and \fBreset\fP).
450 However (because he had only termcap available),
451 it accepted \fItermcap names\fP for other capabilities.
452 Also, Bostic's BSD \fBtput\fP did not modify the terminal I/O modes
453 as the earlier BSD \fBtset\fP had done.
454 .PP
455 At the same time, Bostic added a shell script named \*(``clear\*('',
456 which used \fBtput\fP to clear the screen.
457 .PP
458 Both of these appeared in 4.4BSD,
459 becoming the \*(``modern\*('' BSD implementation of \fBtput\fP.
460 .PP
461 This implementation of \fBtput\fP began from a different source than
462 AT&T or BSD: Ross Ridge's \fImytinfo\fP package, published on
463 \fIcomp.sources.unix\fP in December 1992.
464 Ridge's program made more sophisticated use of the terminal capabilities
465 than the BSD program.
466 Eric Raymond used that \fBtput\fP program
467 (and other parts of \fImytinfo\fP) in ncurses in June 1995.
468 Using the portions dealing with terminal capabilities
469 almost without change,
470 Raymond made improvements to the way the command-line parameters
471 were handled.
472 .SH PORTABILITY
473 .PP
474 This implementation of \fBtput\fP differs from AT&T \fBtput\fP in
475 two important areas:
476 .bP
477 \fB@TPUT@\fP \fIcapname\fP writes to the standard output.
478 That need not be a regular terminal.
479 However, the subcommands which manipulate terminal modes
480 may not use the standard output.
481 .IP
482 The AT&T implementation's \fBinit\fP and \fBreset\fP commands
483 use the BSD (4.1c) \fBtset\fP source, which manipulates terminal modes.
484 It successively tries standard output, standard error, standard input
485 before falling back to \*(``/dev/tty\*('' and finally just assumes
486 a 1200Bd terminal.
487 When updating terminal modes, it ignores errors.
488 .IP
489 Until changes made after ncurses 6.0,
490 \fB@TPUT@\fP did not modify terminal modes.
491 \fB@TPUT@\fP now uses a similar scheme,
492 using functions shared with \fB@TSET@\fP
493 (and ultimately based on the 4.4BSD \fBtset\fP).
494 If it is not able to open a terminal, e.g., when running in \fBcron\fP,
495 \fB@TPUT@\fP will return an error.
496 .bP
497 AT&T \fBtput\fP guesses the type of its \fIcapname\fP operands by seeing if
498 all of the characters are numeric, or not.
499 .IP
500 Most implementations which provide support for \fIcapname\fR operands
501 use the \fItparm\fP function to expand parameters in it.
502 That function expects a mixture of numeric and string parameters,
503 requiring \fB@TPUT@\fP to know which type to use.
504 .IP
505 This implementation uses a table to determine the parameter types for
506 the standard \fIcapname\fR operands, and an internal library
507 function to analyze nonstandard \fIcapname\fR operands.
508 .PP
509 This implementation (unlike others) can accept both \fItermcap\fP
510 and \fIterminfo\fP names for the \fIcapname\fP feature,
511 if
512 \fItermcap\fR support is compiled in.
513 However, the predefined \fItermcap\fP and \fIterminfo\fP names have two
514 ambiguities in this case (and the \fIterminfo\fP name is assumed):
515 .bP
516 The \fItermcap\fP name \fBdl\fP corresponds to
517 the \fIterminfo\fP name \fBdl1\fP (delete one line).
518 .br
519 The \fIterminfo\fP name \fBdl\fP corresponds to
520 the \fItermcap\fP name \fBDL\fP (delete a given number of lines).
521 .bP
522 The \fItermcap\fP name \fBed\fP corresponds to
523 the \fIterminfo\fP name \fBrmdc\fP (end delete mode).
524 .br
525 The \fIterminfo\fP name \fBed\fP corresponds to
526 the \fItermcap\fP name \fBcd\fP (clear to end of screen).
527 .PP
528 The \fBlongname\fR and \fB\-S\fR options, and the parameter-substitution
529 features used in the \fBcup\fR example,
530 were not supported in BSD curses before 4.3reno (1989) or in
531 AT&T/USL curses before SVr4 (1988).
532 .PP
533 IEEE Std 1003.1/The Open Group  Base Specifications Issue 7 (POSIX.1-2008) 
534 documents only the operands for \fBclear\fP, \fBinit\fP and \fBreset\fP.
535 There are a few interesting observations to make regarding that:
536 .bP
537 In this implementation, \fBclear\fP is part of the \fIcapname\fR support.
538 The others (\fBinit\fP and \fBlongname\fP) do not correspond to terminal
539 capabilities.
540 .bP
541 Other implementations of \fBtput\fP on
542 SVr4-based systems such as Solaris, IRIX64 and HPUX
543 as well as others such as AIX and Tru64
544 provide support for \fIcapname\fR operands.
545 .bP
546 A few platforms such as FreeBSD recognize termcap names rather
547 than terminfo capability names in their respective \fBtput\fP commands.
548 Since 2010, NetBSD's \fBtput\fP uses terminfo names.
549 Before that, it (like FreeBSD) recognized termcap names.
550 .PP
551 Because (apparently) \fIall\fP of the certified Unix systems
552 support the full set of capability names, the reasoning for documenting
553 only a few may not be apparent.
554 .bP
555 X/Open Curses Issue 7 documents \fBtput\fP differently, with \fIcapname\fP
556 and the other features used in this implementation.
557 .bP
558 That is, there are two standards for \fBtput\fP:
559 POSIX (a subset) and X/Open Curses (the full implementation).
560 POSIX documents a subset to avoid the complication of including X/Open Curses
561 and the terminal capabilities database.
562 .bP
563 While it is certainly possible to write a \fBtput\fP program
564 without using curses,
565 none of the systems which have a curses implementation provide
566 a \fBtput\fP utility which does not provide the \fIcapname\fP feature.
567 .PP
568 X/Open Curses Issue 7 (2009) is the first version to document utilities.
569 However that part of X/Open Curses does not follow existing practice
570 (i.e., Unix features documented in SVID 3):
571 .bP
572 It assigns exit code 4 to \*(``invalid operand\*('',
573 which may be the same as \fIunknown capability\fP.
574 For instance, the source code for Solaris' xcurses uses the term
575 \*(``invalid\*('' in this case.
576 .bP
577 It assigns exit code 255 to a numeric variable that is not specified in
578 the terminfo database.
579 That likely is a documentation error,
580 confusing the \fB\-1\fP written to the standard output for an absent
581 or cancelled numeric value versus an (unsigned) exit code.
582 .PP
583 The various Unix systems (AIX, HPUX, Solaris) use the same exit-codes
584 as ncurses.
585 .PP
586 NetBSD curses documents different exit codes which do not correspond
587 to either ncurses or X/Open.
588 .SH SEE ALSO
589 \fB@CLEAR@\fR(\*n),
590 \fBstty\fR(1),
591 \fB@TABS@\fR(\*n),
592 \fB@TSET@\fR(\*n),
593 \fBcurs_termcap\fR(3X),
594 \fBterminfo\fR(5).
595 .PP
596 This describes \fBncurses\fR
597 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).