]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/tput.1
ncurses 6.4 - patch 20231217
[ncurses.git] / man / tput.1
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright 2018-2022,2023 Thomas E. Dickey                                *
4 .\" Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
5 .\"                                                                          *
6 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
7 .\" copy of this software and associated documentation files (the            *
8 .\" "Software"), to deal in the Software without restriction, including      *
9 .\" without limitation the rights to use, copy, modify, merge, publish,      *
10 .\" distribute, distribute with modifications, sublicense, and/or sell       *
11 .\" copies of the Software, and to permit persons to whom the Software is    *
12 .\" furnished to do so, subject to the following conditions:                 *
13 .\"                                                                          *
14 .\" The above copyright notice and this permission notice shall be included  *
15 .\" in all copies or substantial portions of the Software.                   *
16 .\"                                                                          *
17 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
18 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
19 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
20 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
21 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
22 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
23 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
24 .\"                                                                          *
25 .\" Except as contained in this notice, the name(s) of the above copyright   *
26 .\" holders shall not be used in advertising or otherwise to promote the     *
27 .\" sale, use or other dealings in this Software without prior written       *
28 .\" authorization.                                                           *
29 .\"***************************************************************************
30 .\"
31 .\" $Id: tput.1,v 1.92 2023/12/16 20:32:22 tom Exp $
32 .TH @TPUT@ 1 2023-12-16 "ncurses 6.4" "User commands"
33 .ie \n(.g \{\
34 .ds `` \(lq
35 .ds '' \(rq
36 .\}
37 .el \{\
38 .ie t .ds `` ``
39 .el   .ds `` ""
40 .ie t .ds '' ''
41 .el   .ds '' ""
42 .\}
43 .
44 .de bP
45 .ie n  .IP \(bu 4
46 .el    .IP \(bu 2
47 ..
48 .ds d @TERMINFO@
49 .SH NAME
50 \fB\%@TPUT@\fP,
51 \fB\%reset\fP \-
52 initialize a terminal or query \fIterminfo\fR database
53 .SH SYNOPSIS
54 \fB@TPUT@\fR [\fB\-T \fIterminal-type\fR] \fIcapname\fR [\fIparameters\fR]
55 .br
56 \fB@TPUT@\fR [\fB\-T \fIterminal-type\fR] [\fB\-x\fR] \fBclear\fR
57 .br
58 \fB@TPUT@\fR [\fB\-T \fIterminal-type\fR] \fBinit\fR
59 .br
60 \fB@TPUT@\fR [\fB\-T \fIterminal-type\fR] \fBreset\fR
61 .br
62 \fB@TPUT@\fR [\fB\-T \fIterminal-type\fR] \fBlongname\fR
63 .br
64 \fB@TPUT@ \-S\fP  \fB<<\fP
65 .br
66 \fB@TPUT@ \-V\fP
67 .SH DESCRIPTION
68 The \fB@TPUT@\fP utility uses the \fBterminfo\fP database to make the
69 values of terminal-dependent capabilities and information available to
70 the shell (see \fBsh\fP(1)), to initialize or reset the terminal, or
71 return the long name of the requested terminal type.
72 The result depends upon the capability's type:
73 .RS 3
74 .TP 5
75 string
76 \fB@TPUT@\fP writes the string to the standard output.
77 No trailing newline is supplied.
78 .TP
79 integer
80 \fB@TPUT@\fP writes the decimal value to the standard output,
81 with a trailing newline.
82 .TP
83 boolean
84 \fB@TPUT@\fP simply sets the exit code
85 (\fB0\fP for TRUE if the terminal has the capability,
86 \fB1\fP for FALSE if it does not),
87 and writes nothing to the standard output.
88 .RE
89 .PP
90 Before using a value returned on the standard output,
91 the application should test the exit code
92 (e.g., \fB$?\fP, see \fBsh\fP(1)) to be sure it is \fB0\fP.
93 (See the \fBEXIT STATUS\fP and \fBDIAGNOSTICS\fP sections.)
94 For a complete list of capabilities
95 and the \fIcapname\fP associated with each, see \fBterminfo\fP(5).
96 .SS Options
97 .TP
98 \fB\-S\fP
99 allows more than one capability per invocation of \fB@TPUT@\fP.  The
100 capabilities must be passed to \fB@TPUT@\fP from the standard input
101 instead of from the command line (see example).
102 Only one \fIcapname\fP is allowed per line.
103 The \fB\-S\fP option changes the
104 meaning of the \fB0\fP and \fB1\fP boolean and string exit codes (see the
105 EXIT STATUS section).
106 .IP
107 Because some capabilities may use
108 \fIstring\fP parameters rather than \fInumbers\fP,
109 \fB@TPUT@\fP uses a table and the presence of parameters in its input
110 to decide whether to use \fBtparm\fP(3X),
111 and how to interpret the parameters.
112 .TP
113 \fB\-T\fItype\fR
114 indicates the \fItype\fP of terminal.
115 Normally this option is
116 unnecessary, because the default is taken from the environment
117 variable \fITERM\fP.
118 If \fB\-T\fP is specified, then the shell
119 variables \fILINES\fP and \fI\%COLUMNS\fP will also be ignored.
120 .TP
121 \fB\-V\fP
122 reports the version of \fI\%ncurses\fP which was used in this program,
123 and exits.
124 .TP
125 .B \-x
126 prevents \fB\%@TPUT@\fP from attempting to clear the scrollback buffer.
127 .SS Commands
128 A few commands (\fBinit\fP, \fBreset\fP and \fBlongname\fP) are
129 special; they are defined by the \fB@TPUT@\fP program.
130 The others are the names of \fIcapabilities\fP from the terminal database
131 (see \fBterminfo\fP(5) for a list).
132 Although \fBinit\fP and \fBreset\fP resemble capability names,
133 \fB@TPUT@\fP uses several capabilities to perform these special functions.
134 .TP
135 \fIcapname\fP
136 indicates the capability from the terminal database.
137 .IP
138 If the capability is a string that takes parameters, the arguments
139 following the capability will be used as parameters for the string.
140 .IP
141 Most parameters are numbers.
142 Only a few terminal capabilities require string parameters;
143 \fB@TPUT@\fP uses a table to decide which to pass as strings.
144 Normally \fB@TPUT@\fP uses \fBtparm\fP(3X) to perform the substitution.
145 If no parameters are given for the capability,
146 \fB@TPUT@\fP writes the string without performing the substitution.
147 .TP
148 \fBinit\fP
149 If the terminal database is present and an entry for the user's
150 terminal exists (see \fB\-T\fItype\fR, above), the following will
151 occur:
152 .RS
153 .TP 5
154 (1)
155 first, \fB@TPUT@\fP retrieves the current terminal mode settings
156 for your terminal.
157 It does this by successively testing
158 .RS
159 .bP
160 the standard error,
161 .bP
162 standard output,
163 .bP
164 standard input and
165 .bP
166 ultimately \*(``/dev/tty\*(''
167 .RE
168 .IP
169 to obtain terminal settings.
170 Having retrieved these settings, \fB@TPUT@\fP remembers which
171 file descriptor to use when updating settings.
172 .TP
173 (2)
174 if the window size cannot be obtained from the operating system,
175 but the terminal description
176 (or environment,
177 e.g.,
178 \fILINES\fP and \fI\%COLUMNS\fP variables specify this),
179 update the operating system's notion of the window size.
180 .TP
181 (3)
182 the terminal modes will be updated:
183 .RS
184 .bP
185 any delays (e.g., newline) specified in the entry will
186 be set in the tty driver,
187 .bP
188 tabs expansion will be turned on or off according to
189 the specification in the entry, and
190 .bP
191 if tabs are not expanded,
192 standard tabs will be set (every 8 spaces).
193 .RE
194 .TP
195 (4)
196 if present, the terminal's initialization strings will be
197 output as detailed in the \fBterminfo\fP(5) section on
198 .IR "Tabs and Initialization" ,
199 .TP
200 (5)
201 output is flushed.
202 .RE
203 .IP
204 If an entry does not
205 contain the information needed for any of these activities,
206 that activity will silently be skipped.
207 .TP
208 \fBreset\fP
209 This is similar to \fBinit\fP, with two differences:
210 .RS
211 .TP 5
212 (1)
213 before any other initialization,
214 the terminal modes will be reset to a \*(``sane\*('' state:
215 .RS
216 .bP
217 set cooked and echo modes,
218 .bP
219 turn off cbreak and raw modes,
220 .bP
221 turn on newline translation and
222 .bP
223 reset any unset special characters to their default values
224 .RE
225 .TP 5
226 (2)
227 Instead of putting out \fIinitialization\fP strings, the terminal's
228 \fIreset\fP strings will be output if present
229 (\fBrs1\fP, \fBrs2\fP, \fBrs3\fP, \fBrf\fP).
230 If the \fIreset\fP strings are not present, but \fIinitialization\fP
231 strings are, the \fIinitialization\fP strings will be output.
232 .RE
233 .IP
234 Otherwise, \fBreset\fP acts identically to \fBinit\fP.
235 .TP
236 \fBlongname\fP
237 If the terminal database is present and an entry for the
238 user's terminal exists (see \fB\-T\fItype\fR above), then the long name
239 of the terminal will be put out.
240 The long name is the last
241 name in the first line of the terminal's description in the
242 \fBterminfo\fP database [see \fBterm\fP(5)].
243 .SS Aliases
244 \fB@TPUT@\fP handles the \fBclear\fP, \fBinit\fP and \fBreset\fP
245 commands specially:
246 it allows for the possibility that it is invoked by a link with those names.
247 .PP
248 If \fB@TPUT@\fP is invoked by a link named \fBreset\fP, this has the
249 same effect as \fB@TPUT@ reset\fP.
250 The \fB@TSET@\fP(1) utility also treats a link named \fBreset\fP specially.
251 .PP
252 Before \fI\%ncurses\fP 6.1,
253 the two utilities were different from each other:
254 .bP
255 \fB@TSET@\fP utility reset the terminal modes and special characters
256 (not done with \fB@TPUT@\fP).
257 .bP
258 On the other hand, \fB@TSET@\fP's repertoire of terminal capabilities for
259 resetting the terminal was more limited,
260 i.e., only \fBreset_1string\fP, \fBreset_2string\fP and \fBreset_file\fP
261 in contrast to the tab-stops and margins which are set by this utility.
262 .bP
263 The \fBreset\fP program is usually an alias for \fB@TSET@\fP,
264 because of this difference with resetting terminal modes and special characters.
265 .PP
266 With the changes made for \fI\%ncurses\fP 6.1,
267 the \fIreset\fP feature of the two programs is (mostly) the same.
268 A few differences remain:
269 .bP
270 The \fB@TSET@\fP program waits one second when resetting,
271 in case it happens to be a hardware terminal.
272 .bP
273 The two programs write the terminal initialization strings
274 to different streams (i.e., the standard error for \fB@TSET@\fP and the
275 standard output for \fB@TPUT@\fP).
276 .IP
277 \fBNote:\fP although these programs write to different streams,
278 redirecting their output to a file will capture only part of their actions.
279 The changes to the terminal modes are not affected by redirecting the output.
280 .PP
281 If \fB@TPUT@\fP is invoked by a link named \fBinit\fP, this has the
282 same effect as \fB@TPUT@ init\fP.
283 Again, you are less likely to use that link because another program
284 named \fBinit\fP has a more well-established use.
285 .SS Terminal Size
286 Besides the special commands (e.g., \fBclear\fP),
287 @TPUT@ treats certain terminfo capabilities specially:
288 \fBlines\fP and \fBcols\fP.
289 @TPUT@ calls \fBsetupterm\fP(3X) to obtain the terminal size:
290 .bP
291 first, it gets the size from the terminal database
292 (which generally is not provided for terminal emulators
293 which do not have a fixed window size)
294 .bP
295 then it asks the operating system for the terminal's size
296 (which generally works, unless connecting via a serial line which
297 does not support \fINAWS\fP: negotiations about window size).
298 .bP
299 finally, it inspects the environment variables \fILINES\fP and
300 \fI\%COLUMNS\fP which may override the terminal size.
301 .PP
302 If the \fB\-T\fP option is given
303 @TPUT@ ignores the environment variables by calling \fBuse_tioctl(TRUE)\fP,
304 relying upon the operating system (or finally, the terminal database).
305 .SH EXIT STATUS
306 If the \fB\-S\fP option is used,
307 \fB@TPUT@\fP checks for errors from each line,
308 and if any errors are found, will set the exit code to 4 plus the
309 number of lines with errors.
310 If no errors are found, the exit code is \fB0\fP.
311 No indication of which line failed can be given so
312 exit code \fB1\fP will never appear.
313 Exit codes \fB2\fP, \fB3\fP, and
314 \fB4\fP retain their usual interpretation.
315 If the \fB\-S\fP option is not used,
316 the exit code depends on the type of \fIcapname\fP:
317 .RS 3
318 .TP
319 .I boolean
320 a value of \fB0\fP is set for TRUE and \fB1\fP for FALSE.
321 .TP
322 .I string
323 a value of \fB0\fP is set if the
324 \fIcapname\fP is defined for this terminal \fItype\fP (the value of
325 \fIcapname\fP is returned on standard output);
326 a value of \fB1\fP is set if \fIcapname\fP
327 is not defined for this terminal \fItype\fP
328 (nothing is written to standard output).
329 .TP
330 .I integer
331 a value of \fB0\fP is always set,
332 whether or not \fIcapname\fP is defined for this terminal \fItype\fP.
333 To determine if \fIcapname\fP is defined for this terminal \fItype\fP,
334 the user must test the value written to standard output.
335 A value of \fB\-1\fP
336 means that \fIcapname\fP is not defined for this terminal \fItype\fP.
337 .TP
338 .I other
339 \fBreset\fP or \fBinit\fP may fail to find their respective files.
340 In that case, the exit code is set to 4 + \fBerrno\fP.
341 .RE
342 .PP
343 Any other exit code indicates an error; see the DIAGNOSTICS section.
344 .SH DIAGNOSTICS
345 \fB@TPUT@\fP prints the following error messages and sets the corresponding exit
346 codes.
347 .PP
348 .ne 15
349 .TS
350 l l.
351 exit code       error message
352 =
353 \fB0\fP T{
354 (\fIcapname\fP is a numeric variable that is not specified in the
355 \fBterminfo\fP(5) database for this terminal type, e.g.
356 \fB@TPUT@ \-T450 lines\fP and \fB@TPUT@ \-Thp2621 xmc\fP)
357 T}
358 \fB1\fP no error message is printed, see the \fBEXIT STATUS\fP section.
359 \fB2\fP usage error
360 \fB3\fP unknown terminal \fItype\fP or no \fBterminfo\fP database
361 \fB4\fP unknown \fBterminfo\fP capability \fIcapname\fP
362 \fB>4\fP        error occurred in \-S
363 =
364 .TE
365 .SH FILES
366 .TP
367 .I @DATADIR@/tabset
368 tab stop initialization database
369 .TP
370 .I \*d
371 compiled terminal description database
372 .SH PORTABILITY
373 This implementation of \fBtput\fP differs from AT&T \fBtput\fP in
374 two important areas:
375 .bP
376 \fB@TPUT@\fP \fIcapname\fP writes to the standard output.
377 That need not be a regular terminal.
378 However, the subcommands which manipulate terminal modes
379 may not use the standard output.
380 .IP
381 The AT&T implementation's \fBinit\fP and \fBreset\fP commands
382 use the BSD (4.1c) \fBtset\fP source, which manipulates terminal modes.
383 It successively tries standard output, standard error, standard input
384 before falling back to \*(``/dev/tty\*('' and finally just assumes
385 a 1200Bd terminal.
386 When updating terminal modes, it ignores errors.
387 .IP
388 Until changes made after \fI\%ncurses\fP 6.0,
389 \fB@TPUT@\fP did not modify terminal modes.
390 \fB@TPUT@\fP now uses a similar scheme,
391 using functions shared with \fB@TSET@\fP
392 (and ultimately based on the 4.4BSD \fBtset\fP).
393 If it is not able to open a terminal, e.g., when running in \fBcron\fP(1),
394 \fB@TPUT@\fP will return an error.
395 .bP
396 AT&T \fBtput\fP guesses the type of its \fIcapname\fP operands by seeing if
397 all of the characters are numeric, or not.
398 .IP
399 Most implementations which provide support for \fIcapname\fP operands
400 use the \fBtparm\fP function to expand parameters in it.
401 That function expects a mixture of numeric and string parameters,
402 requiring \fB@TPUT@\fP to know which type to use.
403 .IP
404 This implementation uses a table to determine the parameter types for
405 the standard \fIcapname\fP operands, and an internal library
406 function to analyze nonstandard \fIcapname\fP operands.
407 .IP
408 Besides providing more reliable operation than AT&T's utility,
409 a portability problem is introduced by this analysis:
410 An OpenBSD developer adapted the internal library function from
411 \fI\%ncurses\fP to port NetBSD's termcap-based \fBtput\fP to terminfo.
412 That had been modified to interpret multiple commands on a line.
413 Portable applications should not rely upon this feature;
414 \fI\%ncurses\fP provides it to support applications written
415 specifically for OpenBSD.
416 .PP
417 This implementation (unlike others) can accept both \fItermcap\fP
418 and \fIterminfo\fP names for the \fIcapname\fP feature,
419 if
420 \fItermcap\fP support is compiled in.
421 However, the predefined \fItermcap\fP and \fIterminfo\fP names have two
422 ambiguities in this case (and the \fIterminfo\fP name is assumed):
423 .bP
424 The \fItermcap\fP name \fBdl\fP corresponds to
425 the \fIterminfo\fP name \fBdl1\fP (delete one line).
426 .br
427 The \fIterminfo\fP name \fBdl\fP corresponds to
428 the \fItermcap\fP name \fBDL\fP (delete a given number of lines).
429 .bP
430 The \fItermcap\fP name \fBed\fP corresponds to
431 the \fIterminfo\fP name \fBrmdc\fP (end delete mode).
432 .br
433 The \fIterminfo\fP name \fBed\fP corresponds to
434 the \fItermcap\fP name \fBcd\fP (clear to end of screen).
435 .PP
436 The \fBlongname\fP and \fB\-S\fP options, and the parameter-substitution
437 features used in the \fBcup\fP example,
438 were not supported in BSD curses before 4.3reno (1989) or in
439 AT&T/USL curses before SVr4 (1988).
440 .PP
441 IEEE Std 1003.1/The Open Group  Base Specifications Issue 7 (POSIX.1-2008)
442 documents only the operands for \fBclear\fP, \fBinit\fP and \fBreset\fP.
443 There are a few interesting observations to make regarding that:
444 .bP
445 In this implementation, \fBclear\fP is part of the \fIcapname\fP support.
446 The others (\fBinit\fP and \fBlongname\fP) do not correspond to terminal
447 capabilities.
448 .bP
449 Other implementations of \fBtput\fP on
450 SVr4-based systems such as Solaris, IRIX64 and HP-UX
451 as well as others such as AIX and Tru64
452 provide support for \fIcapname\fP operands.
453 .bP
454 A few platforms such as FreeBSD recognize termcap names rather
455 than terminfo capability names in their respective \fBtput\fP commands.
456 Since 2010, NetBSD's \fBtput\fP uses terminfo names.
457 Before that, it (like FreeBSD) recognized termcap names.
458 .IP
459 Beginning in 2021, FreeBSD uses the \fI\%ncurses\fP \fBtput\fP,
460 configured for both terminfo (tested first) and termcap (as a fallback).
461 .PP
462 Because (apparently) \fIall\fP of the certified Unix systems
463 support the full set of capability names, the reasoning for documenting
464 only a few may not be apparent.
465 .bP
466 X/Open Curses Issue 7 documents \fBtput\fP differently, with \fIcapname\fP
467 and the other features used in this implementation.
468 .bP
469 That is, there are two standards for \fBtput\fP:
470 POSIX (a subset) and X/Open Curses (the full implementation).
471 POSIX documents a subset to avoid the complication of including X/Open Curses
472 and the terminal capabilities database.
473 .bP
474 While it is certainly possible to write a \fBtput\fP program
475 without using curses,
476 none of the systems which have a curses implementation provide
477 a \fBtput\fP utility which does not provide the \fIcapname\fP feature.
478 .PP
479 X/Open Curses Issue 7 (2009) is the first version to document utilities.
480 However that part of X/Open Curses does not follow existing practice
481 (i.e., Unix features documented in SVID 3):
482 .bP
483 It assigns exit code 4 to \*(``invalid operand\*('',
484 which may be the same as \fIunknown capability\fP.
485 For instance, the source code for Solaris' xcurses uses the term
486 \*(``invalid\*('' in this case.
487 .bP
488 It assigns exit code 255 to a numeric variable that is not specified in
489 the terminfo database.
490 That likely is a documentation error,
491 confusing the \fB\-1\fP written to the standard output for an absent
492 or cancelled numeric value versus an (unsigned) exit code.
493 .PP
494 The various Unix systems (AIX, HP-UX, Solaris) use the same exit-codes
495 as \fI\%ncurses\fP.
496 .PP
497 NetBSD curses documents different exit codes which do not correspond
498 to either \fI\%ncurses\fP or X/Open.
499 .SH HISTORY
500 The \fBtput\fP command was begun by Bill Joy in 1980.
501 The initial version only cleared the screen.
502 .PP
503 AT&T System V provided a different \fBtput\fP command:
504 .bP
505 SVr2 provided a rudimentary \fBtput\fP
506 which checked the parameter against each
507 predefined capability and returned the corresponding value.
508 This version of \fBtput\fP did not use \fBtparm\fP(3X) for
509 the capabilities which are parameterized.
510 .bP
511 SVr3 replaced that, a year later, by a more extensive program
512 whose \fBinit\fP and \fBreset\fP subcommands
513 (more than half the program) were incorporated from
514 the \fBreset\fP feature of BSD \fBtset\fP written by Eric Allman.
515 .bP
516 SVr4 added color initialization using the \fBorig_colors\fP and
517 \fBorig_pair\fP capabilities in the \fBinit\fP subcommand.
518 .PP
519 Keith Bostic replaced the BSD \fBtput\fP command in 1989
520 with a new implementation
521 based on the AT&T System V program \fBtput\fP.
522 Like the AT&T program, Bostic's version
523 accepted some parameters named for \fIterminfo\fP capabilities
524 (\fBclear\fP, \fBinit\fP, \fBlongname\fP and \fBreset\fP).
525 However (because he had only \fItermcap\fP available),
526 it accepted \fItermcap\fP names for other capabilities.
527 Also, Bostic's BSD \fBtput\fP did not modify the terminal I/O modes
528 as the earlier BSD \fBtset\fP had done.
529 .PP
530 At the same time, Bostic added a shell script named \*(``clear\*('',
531 which used \fBtput\fP to clear the screen.
532 .PP
533 Both of these appeared in 4.4BSD,
534 becoming the \*(``modern\*('' BSD implementation of \fBtput\fP.
535 .PP
536 This implementation of \fBtput\fP began from a different source than
537 AT&T or BSD: Ross Ridge's \fImytinfo\fP package, published on
538 \fIcomp.sources.unix\fP in December 1992.
539 Ridge's program made more sophisticated use of the terminal capabilities
540 than the BSD program.
541 Eric Raymond used that \fBtput\fP program
542 (and other parts of \fImytinfo\fP) in \fI\%ncurses\fP in June 1995.
543 Using the portions dealing with terminal capabilities
544 almost without change,
545 Raymond made improvements to the way the command-line parameters
546 were handled.
547 .SH EXAMPLES
548 .TP 5
549 \fB@TPUT@ init\fP
550 Initialize the terminal according to the type of
551 terminal in the environmental variable \fITERM\fP.
552 This command should be included in everyone's .profile after
553 the environmental variable \fITERM\fP has been exported,
554 as illustrated on the \fBprofile\fP(5) manual page.
555 .TP 5
556 \fB@TPUT@ \-T5620 reset\fP
557 Reset an AT&T 5620 terminal, overriding the type of
558 terminal in the environmental variable \fITERM\fP.
559 .TP 5
560 \fB@TPUT@ cup 0 0\fP
561 Send the sequence to move the cursor to row \fB0\fP, column \fB0\fP
562 (the upper left corner of the screen, usually known as the \*(``home\*(''
563 cursor position).
564 .TP 5
565 \fB@TPUT@ clear\fP
566 Echo the clear-screen sequence for the current terminal.
567 .TP 5
568 \fB@TPUT@ cols\fP
569 Print the number of columns for the current terminal.
570 .TP 5
571 \fB@TPUT@ \-T450 cols\fP
572 Print the number of columns for the 450 terminal.
573 .TP 5
574 \fBbold=\(ga@TPUT@ smso\(ga offbold=\(ga@TPUT@ rmso\(ga\fP
575 Set the shell variables \fBbold\fP, to begin stand-out mode
576 sequence, and \fBoffbold\fP, to end standout mode sequence,
577 for the current terminal.
578 This might be followed by a
579 prompt: \fBecho "${bold}Please type in your name: ${offbold}\ec"\fP
580 .TP 5
581 \fB@TPUT@ hc\fP
582 Set exit code to indicate if the current terminal is a hard copy terminal.
583 .TP 5
584 \fB@TPUT@ cup 23 4\fP
585 Send the sequence to move the cursor to row 23, column 4.
586 .TP 5
587 \fB@TPUT@ cup\fP
588 Send the terminfo string for cursor-movement, with no parameters substituted.
589 .TP 5
590 \fB@TPUT@ longname\fP
591 Print the long name from the \fBterminfo\fP database for the
592 type of terminal specified in the environmental
593 variable \fITERM\fP.
594 .PP
595 .RS 5
596 \fB@TPUT@ \-S <<!\fP
597 .br
598 \fB> clear\fP
599 .br
600 \fB> cup 10 10\fP
601 .br
602 \fB> bold\fP
603 .br
604 \fB> !\fP
605 .RE
606 .TP 5
607 \&
608 This example shows \fB@TPUT@\fP processing several capabilities
609 in one invocation.
610 It clears the screen,
611 moves the cursor to position 10, 10
612 and turns on bold (extra bright) mode.
613 The list is terminated by an exclamation mark (\fB!\fP) on a line by itself.
614 .SH SEE ALSO
615 \fB\%@CLEAR@\fP(1),
616 \fB\%stty\fP(1),
617 \fB\%@TABS@\fP(1),
618 \fB\%@TSET@\fP(1),
619 \fB\%curs_termcap\fP(3X),
620 \fB\%terminfo\fP(5)