[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.8

1.8     ! aaron       1: .\"    $OpenBSD: tput.1,v 1.7 1999/06/29 19:39:40 millert 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.7       millert    87: does not.  Each
                     88: .Ar attribute
                     89: should be a string defined in either
                     90: .Xr terminfo 5
                     91: or
                     92: .Xr termcap 5 .
1.1       deraadt    93: .Pp
                     94: If the
                     95: .Ar attribute
1.8     ! aaron      96: is of type string and takes arguments (e.g., cursor movement,
1.7       millert    97: the
                     98: .Xr terminfo
                     99: .Dq cup
1.1       deraadt   100: sequence) the arguments are taken from the command line immediately
                    101: following the attribute.
                    102: .Pp
                    103: The following special attributes are available:
                    104: .Bl -tag -width Ar
                    105: .It clear
                    106: Clear the screen (the
1.7       millert   107: .Xr terminfo
1.8     ! aaron     108: .Dq clear
        !           109: sequence).
1.1       deraadt   110: .It init
1.7       millert   111: Print the
                    112: .Xr terminfo
                    113: initialization strings for the specified terminal.
1.1       deraadt   114: .It longname
                    115: Print the descriptive name of the user's terminal type.
                    116: .It reset
1.7       millert   117: Reset the terminal (using the
                    118: .Xr terminfo
                    119: reset sequences).
1.1       deraadt   120: .Sh DIAGNOSTICS
                    121: The exit value of
1.8     ! aaron     122: .Nm
1.1       deraadt   123: is based on the last attribute specified.
1.7       millert   124: If the attribute is of type string or of type integer the exit
                    125: value is as follows:
1.8     ! aaron     126: .Pp
1.7       millert   127: .Bl -tag -offset indent -width Ds -compact
                    128: .It 0
                    129: The requested string was written successfully.
                    130: .It 2
                    131: Usage error.
                    132: .It 3
                    133: Unknown terminal type.
                    134: .It 4
                    135: Unknown attribute name.
                    136: .It >4
                    137: An error occurred.
                    138: .El
                    139: .Pp
1.1       deraadt   140: If the attribute is of type boolean,
1.8     ! aaron     141: .Nm
        !           142: exits with a value of 0 if the terminal has this attribute or
1.7       millert   143: 1 if it does not.
1.1       deraadt   144: .Sh EXAMPLES
1.7       millert   145: .Bl -tag -width "tput cup 6 11 dch 6" -compact
                    146: .It Li "tput clear cup 5 10"
1.1       deraadt   147: clear the screen and goto line 5 column 10
                    148: .Pp
1.7       millert   149: .It Li "tput cup 6 11 dch 6"
1.1       deraadt   150: goto line 6 column 11 and delete 6 characters
                    151: .Sh SEE ALSO
1.7       millert   152: .Xr terminfo 3 ,
                    153: .Xr terminfo 5
1.1       deraadt   154: .Sh BUGS
1.8     ! aaron     155: .Nm
1.1       deraadt   156: can't really distinguish between different types of attributes.
                    157: .Sh HISTORY
                    158: The
                    159: .Nm
1.8     ! aaron     160: utility appeared in
1.1       deraadt   161: .Bx 4.4 .