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