1TPUT(1P)                   POSIX Programmer's Manual                  TPUT(1P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       tput - change terminal characteristics
13

SYNOPSIS

15       tput [-T type] operand...
16

DESCRIPTION

18       The tput utility shall  display  terminal-dependent  information.   The
19       manner  in  which  this  information  is  retrieved is unspecified. The
20       information displayed shall clear the terminal screen,  initialize  the
21       user's terminal, or reset the user's terminal, depending on the operand
22       given. The  exact  consequences  of  displaying  this  information  are
23       unspecified.
24

OPTIONS

26       The  tput  utility  shall  conform  to  the  Base Definitions volume of
27       IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.
28
29       The following option shall be supported:
30
31       -T  type
32              Indicate the type of terminal. If this option  is  not  supplied
33              and  the  TERM variable is unset or null, an unspecified default
34              terminal type shall be used. The  setting  of  type  shall  take
35              precedence over the value in TERM.
36
37

OPERANDS

39       The following strings shall be supported as operands by the implementa‐
40       tion in the POSIX locale:
41
42       clear  Display the clear-screen sequence.
43
44       init   Display the sequence that initializes the user's terminal in  an
45              implementation-defined manner.
46
47       reset  Display  the  sequence  that  resets  the  user's terminal in an
48              implementation-defined manner.
49
50
51       If a terminal does not support any of the operations described by these
52       operands, this shall not be considered an error condition.
53

STDIN

55       Not used.
56

INPUT FILES

58       None.
59

ENVIRONMENT VARIABLES

61       The following environment variables shall affect the execution of tput:
62
63       LANG   Provide  a  default value for the internationalization variables
64              that are unset or null. (See  the  Base  Definitions  volume  of
65              IEEE Std 1003.1-2001,  Section  8.2,  Internationalization Vari‐
66              ables for the precedence of internationalization variables  used
67              to determine the values of locale categories.)
68
69       LC_ALL If  set  to a non-empty string value, override the values of all
70              the other internationalization variables.
71
72       LC_CTYPE
73              Determine the locale for  the  interpretation  of  sequences  of
74              bytes  of  text  data as characters (for example, single-byte as
75              opposed to multi-byte characters in arguments).
76
77       LC_MESSAGES
78              Determine the locale that should be used to  affect  the  format
79              and contents of diagnostic messages written to standard error.
80
81       NLSPATH
82              Determine the location of message catalogs for the processing of
83              LC_MESSAGES .
84
85       TERM   Determine the terminal type. If this variable is unset or  null,
86              and  if  the  -T option is not specified, an unspecified default
87              terminal type shall be used.
88
89

ASYNCHRONOUS EVENTS

91       Default.
92

STDOUT

94       If standard output is a terminal device, it may be used for writing the
95       appropriate  sequence  to  clear  the screen or reset or initialize the
96       terminal. If standard  output  is  not  a  terminal  device,  undefined
97       results occur.
98

STDERR

100       The standard error shall be used only for diagnostic messages.
101

OUTPUT FILES

103       None.
104

EXTENDED DESCRIPTION

106       None.
107

EXIT STATUS

109       The following exit values shall be returned:
110
111        0     The requested string was written successfully.
112
113        1     Unspecified.
114
115        2     Usage error.
116
117        3     No information is available about the specified terminal type.
118
119        4     The specified operand is invalid.
120
121       >4     An error occurred.
122
123

CONSEQUENCES OF ERRORS

125       If  one of the operands is not available for the terminal, tput contin‐
126       ues processing the remaining operands.
127
128       The following sections are informative.
129

APPLICATION USAGE

131       The difference between resetting and initializing a  terminal  is  left
132       unspecified, as they vary greatly based on hardware types.  In general,
133       resetting is a more severe action.
134
135       Some terminals use control characters to perform the stated  functions,
136       and on such terminals it might make sense to use tput to store the ini‐
137       tialization strings in a file or environment variable  for  later  use.
138       However,  because other terminals might rely on system calls to do this
139       work, the standard output cannot be used in a portable manner, such  as
140       the following non-portable constructs:
141
142
143              ClearVar=`tput clear`
144              tput reset | mailx -s "Wake Up" ddg
145

EXAMPLES

147        1. Initialize  the  terminal  according to the type of terminal in the
148           environmental variable TERM.  This command can  be  included  in  a
149           .profile file.
150
151
152           tput init
153
154        2. Reset a 450 terminal.
155
156
157           tput -T 450 reset
158

RATIONALE

160       The  list  of  operands was reduced to a minimum for the following rea‐
161       sons:
162
163        * The only features chosen were those that were likely to be  used  by
164          human users interacting with a terminal.
165
166        * Specifying  the  full terminfo set was not considered desirable, but
167          the standard developers did not want to select among operands.
168
169        * This volume of IEEE Std 1003.1-2001  does  not  attempt  to  provide
170          applications  with  sophisticated terminal handling capabilities, as
171          that falls outside of its assigned scope  and  intersects  with  the
172          responsibilities of other standards bodies.
173
174       The  difference  between  resetting and initializing a terminal is left
175       unspecified as this varies greatly based on hardware  types.   In  gen‐
176       eral, resetting is a more severe action.
177
178       The  exit  status  of  1  is historically reserved for finding out if a
179       Boolean operand is not set. Although the operands  were  reduced  to  a
180       minimum,  the exit status of 1 should still be reserved for the Boolean
181       operands, for those sites that wish to support them.
182

FUTURE DIRECTIONS

184       None.
185

SEE ALSO

187       stty, tabs
188
190       Portions of this text are reprinted and reproduced in  electronic  form
191       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
192       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
193       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
194       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
195       event of any discrepancy between this version and the original IEEE and
196       The Open Group Standard, the original IEEE and The Open Group  Standard
197       is  the  referee document. The original Standard can be obtained online
198       at http://www.opengroup.org/unix/online.html .
199
200
201
202IEEE/The Open Group                  2003                             TPUT(1P)
Impressum