Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
tput(1)
Edit
PageHistory
Diff
Info
LikePages
tput !!!tput NAME SYNOPSIS DESCRIPTION EXAMPLES FILES SEE ALSO EXIT CODES DIAGNOSTICS PORTABILITY ---- !!NAME __tput__, __reset__ - initialize a terminal or query terminfo database !!SYNOPSIS __tput__ [[__-T__''type''] ''capname'' [[''parms'' ... ]__ tput__ [[__-T__''type''] __init tput__ [[__-T__''type''] __reset tput__ [[__-T__''type''] __longname tput -S tput -V__ !!DESCRIPTION The __tput__ utility uses the __terminfo__ database to make the values of terminal-dependent capabilities and information available to the shell (see sh(1)), to initialize or reset the terminal, or return the long name of the requested terminal type. __tput__ outputs a string if the attribute (''cap''ability ''name'') is of type string, or an integer if the attribute is of type integer. If the attribute is of type boolean, __tput__ simply sets the exit code (__0__ for TRUE if the terminal has the capability, __1__ 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 sh(1)] to be sure it is __0__. (See the __EXIT CODES__ and __DIAGNOSTICS__ sections.) For a complete list of capabilities and the ''capname'' associated with each, see terminfo(5). __-T__''type'' indicates the ''type'' of terminal. Normally this option is unnecessary, because the default is taken from the environment variable __TERM__. If __-T__ is specified, then the shell variables __LINES__ and __COLUMNS__ will be ignored,and the operating system will not be queried for the actual screen size. ''capname'' indicates the attribute from the __terminfo__ database. When __termcap__ support is compiled in, the __termcap__ name for the attribute is also accepted. ''parms'' If the attribute is a string that takes parameters, the arguments ''parms'' will be instantiated into the string. An all numeric argument will be passed to the attribute as a number. __-S__ allows more than one capability per invocation of __tput__. The capabilities must be passed to __tput__ from the standard input instead of from the command line (see example). Only one ''capname'' is allowed per line. The __-S__ option changes the meaning of the __0__ and __1__ boolean and string exit codes (see the EXIT CODES section). __-V__ reports the version of ncurses which was used in this program, and exits. __init__ If the __terminfo__ database is present and an entry for the user's terminal exists (see __-T__''type'', above), the following will occur: (1) if present, the terminal's initialization strings will be output (__is1__, __is2__, __is3__, __if__, __iprog__), (2) any delays (e.g., newline) specified in the entry will be set in the tty driver, (3) tabs expansion will be turned on or off according to the specification in the entry, and (4) if tabs are not expanded, standard tabs will be set (every 8 spaces). If an entry does not contain the information needed for any of the four above activities, that activity will silently be skipped. __reset__ Instead of putting out initialization strings, the terminal's reset strings will be output if present (__rs1__, __rs2__, __rs3__, __rf__). If the reset strings are not present, but initialization strings are, the initialization strings will be output. Otherwise, __reset__ acts identically to __init__. __longname__ If the __terminfo__ database is present and an entry for the user's terminal exists (see __-T__''type'' above), then the long name of the terminal will be put out. The long name is the last name in the first line of the terminal's description in the __terminfo__ database [[see term(5)]. If __tput__ is invoked by a link named __reset__, this has the same effect as __tput reset__. See __tset__ for comparison, which has similar behavior. !!EXAMPLES __tput init__ Initialize the terminal according to the type of terminal in the environmental variable __TERM__. This command should be included in everyone's .profile after the environmental variable __TERM__ has been exported, as illustrated on the profile(4) manual page. __tput -T5620 reset__ Reset an AT TERM__. __tput cup 0 0__ Send the sequence to move the cursor to row __0__, column __0__ (the upper left corner of the screen, usually known as the __ __tput clear__ Echo the clear-screen sequence for the current terminal. __tput cols__ Print the number of columns for the current terminal. __tput -T450 cols__ Print the number of columns for the 450 terminal. __bold=`tput smso` offbold=`tput rmso`__ Set the shell variables __bold__, to begin stand-out mode sequence, and __offbold__, to end standout mode sequence, for the current terminal. This might be followed by a prompt: __echo __ __tput hc__ Set exit code to indicate if the current terminal is a hard copy terminal. __tput cup 23 4__ Send the sequence to move the cursor to row 23, column 4. __tput longname__ Print the long name from the __terminfo__ database for the type of terminal specified in the environmental variable __TERM__. __tput -S __ __ __ __ __ This example shows tput processing several capabilities in one invocation. This example clears the screen, moves the cursor to position 10, 10 and turns on bold (extra bright) mode. The list is terminated by an exclamation mark (__!__) on a line by itself. !!FILES __/usr/share/terminfo__ compiled terminal description database __/usr/include/curses.h__ __curses__(3X) header file __/usr/include/term.h__ __terminfo__ header file __/usr/share/tabset/*__ tab settings for some terminals, in a format appropriate to be output to the terminal (escape sequences that set margins and tabs); for more information, see the terminfo__(4) !!SEE ALSO clear(1), stty(1), tabs(5). profile(5), terminfo(4) in the ''System Administrator'''''s Reference Manual''. Chapter 10 of the ''Programmer'''''s Guide''. !!EXIT CODES If ''capname'' is of type boolean, a value of __0__ is set for TRUE and __1__ for FALSE unless the __-S__ option is used. If ''capname'' is of type string, a value of __0__ is set if the ''capname'' is defined for this terminal ''type'' (the value of ''capname'' is returned on standard output); a value of __1__ is set if ''capname'' is not defined for this terminal ''type'' (a null value is returned on standard output). If ''capname'' is of type boolean or string and the __-S__ option is used, a value of __0__ is returned to indicate that all lines were successful. No indication of which line failed can be given so exit code __1__ will never appear. Exit codes __2__, __3__, and __4__ retain their usual interpretation. If ''capname'' is of type integer, a value of __0__ 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 the value of standard output. A value of __-1__ means that ''capname'' is not defined for this terminal ''type''. Any other exit code indicates an error; see the DIAGNOSTICS section. !!DIAGNOSTICS __tput__ prints the following error messages and sets the corresponding exit codes. !!PORTABILITY The __longname__ and __-S__ options, and the parameter-substitution features used in the __cup__ example, are not supported in BSD curses or in AT__ ----
4 pages link to
tput(1)
:
console_codes(4)
clear(1)
setterm(1)
Man1t
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.