NAME
ttppuutt, rreesseett - initialize a terminal or query terminfo database
SYNOPSIS
ttppuutt [-TTtype] capname [parms ... ]
ttppuutt [-TTtype] iinniitt
ttppuutt [-TTtype] rreesseett
ttppuutt [-TTtype] lloonnggnnaammee
ttppuutt -SS <<<<
ttppuutt -VV
DESCRIPTION
The ttppuutt utility uses the tteerrmmiinnffoo database to make the values of ter-
minal-dependent capabilities and information available to the shell
(see sshh(1)), to initialize or reset the terminal, or return the longname of the requested terminal type. ttppuutt outputs a string if the
attribute (capability name) is of type string, or an integer if the attribute is of type integer. If the attribute is of type boolean, ttppuutt simply sets the exit code (00 for TRUE if the terminal has thecapability, 11 for FALSE if it does not), and produces no output.
Before using a value returned on standard output, the user should test
the exit code [$$??, see sshh(1)] to be sure it is 00. (See the EEXXIITT CCOODDEESS
n DIAGNOSTICS scin. Fr cmlt ls o cpblte ad h capname associated with each, see tteerrmmiinnffoo(1).-TTtype indicates the type of terminal. Normally this option is unnec-
essary, because the default is taken from the environment vari-
able TTEERRMM. If -TT is specified, then the shell variables LLIINNEESS
and CCOOLLUUMMNNSS will be ignored,and the operating system will not be queried for the actual screen size. capnameindicates the attribute from the tteerrmmiinnffoo database. When tteerrmm-
ccaapp support is compiled in, the tteerrmmccaapp name for the attribute is also accepted.parms If the attribute is a string that takes parameters, the argu-
ments parms will be instantiated into the string. An all-
numeric argument will be passed to the attribute as a number. Only a few terminfo capabilities require string parameters; ttppuutt uses a table to decide which to pass as strings. Normally ttppuutt uses ttppaarrmm (3X) to perform the substitution. If no parametersare given for the attribute, ttppuutt writes the string without per-
forming the substitution.-SS allows more than one capability per invocation of ttppuutt. The
capabilities must be passed to ttppuutt from the standard inputinstead of from the command line (see example). Only one cap-
name is allowed per line. The -SS option changes the meaning of
the 00 and 11 boolean and string exit codes (see the EXIT CODES section). Again, ttppuutt uses a table and the presence of parameters in its input to decide whether to use ttppaarrmm (3X), and how to interpret the parameters.-VV reports the version of ncurses which was used in this program,
and exits. iinniitt If the tteerrmmiinnffoo database is present and an entry for the user'sterminal exists (see -TTtype, above), the following will occur:
(1) if present, the terminal's initialization strings will beoutput (iiss11, iiss22, iiss33, iiff, iipprroogg), (2) any delays (e.g., new-
line) specified in the entry will be set in the tty driver, (3)tabs expansion will be turned on or off according to the speci-
fication in the entry, and (4) if tabs are not expanded, stan-
dard tabs will be set (every 8 spaces). If an entry does notcontain the information needed for any of the four above activi-
ties, that activity will silently be skipped. rreesseett Instead of putting out initialization strings, the terminal'sreset strings will be output if present (rrss11, rrss22, rrss33, rrff). If
the reset strings are not present, but initialization stringsare, the initialization strings will be output. Otherwise,
rreesseett acts identically to iinniitt. lloonnggnnaammee If the tteerrmmiinnffoo database is present and an entry for the user'sterminal exists (see -TTtype above), then the long name of the
terminal will be put out. The long name is the last name in thefirst line of the terminal's description in the tteerrmmiinnffoo data-
base [see tteerrmm(5)]. If ttppuutt is invoked by a link named rreesseett, this has the same effect as ttppuutt rreesseett. See ttsseett for comparison, which has similar behavior. EEXXAAMMPPLLEESS ttppuutt iinniitt Initialize the terminal according to the type of terminal in the environmental variable TTEERRMM. This command should be included in everyone's .profile after the environmental variable TTEERRMM has been exported, as illustrated on the pprrooffiillee(5) manual page.ttppuutt -TT55662200 rreesseett
Reset an AT&T 5620 terminal, overriding the type of terminal in the environmental variable TTEERRMM. ttppuutt ccuupp 00 00 Send the sequence to move the cursor to row 00, column 00 (the upper left corner of the screen, usually known as the "home" cursor position). ttppuutt cclleeaarrEcho the clear-screen sequence for the current terminal.
ttppuutt ccoollss Print the number of columns for the current terminal.ttppuutt -TT445500 ccoollss
Print the number of columns for the 450 terminal. bboolldd==``ttppuutt ssmmssoo`` ooffffbboolldd==``ttppuutt rrmmssoo``Set the shell variables bboolldd, to begin stand-out mode sequence,
and ooffffbboolldd, to end standout mode sequence, for the current termi-
nal. This might be followed by a prompt: eecchhoo ""$${{bboolldd}}PPlleeaassee ttyyppee
iinn yyoouurr nnaammee:: $${{ooffffbboolldd}}\\cc""
ttppuutt hhcc Set exit code to indicate if the current terminal is a hard copy terminal. ttppuutt ccuupp 2233 44 Send the sequence to move the cursor to row 23, column 4. ttppuutt ccuuppSend the terminfo string for cursor-movement, with no parameters
substituted. ttppuutt lloonnggnnaammee Print the long name from the tteerrmmiinnffoo database for the type of terminal specified in the environmental variable TTEERRMM.ttppuutt -SS <<< >> cclleeaarr >> ccuupp 1100 1100 >> bboolldd >> !! This example shows ttppuutt processing several capabilities in one invocation. It clears the screen, moves the cursor to position
10, 10 and turns on bold (extra bright) mode. The list is termi-
nated by an exclamation mark (!!) on a line by itself. FILES //uussrr//sshhaarree//tteerrmmiinnffoo compiled terminal description database //uussrr//iinncclluuddee//ccuurrsseess..hh ccuurrsseess(3X) header file //uussrr//iinncclluuddee//tteerrmm..hh tteerrmmiinnffoo header file //uussrr//sshhaarree//ttaabbsseett//** tab settings for some terminals, in a format appropriate to beoutput to the terminal (escape sequences that set margins and
tabs); for more information, see the "Tabs and Initialization" section of tteerrmmiinnffoo(5) EEXXIITT CCOODDEESSIf the -SS option is used, ttppuutt checks for errors from each line, and if
any errors are found, will set the exit code to 4 plus the number of lines with errors. If no errors are found, the exit code is 00. No indication of which line failed can be given so exit code 11 will never appear. Exit codes 22, 33, and 44 retain their usual interpretation. Ifthe -SS option is not used, the exit code depends on the type of cap-
name: boolean a value of 00 is set for TRUE and 11 for FALSE.string a value of 00 is set if the capname is defined for this ter-
minal type (the value of capname is returned on standardoutput); a value of 11 is set if capname is not defined for
this terminal type (nothing is written to standard output).
integer a value of 00 is always set, whether or not capname is defined for this terminal type. To determine if capname is defined for this terminal type, the user must test thevalue written to standard output. A value of -11 means that
capname is not defined for this terminal type. other rreesseett or iinniitt may fail to find their respective files. In that case, the exit code is set to 4 + eerrrrnnoo. Any other exit code indicates an error; see the DIAGNOSTICS section. DIAGNOSTICS ttppuutt prints the following error messages and sets the corresponding exit codes. exit code error message-----------------------------------
00 (capname is a numeric variable that is not specified in the tteerrmmiinnffoo(1) database for this terminal type, e.g.ttppuutt -TT445500 lliinneess and ttppuutt -TT22662211 xxmmcc)
11 no error message is printed, see the EEXXIITT CCOODDEESS section. 22 usage error 33 unknown terminal type or no tteerrmmiinnffoo database 44 unknown tteerrmmiinnffoo capability capname>>44 error occurred in -S
-----------------------------------
PPOORRTTAABBIILLIITTYYThe lloonnggnnaammee and -SS options, and the parameter-substitution features
used in the ccuupp example, are not supported in BSD curses or in AT&T/USL curses before SVr4.SEE ALSO
cclleeaarr(1), ssttttyy(1), ttaabbss(1), tteerrmmiinnffoo(5).tput(1)