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