version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
tput |
|
|
2 |
!!!tput |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
EXAMPLES |
|
|
7 |
FILES |
|
|
8 |
SEE ALSO |
|
|
9 |
EXIT CODES |
|
|
10 |
DIAGNOSTICS |
|
|
11 |
PORTABILITY |
|
|
12 |
---- |
|
|
13 |
!!NAME |
|
|
14 |
|
|
|
15 |
|
|
|
16 |
__tput__, __reset__ - initialize a terminal or query terminfo database |
|
|
17 |
!!SYNOPSIS |
|
|
18 |
|
|
|
19 |
|
|
|
20 |
__tput__ [[__-T__''type''] ''capname'' |
|
|
21 |
[[''parms'' ... ]__ |
|
|
22 |
tput__ [[__-T__''type''] __init |
|
|
23 |
tput__ [[__-T__''type''] __reset |
|
|
24 |
tput__ [[__-T__''type''] __longname |
|
|
25 |
tput -S |
|
|
26 |
tput -V__ |
|
|
27 |
!!DESCRIPTION |
|
|
28 |
|
|
|
29 |
|
|
|
30 |
The __tput__ utility uses the __terminfo__ database to |
|
|
31 |
make the values of terminal-dependent capabilities and |
|
|
32 |
information available to the shell (see sh(1)), to |
|
|
33 |
initialize or reset the terminal, or return the long name of |
|
|
34 |
the requested terminal type. __tput__ outputs a string if |
|
|
35 |
the attribute (''cap''ability ''name'') is of type |
|
|
36 |
string, or an integer if the attribute is of type integer. |
|
|
37 |
If the attribute is of type boolean, __tput__ simply sets |
|
|
38 |
the exit code (__0__ for TRUE if the terminal has the |
|
|
39 |
capability, __1__ for FALSE if it does not), and produces |
|
|
40 |
no output. Before using a value returned on standard output, |
|
|
41 |
the user should test the exit code [[__$?__, see |
|
|
42 |
sh(1)] to be sure it is __0__. (See the __EXIT |
|
|
43 |
CODES__ and __DIAGNOSTICS__ sections.) For a complete |
|
|
44 |
list of capabilities and the ''capname'' associated with |
|
|
45 |
each, see terminfo(5). |
|
|
46 |
|
|
|
47 |
|
|
|
48 |
__-T__''type'' |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
indicates the ''type'' of terminal. Normally this option |
|
|
52 |
is unnecessary, because the default is taken from the |
|
|
53 |
environment variable __TERM__. If __-T__ is specified, |
|
|
54 |
then the shell variables __LINES__ and __COLUMNS__ |
|
|
55 |
will be ignored,and the operating system will not be queried |
|
|
56 |
for the actual screen size. |
|
|
57 |
|
|
|
58 |
|
|
|
59 |
''capname'' |
|
|
60 |
|
|
|
61 |
|
|
|
62 |
indicates the attribute from the __terminfo__ database. |
|
|
63 |
When __termcap__ support is compiled in, the |
|
|
64 |
__termcap__ name for the attribute is also |
|
|
65 |
accepted. |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
''parms'' |
|
|
69 |
|
|
|
70 |
|
|
|
71 |
If the attribute is a string that takes parameters, the |
|
|
72 |
arguments ''parms'' will be instantiated into the string. |
|
|
73 |
An all numeric argument will be passed to the attribute as a |
|
|
74 |
number. |
|
|
75 |
|
|
|
76 |
|
|
|
77 |
__-S__ |
|
|
78 |
|
|
|
79 |
|
|
|
80 |
allows more than one capability per invocation of |
|
|
81 |
__tput__. The capabilities must be passed to __tput__ |
|
|
82 |
from the standard input instead of from the command line |
|
|
83 |
(see example). Only one ''capname'' is allowed per line. |
|
|
84 |
The __-S__ option changes the meaning of the __0__ and |
|
|
85 |
__1__ boolean and string exit codes (see the EXIT CODES |
|
|
86 |
section). |
|
|
87 |
|
|
|
88 |
|
|
|
89 |
__-V__ |
|
|
90 |
|
|
|
91 |
|
|
|
92 |
reports the version of ncurses which was used in this |
|
|
93 |
program, and exits. |
|
|
94 |
|
|
|
95 |
|
|
|
96 |
__init__ |
|
|
97 |
|
|
|
98 |
|
|
|
99 |
If the __terminfo__ database is present and an entry for |
|
|
100 |
the user's terminal exists (see __-T__''type'', |
|
|
101 |
above), the following will occur: (1) if present, the |
|
|
102 |
terminal's initialization strings will be output |
|
|
103 |
(__is1__, __is2__, __is3__, __if__, |
|
|
104 |
__iprog__), (2) any delays (e.g., newline) specified in |
|
|
105 |
the entry will be set in the tty driver, (3) tabs expansion |
|
|
106 |
will be turned on or off according to the specification in |
|
|
107 |
the entry, and (4) if tabs are not expanded, standard tabs |
|
|
108 |
will be set (every 8 spaces). If an entry does not contain |
|
|
109 |
the information needed for any of the four above activities, |
|
|
110 |
that activity will silently be skipped. |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
__reset__ |
|
|
114 |
|
|
|
115 |
|
|
|
116 |
Instead of putting out initialization strings, the |
|
|
117 |
terminal's reset strings will be output if present |
|
|
118 |
(__rs1__, __rs2__, __rs3__, __rf__). If the |
|
|
119 |
reset strings are not present, but initialization strings |
|
|
120 |
are, the initialization strings will be output. Otherwise, |
|
|
121 |
__reset__ acts identically to __init__. |
|
|
122 |
|
|
|
123 |
|
|
|
124 |
__longname__ |
|
|
125 |
|
|
|
126 |
|
|
|
127 |
If the __terminfo__ database is present and an entry for |
|
|
128 |
the user's terminal exists (see __-T__''type'' above), |
|
|
129 |
then the long name of the terminal will be put out. The long |
|
|
130 |
name is the last name in the first line of the terminal's |
|
|
131 |
description in the __terminfo__ database [[see |
|
|
132 |
term(5)]. |
|
|
133 |
|
|
|
134 |
|
|
|
135 |
If __tput__ is invoked by a link named __reset__, this |
|
|
136 |
has the same effect as __tput reset__. See __tset__ |
|
|
137 |
for comparison, which has similar behavior. |
|
|
138 |
!!EXAMPLES |
|
|
139 |
|
|
|
140 |
|
|
|
141 |
__tput init__ |
|
|
142 |
|
|
|
143 |
|
|
|
144 |
Initialize the terminal according to the type of terminal in |
|
|
145 |
the environmental variable __TERM__. This command should |
|
|
146 |
be included in everyone's .profile after the environmental |
|
|
147 |
variable __TERM__ has been exported, as illustrated on |
|
|
148 |
the profile(4) manual page. |
|
|
149 |
|
|
|
150 |
|
|
|
151 |
__tput -T5620 reset__ |
|
|
152 |
|
|
|
153 |
|
|
|
154 |
Reset an AT |
|
|
155 |
TERM__. |
|
|
156 |
|
|
|
157 |
|
|
|
158 |
__tput cup 0 0__ |
|
|
159 |
|
|
|
160 |
|
|
|
161 |
Send the sequence to move the cursor to row __0__, column |
|
|
162 |
__0__ (the upper left corner of the screen, usually known |
|
|
163 |
as the __ |
|
|
164 |
|
|
|
165 |
|
|
|
166 |
__tput clear__ |
|
|
167 |
|
|
|
168 |
|
|
|
169 |
Echo the clear-screen sequence for the current |
|
|
170 |
terminal. |
|
|
171 |
|
|
|
172 |
|
|
|
173 |
__tput cols__ |
|
|
174 |
|
|
|
175 |
|
|
|
176 |
Print the number of columns for the current |
|
|
177 |
terminal. |
|
|
178 |
|
|
|
179 |
|
|
|
180 |
__tput -T450 cols__ |
|
|
181 |
|
|
|
182 |
|
|
|
183 |
Print the number of columns for the 450 |
|
|
184 |
terminal. |
|
|
185 |
|
|
|
186 |
|
|
|
187 |
__bold=`tput smso` offbold=`tput rmso`__ |
|
|
188 |
|
|
|
189 |
|
|
|
190 |
Set the shell variables __bold__, to begin stand-out mode |
|
|
191 |
sequence, and __offbold__, to end standout mode sequence, |
|
|
192 |
for the current terminal. This might be followed by a |
|
|
193 |
prompt: __echo |
|
|
194 |
__ |
|
|
195 |
|
|
|
196 |
|
|
|
197 |
__tput hc__ |
|
|
198 |
|
|
|
199 |
|
|
|
200 |
Set exit code to indicate if the current terminal is a hard |
|
|
201 |
copy terminal. |
|
|
202 |
|
|
|
203 |
|
|
|
204 |
__tput cup 23 4__ |
|
|
205 |
|
|
|
206 |
|
|
|
207 |
Send the sequence to move the cursor to row 23, column |
|
|
208 |
4. |
|
|
209 |
|
|
|
210 |
|
|
|
211 |
__tput longname__ |
|
|
212 |
|
|
|
213 |
|
|
|
214 |
Print the long name from the __terminfo__ database for |
|
|
215 |
the type of terminal specified in the environmental variable |
|
|
216 |
__TERM__. |
|
|
217 |
|
|
|
218 |
|
|
|
219 |
__tput -S __ |
|
|
220 |
__ |
|
|
221 |
__ |
|
|
222 |
__ |
|
|
223 |
__ |
|
|
224 |
|
|
|
225 |
|
|
|
226 |
This example shows tput processing several capabilities in |
|
|
227 |
one invocation. This example clears the screen, moves the |
|
|
228 |
cursor to position 10, 10 and turns on bold (extra bright) |
|
|
229 |
mode. The list is terminated by an exclamation mark |
|
|
230 |
(__!__) on a line by itself. |
|
|
231 |
!!FILES |
|
|
232 |
|
|
|
233 |
|
|
|
234 |
__/usr/share/terminfo__ |
|
|
235 |
|
|
|
236 |
|
|
|
237 |
compiled terminal description database |
|
|
238 |
|
|
|
239 |
|
|
|
240 |
__/usr/include/curses.h__ |
|
|
241 |
|
|
|
242 |
|
|
|
243 |
__curses__(3X) header file |
|
|
244 |
|
|
|
245 |
|
|
|
246 |
__/usr/include/term.h__ |
|
|
247 |
|
|
|
248 |
|
|
|
249 |
__terminfo__ header file |
|
|
250 |
|
|
|
251 |
|
|
|
252 |
__/usr/share/tabset/*__ |
|
|
253 |
|
|
|
254 |
|
|
|
255 |
tab settings for some terminals, in a format appropriate to |
|
|
256 |
be output to the terminal (escape sequences that set margins |
|
|
257 |
and tabs); for more information, see the |
|
|
258 |
terminfo__(4) |
|
|
259 |
!!SEE ALSO |
|
|
260 |
|
|
|
261 |
|
|
|
262 |
clear(1), stty(1), tabs(5). |
|
|
263 |
profile(5), terminfo(4) in the ''System |
|
|
264 |
Administrator'''''s Reference Manual''. Chapter 10 of |
|
|
265 |
the ''Programmer'''''s Guide''. |
|
|
266 |
!!EXIT CODES |
|
|
267 |
|
|
|
268 |
|
|
|
269 |
If ''capname'' is of type boolean, a value of __0__ is |
|
|
270 |
set for TRUE and __1__ for FALSE unless the __-S__ |
|
|
271 |
option is used. |
|
|
272 |
|
|
|
273 |
|
|
|
274 |
If ''capname'' is of type string, a value of __0__ is |
|
|
275 |
set if the ''capname'' is defined for this terminal |
|
|
276 |
''type'' (the value of ''capname'' is returned on |
|
|
277 |
standard output); a value of __1__ is set if |
|
|
278 |
''capname'' is not defined for this terminal ''type'' |
|
|
279 |
(a null value is returned on standard output). |
|
|
280 |
|
|
|
281 |
|
|
|
282 |
If ''capname'' is of type boolean or string and the |
|
|
283 |
__-S__ option is used, a value of __0__ is returned to |
|
|
284 |
indicate that all lines were successful. No indication of |
|
|
285 |
which line failed can be given so exit code __1__ will |
|
|
286 |
never appear. Exit codes __2__, __3__, and __4__ |
|
|
287 |
retain their usual interpretation. |
|
|
288 |
|
|
|
289 |
|
|
|
290 |
If ''capname'' is of type integer, a value of __0__ is |
|
|
291 |
always set, whether or not ''capname'' is defined for |
|
|
292 |
this terminal ''type''. To determine if ''capname'' is |
|
|
293 |
defined for this terminal ''type'', the user must test |
|
|
294 |
the value of standard output. A value of __-1__ means |
|
|
295 |
that ''capname'' is not defined for this terminal |
|
|
296 |
''type''. |
|
|
297 |
|
|
|
298 |
|
|
|
299 |
Any other exit code indicates an error; see the DIAGNOSTICS |
|
|
300 |
section. |
|
|
301 |
!!DIAGNOSTICS |
|
|
302 |
|
|
|
303 |
|
|
|
304 |
__tput__ prints the following error messages and sets the |
|
|
305 |
corresponding exit codes. |
|
|
306 |
!!PORTABILITY |
|
|
307 |
|
|
|
308 |
|
|
|
309 |
The __longname__ and __-S__ options, and the parameter-substitution features used in the __cup__ example, are not supported in BSD curses or in AT__ |
|
|
310 |
---- |