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