xref: /original-bsd/usr.bin/tput/tput.1 (revision 84689157)
Copyright (c) 1989 The Regents of the University of California.
All rights reserved.

Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was developed
by the University of California, Berkeley. The name of the
University may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

@(#)tput.1 6.3 (Berkeley) 10/31/89

TPUT 1 ""
C 7
NAME
tput - terminal capability interface
SYNOPSIS
tput [ -T term ] attribute
DESCRIPTION
Tput makes terminal-dependent information available to users or shell applications. The options are as follows:

-T The terminal name as specified in the termcap database, for example, ``vt100'' or ``xterm''. If not specified, tput retrieves the ``TERM'' variable from the environment.

Tput outputs a string if the attribute is of type string; a number if it is of type integer. Otherwise, tput exits 0 if the terminal has the capability and 1 if it does not, without further action.

The following special attributes are available:

clear

Clear the screen (the termcap ``cl'' sequence).

init

Initialize the terminal (the termcap ``is'' sequence).

longname Print the descriptive name of the user's terminal type.

reset

Reset the terminal (the termcap ``rs'' sequence).

DIAGNOSTICS
The exit value of tput is based on the last attribute specified. If the attribute is of type string or of type integer, tput exits 0 if the attribute is defined for this terminal type and 1 if it is not. If the attribute is of type boolean, tput exits 0 if the terminal has this attribute, and 1 if it does not. Tput exits 2 if any error occurred.
"SEE ALSO"
termcap(3), termcap(5)
BUGS
Tput can't really distinguish between different types of attributes. This is due to the limited interface in the current version of termcap (3), and will be fixed in the near future.