xref: /original-bsd/usr.bin/tput/tput.1 (revision 76321dfe)
1.\" Copyright (c) 1989, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)tput.1	8.2 (Berkeley) 03/19/94
7.\"
8.Dd
9.Dt TPUT 1
10.Os BSD 4.4
11.Sh NAME
12.Nm tput
13.Nd terminal capability interface
14.Sh SYNOPSIS
15.Nm tput
16.Op Fl T Ar term
17.Ar attribute
18.Sh DESCRIPTION
19.Nm Tput
20makes terminal-dependent information available to users or shell
21applications.
22The options are as follows:
23.Bl -tag -width Ds
24.It Fl T
25The terminal name as specified in the
26.Xr termcap
27database, for example, ``vt100'' or ``xterm''.
28If not specified,
29.Nm tput
30retrieves the
31.Dq Ev TERM
32variable from the environment.
33.El
34.Pp
35.Nm Tput
36outputs a string if the
37.Ar attribute
38is of type string; a number if it is of type integer.
39Otherwise,
40.Nm tput
41exits 0 if the terminal has the capability and 1 if it does not,
42without further action.
43.Pp
44If the
45.Ar attribute
46is of type string, and takes arguments (e.g. cursor movement,
47the termcap
48.Dq cm
49sequence) the arguments are taken from the command line immediately
50following the attribute.
51.Pp
52The following special attributes are available:
53.Bl -tag -width Ar
54.It clear
55Clear the screen (the
56.Xr termcap
57``cl'' sequence).
58.It init
59Initialize the terminal (the
60.Xr termcap
61``is'' sequence).
62.It longname
63Print the descriptive name of the user's terminal type.
64.It reset
65Reset the terminal (the
66.Xr termcap
67``rs'' sequence).
68.Sh DIAGNOSTICS
69The exit value of
70.Nm tput
71is based on the last attribute specified.
72If the attribute is of type string or of type integer,
73.Nm tput
74exits 0 if the attribute is defined for this terminal type and 1
75if it is not.
76If the attribute is of type boolean,
77.Nm tput
78exits 0 if the terminal has this attribute, and 1 if it does not.
79.Nm Tput
80exits 2 if any error occurred.
81.Sh SEE ALSO
82.Xr termcap 3 ,
83.Xr termcap 5
84.Sh BUGS
85.Nm Tput
86can't really distinguish between different types of attributes.
87.Sh HISTORY
88The
89.Nm
90command appears in
91.Bx 4.4 .
92