[BACK]Return to tput.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / tput

Annotation of src/usr.bin/tput/tput.1, Revision 1.10

1.10    ! aaron       1: .\"    $OpenBSD: tput.1,v 1.9 2000/03/06 03:17:40 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.8       aaron      53: The
                     54: .Nm
                     55: utility makes terminal-dependent information available to users or shell
1.1       deraadt    56: applications.
1.8       aaron      57: .Pp
1.1       deraadt    58: The options are as follows:
                     59: .Bl -tag -width Ds
                     60: .It Fl T
1.8       aaron      61: The terminal name as found in the
1.7       millert    62: .Xr terminfo
1.8       aaron      63: database; for example,
                     64: .Dq vt100
                     65: or
                     66: .Dq xterm .
1.1       deraadt    67: If not specified,
1.8       aaron      68: .Nm
1.1       deraadt    69: retrieves the
1.8       aaron      70: .Ev TERM
1.1       deraadt    71: variable from the environment.
1.7       millert    72: .It Fl S
                     73: The
                     74: .Ar attributes
1.8       aaron      75: are read from stdin instead of the command line.
1.1       deraadt    76: .El
                     77: .Pp
1.8       aaron      78: .Nm
1.1       deraadt    79: outputs a string if the
                     80: .Ar attribute
1.8       aaron      81: is of type string or a number if it is of type integer.
1.7       millert    82: If the
                     83: .Ar attribute
                     84: is of type boolean,
1.8       aaron      85: .Nm
                     86: exits 0 if the terminal has the capability or 1 if it
1.10    ! aaron      87: does not.
        !            88: Each
1.7       millert    89: .Ar attribute
                     90: should be a string defined in either
                     91: .Xr terminfo 5
                     92: or
                     93: .Xr termcap 5 .
1.1       deraadt    94: .Pp
                     95: If the
                     96: .Ar attribute
1.8       aaron      97: is of type string and takes arguments (e.g., cursor movement,
1.7       millert    98: the
                     99: .Xr terminfo
                    100: .Dq cup
1.1       deraadt   101: sequence) the arguments are taken from the command line immediately
                    102: following the attribute.
                    103: .Pp
                    104: The following special attributes are available:
                    105: .Bl -tag -width Ar
                    106: .It clear
                    107: Clear the screen (the
1.7       millert   108: .Xr terminfo
1.8       aaron     109: .Dq clear
                    110: sequence).
1.1       deraadt   111: .It init
1.7       millert   112: Print the
                    113: .Xr terminfo
                    114: initialization strings for the specified terminal.
1.1       deraadt   115: .It longname
                    116: Print the descriptive name of the user's terminal type.
                    117: .It reset
1.7       millert   118: Reset the terminal (using the
                    119: .Xr terminfo
                    120: reset sequences).
1.1       deraadt   121: .Sh DIAGNOSTICS
                    122: The exit value of
1.8       aaron     123: .Nm
1.1       deraadt   124: is based on the last attribute specified.
1.7       millert   125: If the attribute is of type string or of type integer the exit
                    126: value is as follows:
1.8       aaron     127: .Pp
1.7       millert   128: .Bl -tag -offset indent -width Ds -compact
                    129: .It 0
                    130: The requested string was written successfully.
                    131: .It 2
                    132: Usage error.
                    133: .It 3
                    134: Unknown terminal type.
                    135: .It 4
                    136: Unknown attribute name.
                    137: .It >4
                    138: An error occurred.
                    139: .El
                    140: .Pp
1.1       deraadt   141: If the attribute is of type boolean,
1.8       aaron     142: .Nm
                    143: exits with a value of 0 if the terminal has this attribute or
1.7       millert   144: 1 if it does not.
1.1       deraadt   145: .Sh EXAMPLES
1.7       millert   146: .Bl -tag -width "tput cup 6 11 dch 6" -compact
                    147: .It Li "tput clear cup 5 10"
1.1       deraadt   148: clear the screen and goto line 5 column 10
                    149: .Pp
1.7       millert   150: .It Li "tput cup 6 11 dch 6"
1.1       deraadt   151: goto line 6 column 11 and delete 6 characters
                    152: .Sh SEE ALSO
1.7       millert   153: .Xr terminfo 3 ,
                    154: .Xr terminfo 5
1.1       deraadt   155: .Sh HISTORY
                    156: The
                    157: .Nm
1.8       aaron     158: utility appeared in
1.1       deraadt   159: .Bx 4.4 .
1.9       aaron     160: .Sh BUGS
                    161: .Nm
                    162: can't really distinguish between different types of attributes.