Manual page for TPUT(1V)
tput - initialize a terminal or query the terminfo database
SYNOPSIS
/usr/5bin/tput
[
-Ttype
]
capability
[
parameter
... ]
/usr/5bin/tput
[
-Ttype
]
init
/usr/5bin/tput
[
-Ttype
]
longname
/usr/5bin/tput
[
-Ttype
]
reset
AVAILABILITY
This command is available with the
System V
software installation option. Refer to
[a manual with the abbreviation INSTALL]
for information on how to install optional software.
DESCRIPTION
tput
uses the
terminfo.5v
database to make the values of
terminal-dependent capabilities and information available to
the shell, to initialize or reset the terminal,
or return the long name of the requested terminal type.
Normally, the terminal type is taken from the environment variable
TERM;
if the
-Ttype
option is specified, the terminal type is taken from that option.
tput
displays a string if the given
capability
is a string capability, or an integer if it is an integer
capability; it displays no output if the capability is
a boolean.
If
capability
is a boolean,
tput
returns true (0) if that capability is set, or false (1) otherwise.
If
capability
is a string,
tput
returns true (0)
if that capability is set, or false (1) otherwise.
If
capability
is an integer, a value of true (0) is returned
whether or not
the capability is set for the terminal. To determine if an integer
capability is set, you must examine the standard output.
For a complete list of capabilities and the
capability
associated with each, see
terminfo.5v
If
capability
is a string capability that takes parameters, the
parameter
arguments
are instantiated into the string.
An all-numeric
parameter
argument is passed to the attribute as a number.
OPTIONS
- -Ttype
-
Indicate the
type
of terminal.
If this option is supplied, the environment variables
LINES
and
COLUMNS
are not used.
- init
-
If the
terminfo
database is present and an entry for the user's terminal
exists, emit the terminal's initialization strings,
set up any delays specified, and turn the expansion of
TAB
characters on or off, as specified by the terminal's entry in the
terminfo
database. If the terminal has a
TAB
character, and either has a capability for setting
TAB
characters or initially has its
TAB
characters set every 8
SPACE
characters, expansion of
TAB
characters is turned off, otherwise expansion of
TAB
characters is turned on.
If expansion of
TAB
characters is turned on, and the terminal has a capability for setting
TAB
characters,
TAB
stops are set to every eight
columns.
If an entry does not contain the information
needed for any of these actions,
that action is silently skipped.
- reset
-
Emit the terminal's reset strings, and set up delays and
TAB
characters as specified.
If the reset strings are not present,
but initialization strings are, the initialization
strings are used.
- longname
-
If the
terminfo
database is present and an entry for the user's
terminal exists, emit the long name of the terminal.
The long name is the last name in the first line of
the terminal's description in the
terminfo
database.
EXIT CODES
- 0
-
The boolean or string capability is set, or the capability is
an integer type and is present.
- 1
-
The
capability
is not set.
- 2
-
Usage error.
- 3
-
The terminal is of an unknown type, or the
terminfo
database is not present.
- 4
-
Unknown
terminfo
capability.
- -1
-
The integer capability is not defined for this terminal type.
EXAMPLES
- tput init
-
Initialize the terminal according to the
type of terminal in the environmental variable
TERM.
This command can be included in a
.profile
or
.login
file.
- tput -Tsun reset
-
Reset a Sun workstation console,
shelltool.1
window, or
cmdtool.1
window, overriding the type of terminal in the environmental variable
TERM.
- tput cup 0 0
-
Send the sequence to move the cursor to row
0,
column
0
(the upper left corner of the screen,
usually known as the ``home'' cursor position).
- tput clear
-
Echo the clear-screen sequence for the current terminal.
- tput cols
-
Print the number of columns for the current terminal.
- tput -Tsun cols
-
Print the number of columns for the Sun workstation console or subwindow.
- bold=`tput smso`
-
- offbold=`tput rmso`
-
Set the shell variables
bold,
to begin stand-out mode sequence,
and
offbold,
to end standout mode sequence,
for the current terminal.
This might be followed by a prompt:
-
echo "${bold}Please type in your name: ${offbold}\c"
- tput hc
-
Set exit code to indicate if the current terminal is a hardcopy terminal.
- tput cup 23 4
-
Send the sequence to move the cursor to row 23, column 4.
- tput longname
-
Print the long name from the
terminfo
database for the type of terminal
specified in the environmental variable
TERM.
FILES
- /usr/share/lib/terminfo/?/*
-
compiled terminal description database
- /usr/5include/curses.h
-
curses.3v
header file
- /usr/5include/term.h
-
terminfo.5v
header file
- /usr/share/lib/tabset/*
-
TAB
settings for some terminals, in a format appropriate to be
output to the terminal (escape sequences that set margins and
TAB
characters);
for more information, see the
Tabs and Initialization
section of
terminfo.5v
- .login
-
- .profile
-
SEE ALSO
cmdtool.1
shelltool.1
stty.1v
curses.3v
terminfo.5v
Created by unroff & hp-tools.
© somebody (See intro for details). All Rights Reserved.
Last modified 11/5/97