xref: /netbsd/usr.bin/tput/tput.1 (revision bf9ec67e)
1.\"	$NetBSD: tput.1,v 1.11 2001/12/08 19:19:05 wiz Exp $
2.\"
3.\" Copyright (c) 1989, 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     @(#)tput.1	8.2 (Berkeley) 3/19/94
35.\"
36.Dd March 19, 1994
37.Dt TPUT 1
38.Os
39.Sh NAME
40.Nm tput ,
41.Nm clear
42.Nd terminal capability interface
43.Sh SYNOPSIS
44.Nm
45.Op Fl T Ar term
46.Ar attribute
47.Op Ar attribute-args
48.Ar ...
49.Sh DESCRIPTION
50.Nm
51makes terminal-dependent information available to users or shell
52applications.
53The options are as follows:
54.Bl -tag -width Ds
55.It Fl T
56The terminal name as specified in the
57.Xr termcap 5
58database, for example,
59.Dq vt100
60or
61.Dq xterm .
62If not specified,
63.Nm
64retrieves the
65.Dq Ev TERM
66variable from the environment.
67.El
68.Pp
69.Nm
70outputs a string if the
71.Ar attribute
72is of type string; a number if it is of type integer.
73Otherwise,
74.Nm
75exits 0 if the terminal has the capability and 1 if it does not,
76without further action.
77.Pp
78If the
79.Ar attribute
80is of type string, and takes arguments (e.g. cursor movement,
81the termcap
82.Dq cm
83sequence) the arguments are taken from the command line immediately
84following the attribute.
85.Pp
86The following special attributes are available:
87.Bl -tag -width Ar
88.It clear
89Clear the screen (the
90.Xr termcap 5
91.Dq cl
92sequence).
93.It init
94Initialize the terminal (the
95.Xr termcap 5
96.Dq is
97sequence).
98.It longname
99Print the descriptive name of the user's terminal type.
100.It reset
101Reset the terminal (the
102.Xr termcap 5
103.Dq rs
104sequence).
105.El
106.Sh EXIT STATUS
107The exit status of
108.Nm
109is based on the last attribute specified.
110If the attribute is of type string or of type integer,
111.Nm
112exits 0 if the attribute is defined for this terminal type and 1
113if it is not.
114If the attribute is of type boolean,
115.Nm
116exits 0 if the terminal has this attribute, and 1 if it does not.
117.Nm
118exits 2 if any error occurred.
119.Sh EXAMPLES
120.Bl -tag -width "tput cm 6 11 DC 6" -compact
121.It Li "tput cl cm 5 10"
122clear the screen and goto line 5 column 10
123.Pp
124.It Li "tput cm 6 11 DC 6"
125goto line 6 column 11 and delete 6 characters
126.El
127.Sh SEE ALSO
128.Xr termcap 3 ,
129.Xr termcap 5
130.Sh HISTORY
131The
132.Nm
133command appears in
134.Bx 4.4 .
135.Sh BUGS
136.Nm
137can't really distinguish between different types of attributes.
138