]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/tput/tput.1
disk(9): Fix a few mandoc related errors
[FreeBSD/FreeBSD.git] / usr.bin / tput / tput.1
1 .\" Copyright (c) 1989, 1990, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)tput.1      8.2 (Berkeley) 3/19/94
29 .\" $FreeBSD$
30 .\"
31 .Dd June 15, 2002
32 .Dt TPUT 1
33 .Os
34 .Sh NAME
35 .Nm tput ,
36 .Nm clear
37 .Nd terminal capability interface
38 .Sh SYNOPSIS
39 .Nm
40 .Op Fl T Ar term
41 .Op Ar attribute ...
42 .Nm clear
43 .Sh DESCRIPTION
44 The
45 .Nm
46 utility makes terminal-dependent information available to users or shell
47 applications.
48 .Pp
49 The
50 .Nm clear
51 utility executes the
52 .Dl tput clear
53 command, ignoring any arguments.
54 .Pp
55 The only option to
56 .Nm
57 is:
58 .Bl -tag -width 2n
59 .It Fl T
60 The terminal name as specified in the
61 .Xr termcap 5
62 database, for example,
63 .Dq vt100
64 or
65 .Dq xterm .
66 If not specified,
67 .Nm
68 retrieves the
69 .Dq Ev TERM
70 variable from the environment unless that too is not specified,
71 in which case an error message will be sent to standard error and
72 the error status will be 2.
73 .El
74 .Pp
75 The
76 .Nm
77 utility outputs a string for each
78 .Ar attribute
79 that is of type string; a number for each of type integer.
80 Otherwise,
81 .Nm
82 exits 0 if the terminal has the capability and 1 if it does not,
83 without further action.
84 .Pp
85 If an
86 .Ar attribute
87 is of type string, and takes arguments (e.g.\& cursor movement,
88 the termcap
89 .Dq cm
90 capability) the arguments are taken from the command line immediately
91 following the attribute.
92 .Pp
93 The following special attributes are available.
94 The first three use the capabilities of the specified terminal,
95 and only work if compatible with the utility's terminal.
96 .Bl -tag -width Ar
97 .It Cm clear
98 Clear the screen (the
99 .Xr termcap 5
100 .Dq cl
101 capability).
102 .It Cm init
103 Initialize the terminal (the
104 .Xr termcap 5
105 .Dq is
106 capability).
107 .It Cm reset
108 Reset the terminal (the
109 .Xr termcap 5
110 .Dq rs
111 capability).
112 .It Cm longname
113 Print the descriptive name of the user's terminal type.
114 .El
115 .Sh ENVIRONMENT
116 .Bl -tag -width ".Ev TERM"
117 .It Ev TERM
118 The terminal name, if set and
119 .Fl T
120 is not used.
121 .El
122 .Sh EXIT STATUS
123 The exit status of
124 .Nm
125 is as follows:
126 .Bl -tag -width indent
127 .It 0
128 If the last
129 .Ar attribute
130 is of type string or integer, its value was successfully written
131 to standard output.
132 If the
133 .Ar attribute
134 is of type boolean, the terminal does have the
135 .Ar attribute .
136 Otherwise, no
137 .Ar attribute
138 was specified.
139 .It 1
140 If the last
141 .Ar attribute
142 is of type boolean,
143 this terminal does not have the
144 .Ar attribute .
145 .It 2
146 Usage error.
147 For example, see
148 .Fl T
149 description.
150 .It 3
151 No information is available about the specified terminal type.
152 .El
153 .Sh SEE ALSO
154 .Xr termcap 5 ,
155 .Xr terminfo 5
156 .Sh STANDARDS
157 The
158 .Nm
159 utility conforms to
160 .St -p1003.1-2001 .
161 .Sh HISTORY
162 The
163 .Nm
164 utility appeared in
165 .Bx 4.4 .
166 .Sh BUGS
167 The
168 .Nm
169 utility cannot really distinguish between different types of attributes.
170 .Pp
171 Some termcap entries depend upon having a
172 .Sq %
173 in them that is just a
174 .Sq %
175 and nothing more.
176 Right now we just warn about them if they do not
177 have a valid type declaration.
178 These warnings are sent to
179 stderr.