Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/tput/tput.1
Show All 32 Lines | |||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm tput , | .Nm tput , | ||||
.Nm clear | .Nm clear | ||||
.Nd terminal capability interface | .Nd terminal capability interface | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Op Fl T Ar term | .Op Fl T Ar term | ||||
.Ar attribute ... | .Op Ar attribute ... | ||||
.Nm clear | .Nm clear | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
utility makes terminal-dependent information available to users or shell | utility makes terminal-dependent information available to users or shell | ||||
applications. | applications. | ||||
When invoked as the | .Pp | ||||
The | |||||
.Nm clear | .Nm clear | ||||
utility, the screen will be cleared as if | utility executes the | ||||
.Dl tput clear | .Dl tput clear | ||||
had been executed. | command, ignoring any arguments. | ||||
The options to | .Pp | ||||
The only option to | |||||
.Nm | .Nm | ||||
are as follows: | is: | ||||
.Bl -tag -width Ds | .Bl -tag -width 2n | ||||
.It Fl T | .It Fl T | ||||
The terminal name as specified in the | The terminal name as specified in the | ||||
.Xr termcap 5 | .Xr termcap 5 | ||||
database, for example, | database, for example, | ||||
.Dq vt100 | .Dq vt100 | ||||
or | or | ||||
.Dq xterm . | .Dq xterm . | ||||
If not specified, | If not specified, | ||||
.Nm | .Nm | ||||
retrieves the | retrieves the | ||||
.Dq Ev TERM | .Dq Ev TERM | ||||
variable from the environment. | variable from the environment unless that too is not specified, | ||||
in which case an error message will be sent to standard error and | |||||
the error status will be 2. | |||||
.El | .El | ||||
.Pp | .Pp | ||||
The | The | ||||
.Nm | .Nm | ||||
utility outputs a string for each | utility outputs a string for each | ||||
.Ar attribute | .Ar attribute | ||||
that is of type string; a number for each of type integer. | that is of type string; a number for each of type integer. | ||||
Otherwise, | Otherwise, | ||||
.Nm | .Nm | ||||
exits 0 if the terminal has the capability and 1 if it does not, | exits 0 if the terminal has the capability and 1 if it does not, | ||||
without further action. | without further action. | ||||
.Pp | .Pp | ||||
If an | If an | ||||
.Ar attribute | .Ar attribute | ||||
is of type string, and takes arguments (e.g.\& cursor movement, | is of type string, and takes arguments (e.g.\& cursor movement, | ||||
the termcap | the termcap | ||||
.Dq cm | .Dq cm | ||||
sequence) the arguments are taken from the command line immediately | capability) the arguments are taken from the command line immediately | ||||
following the attribute. | following the attribute. | ||||
.Pp | .Pp | ||||
The following special attributes are available: | The following special attributes are available. | ||||
The first three use the capabilities of the specified terminal, | |||||
and only work if compatible with the utility's terminal. | |||||
.Bl -tag -width Ar | .Bl -tag -width Ar | ||||
.It Cm clear | .It Cm clear | ||||
Clear the screen (the | Clear the screen (the | ||||
.Xr termcap 5 | .Xr termcap 5 | ||||
.Dq cl | .Dq cl | ||||
sequence). | capability). | ||||
.It Cm init | .It Cm init | ||||
Initialize the terminal (the | Initialize the terminal (the | ||||
.Xr termcap 5 | .Xr termcap 5 | ||||
.Dq is | .Dq is | ||||
sequence). | capability). | ||||
.It Cm longname | |||||
Print the descriptive name of the user's terminal type. | |||||
.It Cm reset | .It Cm reset | ||||
Reset the terminal (the | Reset the terminal (the | ||||
.Xr termcap 5 | .Xr termcap 5 | ||||
.Dq rs | .Dq rs | ||||
sequence). | capability). | ||||
.It Cm longname | |||||
Print the descriptive name of the user's terminal type. | |||||
.El | .El | ||||
.Sh ENVIRONMENT | |||||
.Bl -tag -width ".Ev TERM" | |||||
.It Ev TERM | |||||
The terminal name, if set and | |||||
.Fl T | |||||
is not used. | |||||
.El | |||||
.Sh EXIT STATUS | .Sh EXIT STATUS | ||||
The exit status of | The exit status of | ||||
.Nm | .Nm | ||||
is as follows: | is as follows: | ||||
.Bl -tag -width indent | .Bl -tag -width indent | ||||
.It 0 | .It 0 | ||||
If the last attribute | If the last | ||||
.Ar attribute | .Ar attribute | ||||
argument is of type string or integer, its value was successfully written | is of type string or integer, its value was successfully written | ||||
to standard output. | to standard output. | ||||
If the argument is of type boolean, the terminal has this attribute. | If the | ||||
.Ar attribute | |||||
is of type boolean, the terminal does have the | |||||
.Ar attribute . | |||||
Otherwise, no | |||||
.Ar attribute | |||||
was specified. | |||||
.It 1 | .It 1 | ||||
This terminal does not have the specified boolean | If the last | ||||
.Ar attribute | |||||
is of type boolean, | |||||
this terminal does not have the | |||||
.Ar attribute . | .Ar attribute . | ||||
.It 2 | .It 2 | ||||
Usage error. | Usage error. | ||||
For example, see | |||||
.Fl T | |||||
description. | |||||
.It 3 | .It 3 | ||||
No information is available about the specified terminal type. | No information is available about the specified terminal type. | ||||
.El | .El | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr termcap 5 , | .Xr termcap 5 , | ||||
.Xr terminfo 5 | .Xr terminfo 5 | ||||
.Sh STANDARDS | .Sh STANDARDS | ||||
The | The | ||||
Show All 22 Lines |