xref: /netbsd-src/usr.bin/tput/tput.1 (revision 258cf0abec6176a66ff8bb40edc3c05bb0245ffe)
1*258cf0abSroy.\"	$NetBSD: tput.1,v 1.16 2012/04/21 12:27:30 roy Exp $
2fce6632bSjtc.\"
3fce6632bSjtc.\" Copyright (c) 1989, 1990, 1993
4fce6632bSjtc.\"	The Regents of the University of California.  All rights reserved.
561f28255Scgd.\"
661f28255Scgd.\" Redistribution and use in source and binary forms, with or without
761f28255Scgd.\" modification, are permitted provided that the following conditions
861f28255Scgd.\" are met:
961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright
1061f28255Scgd.\"    notice, this list of conditions and the following disclaimer.
1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright
1261f28255Scgd.\"    notice, this list of conditions and the following disclaimer in the
1361f28255Scgd.\"    documentation and/or other materials provided with the distribution.
1489aaa1bbSagc.\" 3. Neither the name of the University nor the names of its contributors
1561f28255Scgd.\"    may be used to endorse or promote products derived from this software
1661f28255Scgd.\"    without specific prior written permission.
1761f28255Scgd.\"
1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2161f28255Scgd.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2861f28255Scgd.\" SUCH DAMAGE.
2961f28255Scgd.\"
30fce6632bSjtc.\"     @(#)tput.1	8.2 (Berkeley) 3/19/94
3161f28255Scgd.\"
32*258cf0abSroy.Dd April 5, 2012
3361f28255Scgd.Dt TPUT 1
349e44e9b5Sgarbled.Os
3561f28255Scgd.Sh NAME
369f84449aSmrg.Nm tput ,
379f84449aSmrg.Nm clear
3861f28255Scgd.Nd terminal capability interface
3961f28255Scgd.Sh SYNOPSIS
40a04cd750Slukem.Nm
4161f28255Scgd.Op Fl T Ar term
4261f28255Scgd.Ar attribute
430bdc4d87Scgd.Op Ar attribute-args
440bdc4d87Scgd.Ar ...
4561f28255Scgd.Sh DESCRIPTION
46a04cd750Slukem.Nm
4761f28255Scgdmakes terminal-dependent information available to users or shell
4861f28255Scgdapplications.
4961f28255ScgdThe options are as follows:
5061f28255Scgd.Bl -tag -width Ds
5161f28255Scgd.It Fl T
5261f28255ScgdThe terminal name as specified in the
5398eb8895Sroy.Xr terminfo 5
546060525dSwizdatabase, for example,
556060525dSwiz.Dq vt100
566060525dSwizor
576060525dSwiz.Dq xterm .
5861f28255ScgdIf not specified,
59a04cd750Slukem.Nm
6061f28255Scgdretrieves the
6161f28255Scgd.Dq Ev TERM
6261f28255Scgdvariable from the environment.
6361f28255Scgd.El
6461f28255Scgd.Pp
65a04cd750Slukem.Nm
6661f28255Scgdoutputs a string if the
6761f28255Scgd.Ar attribute
6861f28255Scgdis of type string; a number if it is of type integer.
6961f28255ScgdOtherwise,
70a04cd750Slukem.Nm
7161f28255Scgdexits 0 if the terminal has the capability and 1 if it does not,
7261f28255Scgdwithout further action.
7361f28255Scgd.Pp
74fce6632bSjtcIf the
75fce6632bSjtc.Ar attribute
76fce6632bSjtcis of type string, and takes arguments (e.g. cursor movement,
7798eb8895Sroythe terminfo
7898eb8895Sroy.Dq cup
79fce6632bSjtcsequence) the arguments are taken from the command line immediately
80fce6632bSjtcfollowing the attribute.
810bdc4d87Scgd.Pp
8261f28255ScgdThe following special attributes are available:
8361f28255Scgd.Bl -tag -width Ar
84fce6632bSjtc.It clear
8561f28255ScgdClear the screen (the
8698eb8895Sroy.Xr terminfo 5
876060525dSwiz.Dq cl
886060525dSwizsequence).
89fce6632bSjtc.It init
9061f28255ScgdInitialize the terminal (the
9198eb8895Sroy.Xr terminfo 5
9298eb8895Sroy.Dq is2
936060525dSwizsequence).
94fce6632bSjtc.It longname
9561f28255ScgdPrint the descriptive name of the user's terminal type.
96fce6632bSjtc.It reset
9761f28255ScgdReset the terminal (the
9898eb8895Sroy.Xr terminfo 5
9998eb8895Sroy.Dq rs1 , rs2 , rs3
10098eb8895Sroyand
10198eb8895Sroy.Dq rf
1026060525dSwizsequence).
103607173c8Sross.El
1044918722aSkleink.Sh EXIT STATUS
1054918722aSkleinkThe exit status of
106a04cd750Slukem.Nm
10761f28255Scgdis based on the last attribute specified.
10861f28255ScgdIf the attribute is of type string or of type integer,
109a04cd750Slukem.Nm
11061f28255Scgdexits 0 if the attribute is defined for this terminal type and 1
11161f28255Scgdif it is not.
11261f28255ScgdIf the attribute is of type boolean,
113a04cd750Slukem.Nm
11461f28255Scgdexits 0 if the terminal has this attribute, and 1 if it does not.
115a04cd750Slukem.Nm
11661f28255Scgdexits 2 if any error occurred.
1170bdc4d87Scgd.Sh EXAMPLES
1180bdc4d87Scgd.Bl -tag -width "tput cm 6 11 DC 6" -compact
1190bdc4d87Scgd.It Li "tput cl cm 5 10"
1200bdc4d87Scgdclear the screen and goto line 5 column 10
1210bdc4d87Scgd.Pp
1220bdc4d87Scgd.It Li "tput cm 6 11 DC 6"
1230bdc4d87Scgdgoto line 6 column 11 and delete 6 characters
124607173c8Sross.El
12561f28255Scgd.Sh SEE ALSO
12661f28255Scgd.Xr termcap 3 ,
127*258cf0abSroy.Xr terminfo 3 ,
128*258cf0abSroy.Xr terminfo 5
12961f28255Scgd.Sh HISTORY
13061f28255ScgdThe
13161f28255Scgd.Nm
132fce6632bSjtccommand appears in
133fce6632bSjtc.Bx 4.4 .
134ba63bbaaSwiz.Sh BUGS
135ba63bbaaSwiz.Nm
136ba63bbaaSwizcan't really distinguish between different types of attributes.
137a775b201Sjdc.Pp
13898eb8895SroyNot all terminfo entries contain the reset sequence, so using the init
139a775b201Sjdcsequence may be more useful.
140