Before using a value returned on the standard output, the application should test the exit code (e.g., $?, see sh(1)) to be sure it is 0. (See the EXIT CODES and DIAGNOSTICS sections.) For a complete list of capabilities and the capname associated with each, see terminfo(1).
If tput is invoked by a link named reset, this has the same effect as tput reset. See tset for comparison, which has similar behavior.
Any other exit code indicates an error; see the DIAGNOSTICS section.
| exit code | error message |
|
| |
| 0 | (capname is a numeric variable that is not specified in the terminfo(1) database for this terminal type, e.g. tput -T450 lines and tput -T2621 xmc) |
| 1 | no error message is printed, see the EXIT CODES section. |
| 2 | usage error |
| 3 | unknown terminal type or no terminfo database |
| 4 | unknown terminfo capability capname |
| >4 | error occurred in -S |
|
| |
The longname and -S options, and the parameter-substitution features used in the cup example, are not supported in BSD curses or in AT&T/USL curses before SVr4.
X/Open documents only the operands for clear, init and reset. In this implementation, clear is part of the capname support. Other implementations of tput on SVr4-based systems such as Solaris, IRIX64 and HPUX as well as others such as AIX and Tru64 provide support for capname operands. A few platforms such as FreeBSD and NetBSD recognize termcap names rather than terminfo capability names in their respective tput commands.
This describes ncurses version 5.5 (patch 20060715).