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