- Most parameters are numbers. Only a few terminfo
- capabilities require string parameters; <STRONG>tput</STRONG> uses a
- table to decide which to pass as strings. Normally
- <STRONG>tput</STRONG> uses <STRONG>tparm</STRONG> (3x) to perform the substitution.
- If no parameters are given for the capability, <STRONG>tput</STRONG>
- writes the string without performing the substitu-
- tion.
-
- <STRONG>-S</STRONG> allows more than one capability per invocation of
- <STRONG>tput</STRONG>. The capabilities must be passed to <STRONG>tput</STRONG> from
- the standard input instead of from the command line
- (see example). Only one <EM>capname</EM> is allowed per
- line. The <STRONG>-S</STRONG> option changes the meaning of the <STRONG>0</STRONG>
- and <STRONG>1</STRONG> boolean and string exit codes (see the EXIT
- CODES section).
-
- Again, <STRONG>tput</STRONG> uses a table and the presence of param-
- eters in its input to decide whether to use <STRONG>tparm</STRONG>
- (3x), and how to interpret the parameters.
-
- <STRONG>-V</STRONG> reports the version of ncurses which was used in
- this program, and exits.
-
- <STRONG>init</STRONG> If the <STRONG>terminfo</STRONG> database is present and an entry
- for the user's terminal exists (see <STRONG>-T</STRONG><EM>type</EM>, above),
- the following will occur:
-
- (1) if present, the terminal's initialization
- strings will be output as detailed in the
- <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> section on <EM>Tabs</EM> <EM>and</EM> <EM>Initializa-</EM>
- <EM>tion</EM>,
-
- (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.
-
- <STRONG>reset</STRONG> Instead of putting out initialization strings, the
- terminal's reset strings will be output if present
- (<STRONG>rs1</STRONG>, <STRONG>rs2</STRONG>, <STRONG>rs3</STRONG>, <STRONG>rf</STRONG>). If the reset strings are not
- present, but initialization strings are, the ini-
- tialization strings will be output. Otherwise,
- <STRONG>reset</STRONG> acts identically to <STRONG>init</STRONG>.
+ Most parameters are numbers. Only a few terminal capabilities
+ require string parameters; <STRONG>tput</STRONG> uses a table to decide which to
+ pass as strings. Normally <STRONG>tput</STRONG> uses <STRONG><A HREF="curs_terminfo.3x.html">tparm(3x)</A></STRONG> to perform the
+ substitution. If no parameters are given for the capability,
+ <STRONG>tput</STRONG> writes the string without performing the substitution.
+
+ <STRONG>init</STRONG> If the terminal database is present and an entry for the user's
+ terminal exists (see <STRONG>-T</STRONG><EM>type</EM>, above), the following will occur:
+
+ (1) first, <STRONG>tput</STRONG> retrieves the current terminal mode settings
+ for your terminal. It does this by successively testing
+
+ <STRONG>o</STRONG> the standard error,
+
+ <STRONG>o</STRONG> standard output,
+
+ <STRONG>o</STRONG> standard input and
+
+ <STRONG>o</STRONG> ultimately "/dev/tty"
+
+ to obtain terminal settings. Having retrieved these set-
+ tings, <STRONG>tput</STRONG> remembers which file descriptor to use when
+ updating settings.
+
+ (2) if the window size cannot be obtained from the operating
+ system, but the terminal description (or environment, e.g.,
+ <STRONG>LINES</STRONG> and <STRONG>COLUMNS</STRONG> variables specify this), update the oper-
+ ating system's notion of the window size.
+
+ (3) the terminal modes will be updated:
+
+ <STRONG>o</STRONG> any delays (e.g., newline) specified in the entry will
+ be set in the tty driver,
+
+ <STRONG>o</STRONG> tabs expansion will be turned on or off according to
+ the specification in the entry, and
+
+ <STRONG>o</STRONG> if tabs are not expanded, standard tabs will be set
+ (every 8 spaces).
+
+ (4) if present, the terminal's initialization strings will be
+ output as detailed in the <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> section on <EM>Tabs</EM> <EM>and</EM>
+ <EM>Initialization</EM>,
+
+ (5) output is flushed.
+
+ If an entry does not contain the information needed for any of
+ these activities, that activity will silently be skipped.
+
+ <STRONG>reset</STRONG> This is similar to <STRONG>init</STRONG>, with two differences:
+
+ (1) before any other initialization, the terminal modes will be
+ reset to a "sane" state:
+
+ <STRONG>o</STRONG> set cooked and echo modes,
+
+ <STRONG>o</STRONG> turn off cbreak and raw modes,
+
+ <STRONG>o</STRONG> turn on newline translation and
+
+ <STRONG>o</STRONG> reset any unset special characters to their default
+ values
+
+ (2) Instead of putting out <EM>initialization</EM> strings, the termi-
+ nal's <EM>reset</EM> strings will be output if present (<STRONG>rs1</STRONG>, <STRONG>rs2</STRONG>,
+ <STRONG>rs3</STRONG>, <STRONG>rf</STRONG>). If the <EM>reset</EM> strings are not present, but <EM>ini-</EM>
+ <EM>tialization</EM> strings are, the <EM>initialization</EM> strings will be
+ output.
+
+ Otherwise, <STRONG>reset</STRONG> acts identically to <STRONG>init</STRONG>.