summaryrefslogtreecommitdiff
path: root/man/tput.1
diff options
context:
space:
mode:
Diffstat (limited to 'man/tput.1')
-rw-r--r--man/tput.1410
1 files changed, 248 insertions, 162 deletions
diff --git a/man/tput.1 b/man/tput.1
index eba073390df5..f27a529c29e3 100644
--- a/man/tput.1
+++ b/man/tput.1
@@ -1,6 +1,6 @@
'\" t
.\"***************************************************************************
-.\" Copyright 2018-2023,2024 Thomas E. Dickey *
+.\" Copyright 2018-2024,2025 Thomas E. Dickey *
.\" Copyright 1998-2016,2017 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
@@ -28,44 +28,44 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: tput.1,v 1.113 2024/04/20 19:58:50 tom Exp $
-.TH @TPUT@ 1 2024-04-20 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "User commands"
+.\" $Id: tput.1,v 1.149 2025/11/12 01:05:03 tom Exp $
+.TH @TPUT@ 1 2025-11-11 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "User commands"
.ie \n(.g \{\
.ds `` \(lq
.ds '' \(rq
.\}
.el \{\
.ie t .ds `` ``
-.el .ds `` ""
+.el .ds `` ""\" cannot be used in quoted macro argument w/ AT&T troff
.ie t .ds '' ''
-.el .ds '' ""
+.el .ds '' ""\" cannot be used in quoted macro argument w/ AT&T troff
.\}
.
.de bP
.ie n .IP \(bu 4
.el .IP \(bu 2
..
-.ds d @TERMINFO@
.SH NAME
\fB\%@TPUT@\fP \-
initialize a terminal, exercise its capabilities, or query \fI\%term\%info\fP database
.SH SYNOPSIS
-\fB@TPUT@\fP [\fB\-T\fP \fIterminal-type\fP]
+\fB@TPUT@\fP [\fB\-v\fP] [\fB\-T\fP \fIterminal-type\fP]
{\fIcap-code\fP [\fIparameter\fP .\|.\|.\&]} .\|.\|.
.PP
-\fB@TPUT@\fP [\fB\-T\fP \fIterminal-type\fP] [\fB\-x\fP] \fBclear\fP
+\fB@TPUT@\fP [\fB\-v\fP] [\fB\-T\fP \fIterminal-type\fP] [\fB\-x\fP] \fBclear\fP
.PP
-\fB@TPUT@\fP [\fB\-T\fP \fIterminal-type\fP] \fBinit\fP
+\fB@TPUT@\fP [\fB\-v\fP] [\fB\-T\fP \fIterminal-type\fP] \fBinit\fP
.PP
-\fB@TPUT@\fP [\fB\-T\fP \fIterminal-type\fP] \fB\%reset\fP
+\fB@TPUT@\fP [\fB\-v\fP] [\fB\-T\fP \fIterminal-type\fP] \fB\%reset\fP
.PP
-\fB@TPUT@\fP [\fB\-T\fP \fIterminal-type\fP] \fB\%longname\fP
+\fB@TPUT@\fP [\fB\-v\fP] [\fB\-T\fP \fIterminal-type\fP] \fB\%longname\fP
.PP
-\fB@TPUT@ \-S\fP
+\fB@TPUT@\fP [\fB\-v\fP] \fB\-S\fP
.PP
-\fB@TPUT@ \-V\fP
+\fB@TPUT@\fP [\fB\-v\fP] \fB\-V\fP
.SH DESCRIPTION
-\fB\%@TPUT@\fP uses the
+.B \%@TPUT@
+uses the
.I \%term\%info
library and database to make terminal-specific capabilities and
information available to the shell,
@@ -75,26 +75,30 @@ to report a description of the current
(or specified)
terminal type.
Terminal capabilities are accessed by
-.IR cap-code .
+.IR cap-code "."
.PP
\fB\%terminfo\fP(5) discusses terminal capabilities at length
-and presents a complete list of
-.IR cap-codes .
+and presents a complete list of standardized
+.IR cap-codes "."
+\fB\%user_caps\fP(5) presents other widely used
+but non-standard capabilities.
.PP
When retrieving capability values,
the result depends upon the capability's type.
.TP 9 \" "Boolean" + 2n
Boolean
-\fB\%@TPUT@\fP sets its exit status to
+.B \%@TPUT@
+sets its exit status to
.B 0
if the terminal possesses
-.IR cap-code ,
+.IR cap-code ","
and
.B 1
if it does not.
.TP
numeric
-\fB\%@TPUT@\fP writes
+.B \%@TPUT@
+writes
.IR cap-code 's
decimal value to the standard output stream if defined
.RB ( \-1
@@ -102,26 +106,30 @@ if it is not)
followed by a newline.
.TP
string
-\fB\%@TPUT@\fP writes
+.B \%@TPUT@
+writes
.IR cap-code 's
value to the standard output stream if defined,
without a trailing newline.
.PP
Before using a value returned on the standard output,
-the application should test \fB\%@TPUT@\fP's exit status
+the application should test
+.BR \%@TPUT@ 's
+exit status
to be sure it is 0;
see section \*(``EXIT STATUS\*('' below.
.SS Operands
Generally,
an operand is a
-.IR cap-code ,
+.IR cap-code ","
a capability code from the terminal database,
or a parameter thereto.
-Three others are specially recognized by \fB\%@TPUT@\fP:
-.BR init ,
-.BR \%reset ,
+Three others are specially recognized by
+.BR \%@TPUT@ ":"
+.BR init ","
+.BR \%reset ","
and
-.BR \%longname .
+.BR \%longname "."
Although these resemble capability codes,
they in fact receive special handling;
we term them \*(``pseudo-capabilities\*(''.
@@ -132,18 +140,23 @@ indicates a capability from the terminal database.
If
.I cap-code
is of string type and takes parameters,
-\fB\%@TPUT@\fP interprets arguments following
+.B \%@TPUT@
+interprets arguments following
.I cap-code
as the parameters,
up to the (fixed) quantity the capability requires.
.IP
Most parameters are numeric.
Only a few terminal capabilities require string parameters;
-\fB\%@TPUT@\fP uses a table to decide which to pass as strings.
-Normally \fB\%@TPUT@\fP uses \fB\%tparm\fP(3X) to perform the
+.B \%@TPUT@
+uses a table to decide which to pass as strings.
+Normally
+.B \%@TPUT@
+uses \fB\%tparm\fP(3X) to perform the
substitution.
If no parameters are given for the capability,
-\fB\%@TPUT@\fP writes the string without performing the substitution.
+.B \%@TPUT@
+writes the string without performing the substitution.
.TP
.B init
initializes the terminal.
@@ -153,7 +166,8 @@ the following occur.
.RS
.TP 5
(1)
-\fB\%@TPUT@\fP retrieves the terminal's mode settings.
+.B \%@TPUT@
+retrieves the terminal's mode settings.
It successively tests the file descriptors corresponding to
.RS
.bP
@@ -169,22 +183,20 @@ and
.IP
to obtain terminal settings.
Having retrieved them,
-\fB\%@TPUT@\fP remembers which descriptor to use for further updates.
+.B \%@TPUT@
+remembers which descriptor to use for further updates.
.TP
(2)
If the terminal dimensions cannot be obtained from the operating system,
but the environment or terminal type database entry describes them,
-\fB\%@TPUT@\fP updates the operating system's notion of them.
+.B \%@TPUT@
+updates the operating system's notion of them.
.TP
(3)
-\fB\%@TPUT@\fP updates the terminal modes.
+.B \%@TPUT@
+updates the terminal modes.
.RS
.bP
-Any delays specified in the entry
-(for example,
-when a newline is sent)
-are set in the terminal driver.
-.bP
Tab expansion is turned on or off per the specification in the entry,
and
.bP
@@ -199,10 +211,12 @@ If initialization capabilities,
detailed in subsection \*(``Tabs and Initialization\*('' of
\fB\%terminfo\fP(5),
are present,
-\fB\%@TPUT@\fP writes them to the standard output stream.
+.B \%@TPUT@
+writes them to the standard output stream.
.TP
(5)
-\fB\%@TPUT@\fP flushes the standard output stream.
+.B \%@TPUT@
+flushes the standard output stream.
.RE
.IP
If an entry lacks the information needed for an activity above,
@@ -214,24 +228,27 @@ A reset differs from initialization in two ways.
.RS
.TP 5
(1)
-\fB\%@TPUT@\fP sets the the terminal modes to a \*(``sane\*('' state,
+.B \%@TPUT@
+sets the terminal modes to a \*(``sane\*('' state,
.RS
.bP
-enabling cooked and echo modes,
+enabling canonical (\*(``cooked\*('') and echo modes,
.bP
disabling cbreak and raw modes,
.bP
enabling newline translation,
and
.bP
-setting any unset special characters to their default values.
+setting any special input characters to their default values.
.RE
.TP 5
(2)
If any reset capabilities are defined for the terminal type,
-\fB\%@TPUT@\fP writes them to the output stream.
+.B \%@TPUT@
+writes them to the output stream.
Otherwise,
-\fB\%@TPUT@\fP uses any defined initialization capabilities.
+.B \%@TPUT@
+uses any defined initialization capabilities.
Reset capabilities are detailed in subsection
\*(``Tabs and Initialization\*('' of \fB\%terminfo\fP(5).
.RE
@@ -246,7 +263,8 @@ The names are separated by \*(``|\*('' characters.
X/Open Curses terms the last name the \*(``long name\*('',
and indicates that it may include blanks.
.IP
-\fB\%@TIC@\fP warns if the last name does not include blanks,
+.B \%@TIC@
+warns if the last name does not include blanks,
to accommodate old
.I \%term\%info
entries that treated the long name as an optional feature.
@@ -254,37 +272,48 @@ The long name is often referred to as the description field.
.IP
If the terminal database is present and an entry for the user's terminal
type exists,
-\fB\%@TPUT@\fP reports its description to the standard output stream,
+.B \%@TPUT@
+reports its description to the standard output stream,
without a trailing newline.
See \fB\%terminfo\fP(5).
.PP
.I Note:
Redirecting the output of
-.RB \%\*(`` "@TPUT@ init" \*(''
+\*(``\c
+.B "@TPUT@ init\c"
+\*(''
or
-.RB \%\*(`` "@TPUT@ reset" \*(''
+\*(``\c
+.B "@TPUT@ reset\c"
+\*(''
to a file will capture only part of their actions.
Changes to the terminal modes are not affected by file descriptor
redirection,
-since the terminal modes are altered via \fB\%ioctl\fP(2).
+since the terminal modes are altered via \fI\%ioctl\fP(2).
.SS Aliases
-If \fB\%@TPUT@\fP is invoked via link with any of the names
-.BR clear ,
-.BR init ,
+If
+.B \%@TPUT@
+is invoked via link with any of the names
+.BR clear ","
+.BR init ","
or
-.BR \%reset ,
+.BR \%reset ","
it operates as if run with the corresponding (pseudo-)capability
operand.
For example,
executing a link named
.B \%reset
-that points to \fB\%@TPUT@\fP has the same effect as
-.RB \%\*(`` "@TPUT@ \%reset" \*(''.
+that points to
+.B \%@TPUT@
+has the same effect as
+\%\*(``\c
+.B "@TPUT@ \%reset\c"
+\*(''.
.PP
This feature was introduced by
.I \%ncurses
5.2 in 2000.
-It is rarely used:
+It is rarely used.
.TP
.B \%clear
is a separate program,
@@ -296,12 +325,13 @@ has the same name as another program in widespread use.
.B \%reset
is provided
by the \fB\%@TSET@\fP(1) utility (also via a link named
-.BR \%reset ")."
+.BR \%reset ).
.SS "Terminal Size"
Besides the pseudo-capabilities
(such as
.BR init ),
-\fB\%@TPUT@\fP treats the
+.B \%@TPUT@
+treats the
.B lines
and
.B cols
@@ -310,7 +340,8 @@ specially:
it may call \fB\%setupterm\fP(3X) to obtain the terminal size.
.bP
First,
-\fB\%@TPUT@\fP attempts to obtain these capabilities from the terminal
+.B \%@TPUT@
+attempts to obtain these capabilities from the terminal
database.
This generally fails for terminal emulators,
which lack a fixed window size and thus omit the capabilities.
@@ -324,14 +355,15 @@ Finally,
it inspects the environment variables
.I LINES
and
-.IR \%COLUMNS ,
+.IR \%COLUMNS ","
which may override the terminal size.
.PP
If the
.B \-T
option is given,
-\fB\%@TPUT@\fP ignores the environment variables by calling
-.BR \%use_tioctl(TRUE) ,
+.B \%@TPUT@
+ignores the environment variables by calling
+.BR \%use_tioctl(TRUE) ","
relying upon the operating system
(or,
ultimately,
@@ -339,8 +371,11 @@ the terminal database).
.SH OPTIONS
.TP 9n \" "-T type" + 2n
.B \-S
-retrieves more than one capability per invocation of \fB\%@TPUT@\fP.
-The capabilities must be passed to \fB\%@TPUT@\fP from the standard
+retrieves more than one capability per invocation of
+.BR \%@TPUT@ "."
+The capabilities must be passed to
+.B \%@TPUT@
+from the standard
input stream instead of from the command line
(see section \*(``EXAMPLES\*('' below).
Only one
@@ -356,13 +391,14 @@ exit statuses
(see section \*(``EXIT STATUS\*('' below).
.IP
Some capabilities use string parameters rather than numeric ones.
-\fB\%@TPUT@\fP employs a built-in table and the presence of parameters
+.B \%@TPUT@
+employs a built-in table and the presence of parameters
in its input to decide how to interpret them,
and whether to use \fB\%tparm\fP(3X).
.TP
.BI \-T\ type
indicates the terminal's
-.IR type .
+.IR type "."
Normally this option is unnecessary,
because a default is taken from the
.I TERM
@@ -374,19 +410,30 @@ and
.I \%COLUMNS
are also ignored.
.TP
+.B \-v
+causes
+.B \%@TPUT@
+to operate verbosely,
+reporting warnings.
+.TP
.B \-V
reports the version of
.I \%ncurses
-associated with \fB\%@TPUT@\fP,
+associated with
+.BR \%@TPUT@ ","
and exits with a successful status.
.TP
.B \-x
prevents
-.RB \%\*(`` "@TPUT@ clear" \*(''
+\%\*(``\c
+.B "@TPUT@ clear\c"
+\*(''
from attempting to clear the scrollback buffer.
.SH EXIT STATUS
Normally,
-one should interpret \fB\%@TPUT@\fP's exit statuses as follows.
+one should interpret
+.BR \%@TPUT@ "'s"
+exit statuses as follows.
.PP
.if n .ne 3
.if t .ne 2
@@ -420,30 +467,37 @@ _
4 some operands not interpreted
.TE
.SH ENVIRONMENT
-\fB@TPUT@\fP reads one environment variable.
-.TP 8n \" "TERM" + 2n + adjustment for PDF
+.B \%@TPUT@
+reads up to three environment variables
+if the
+.B \-T
+option is not specified.
+.TP 9n \" "COLUMNS" + 2n
+.I COLUMNS
+specifies the width of the screen in characters.
+.TP
+.I LINES
+specifies the height of the screen in characters.
+.TP
.I TERM
denotes the terminal type.
Each terminal type is distinct,
though many are similar.
-The
-.B \-T
-option overrides its value.
.SH FILES
.TP
.I @DATADIR@/tabset
tab stop initialization database
.TP
-.I \*d
+.I @TERMINFO@
compiled terminal description database
.SH PORTABILITY
Over time
.I \%ncurses
-\fB\%@TPUT@\fP
+.B \%@TPUT@
has differed from that of System\ V in two important respects,
one now mostly historical.
.bP
-\%\*(``\fB@TPUT@\fP
+.RB \%\*(`` @TPUT@
.IR cap-code \*(''
writes to the standard output,
which need not be a terminal device.
@@ -452,16 +506,16 @@ the operands that manipulate terminal modes might not use the standard
output.
.IP
System\ V
-.BR tput 's
+.IR tput 's
.B init
and
.B \%reset
operands use logic from 4.1cBSD
-.BR tset ,
+.IR tset ","
manipulating terminal modes.
It checks the same file descriptors
(and
-.IR \%/dev/tty )
+.IR \%/dev/tty ")"
for association with a terminal device as
.I \%ncurses
now does,
@@ -474,18 +528,21 @@ Until
.I \%ncurses
6.1
(see section \*(``HISTORY\*('' below),
-\fB\%@TPUT@\fP did not modify terminal modes.
+.B \%@TPUT@
+did not modify terminal modes.
It now employs a scheme similar to System\ V,
-using functions shared with \fB\%@TSET@\fP
+using functions shared with
+.B \%@TSET@
(and ultimately based on 4.4BSD
-.BR tset ).
+.IR tset ).
If it is not able to open a terminal
(for instance,
when run by \fIcron\fP(1)),
-\fB\%@TPUT@\fP exits with an error status.
+.B \%@TPUT@
+exits with an error status.
.bP
System\ V
-.B tput
+.I tput
assumes that the type of a
.I cap-code
operand is numeric if all the characters of its value are decimal
@@ -499,10 +556,12 @@ Most implementations that provide support for
.I cap-code
operands use the \fB\%tparm\fP(3X) function to expand its parameters.
That function expects a mixture of numeric and string parameters,
-requiring \fB\%@TPUT@\fP to know which type to use.
+requiring
+.B \%@TPUT@
+to know which type to use.
.IP
.I \%ncurses
-\fB\%@TPUT@\fP
+.B \%@TPUT@
uses a table to determine the parameter types for
the standard
.I cap-code
@@ -517,9 +576,9 @@ An OpenBSD developer adapted the internal library function from
.I \%ncurses
to port NetBSD's
.IR termcap -based
-.B tput
+.I tput
to
-.IR \%term\%info ,
+.IR \%term\%info ","
and modified it to interpret multiple
.I cap-codes
(and parameters)
@@ -528,7 +587,9 @@ Portable applications should not rely upon this feature;
.I \%ncurses
offers it to support applications written specifically for OpenBSD.
.PP
-This implementation,
+.IR \%ncurses 's
+implementation of
+.IR tput ","\" generic
unlike others,
accepts both
.I termcap
@@ -540,7 +601,6 @@ if
support is compiled in.
In that case,
however,
-the predefined
.I termcap
and
.I \%term\%info
@@ -561,17 +621,17 @@ to
but
.B \%parm_delete_line
to
-.IR \%term\%info .
+.IR \%term\%info "."
.I termcap
uses the code
.B DL
for
-.BR \%parm_delete_line .
+.BR \%parm_delete_line "."
.I \%term\%info
uses the code
.B dl1
for
-.BR \%delete_line .
+.BR \%delete_line "."
.bP
The
.I cap-code
@@ -583,17 +643,17 @@ to
but
.B \%clr_eos
to
-.IR \%term\%info .
+.IR \%term\%info "."
.I termcap
uses the code
.B cd
for
-.BR \%clr_eos .
+.BR \%clr_eos "."
.I \%term\%info
uses the code
.B rmdc
for
-.BR \%exit_delete_mode .
+.BR \%exit_delete_mode "."
.PP
The
.B \%longname
@@ -609,16 +669,16 @@ AT&T/USL
before SVr4 (1989).
Later,
4.3BSD-Reno (1990) added support for
-.BR \%longname ,
+.BR \%longname ","
.\" longname was added in October 1989.
and in 1994,
NetBSD added support for the parameter-substitution features.
.PP
-IEEE Std 1003.1/The Open Group Base Specifications Issue 7
+IEEE Std 1003.1/The Open Group Base Specifications Issue\ 7
(POSIX.1-2008)
documents only the
-.BR clear ,
-.BR init ,
+.BR clear ","
+.BR init ","
and
.B \%reset
operands.
@@ -628,15 +688,15 @@ A few observations of interest arise from that selection.
supports
.B clear
as it does any other standard
-.IR cap-code .
+.IR cap-code "."
The others
.RB ( init
and
-.BR \%longname )
+.BR \%longname ")"
do not correspond to terminal capabilities.
.bP
The
-.B tput
+.I tput
on SVr4-based systems such as Solaris,
IRIX64,
and HP-UX,
@@ -650,11 +710,11 @@ A few platforms such as FreeBSD recognize
codes rather than
.I \%term\%info
capability codes in their respective
-.B tput
+.I tput
commands.
Since 2010,
NetBSD's
-.B tput
+.I tput
uses
.I \%term\%info
codes.
@@ -668,7 +728,7 @@ codes.
Beginning in 2021,
FreeBSD uses
.I \%ncurses
-.BR tput ,
+.BR tput ","
configured for both
.I \%term\%info
(tested first)
@@ -681,7 +741,7 @@ Because (apparently) all
Unix systems support the full set of capability codes,
the reason for documenting only a few may not be apparent.
.bP
-X/Open Curses Issue 7 documents
+X/Open Curses Issue\ 7 documents
.B tput
differently,
with
@@ -690,23 +750,23 @@ and the other features used in this implementation.
.bP
That is,
there are two standards for
-.BR tput :
+.IR tput ":"
POSIX (a subset) and X/Open Curses (the full implementation).
POSIX documents a subset to avoid the complication of including
X/Open Curses and the terminal capability database.
.bP
While it is certainly possible to write a
-.B tput
+.I tput
program without using
-.IR curses ,
+.IR curses ","
no system with a
.I curses
implementation provides a
-.B tput
+.I tput
utility that does not also support standard
-.IR cap-codes .
+.IR cap-codes "."
.PP
-X/Open Curses Issue 7 (2009) is the first version to document utilities.
+X/Open Curses Issue\ 7 (2009) is the first version to document utilities.
However that part of X/Open Curses does not follow existing practice
(that is,
System\ V
@@ -727,14 +787,14 @@ in the
database.
That likely is a documentation error,
mistaking the \*(``\-1\*('' written to the standard output to indicate
-an absent or cancelled numeric capability for an (unsigned) exit status.
+an absent or canceled numeric capability for an (unsigned) exit status.
.PP
The various System\ V implementations
(AIX,
HP-UX,
Solaris)
use the same exit statuses as
-.IR \%ncurses .
+.IR \%ncurses "."
.PP
NetBSD
.I curses
@@ -743,7 +803,7 @@ documents exit statuses that correspond to neither
nor X/Open Curses.
.SH HISTORY
Bill Joy wrote a
-.B tput
+.I tput
command during development of 4BSD in October 1980.
This initial version only cleared the screen,
and did not ship with official distributions.
@@ -753,15 +813,15 @@ and did not ship with official distributions.
.\" See Spinellis's "unix-history-repo" on GitHub.
.PP
System\ V developed a different
-.B tput
+.I tput
command.
.bP
SVr2 (1984) provided a rudimentary
-.B tput
+.I tput
that checked the parameter against each
-predefined capability and returned the corresponding value.
+capability name and returned the corresponding value.
This version of
-.B tput
+.I tput
did not use \fB\%tparm\fP(3X) for parameterized capabilities.
.bP
SVr3 (1987) replaced that
@@ -777,7 +837,7 @@ operands
incorporated the
.B \%reset
feature of BSD
-.B tset
+.I tset
written by Eric Allman.
.bP
SVr4 (1989) added color initialization by using the
@@ -791,19 +851,21 @@ capabilities in its
logic.
.PP
Keith Bostic refactored BSD
-.B tput
-for shipment in 4.3BSD-Tahoe (1988),
-then replaced it the next year with a new implementation based on
-System\ V
-.BR tput .
-Bostic's version similarly accepted some parameters named for
+.I tput
+for shipment in 4.3BSD-Reno (1990),
+making it follow the interface of System\ V
+.I tput
+.\" https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD-Reno/src/usr.bin/tput/tput.c
+.\" https://minnie.tuhs.org/cgi-bin/utree.pl?file=Net2/usr/src/usr.bin/tput/tput.c
+.\" https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.4BSD/usr/src/usr.bin/tput/tput.c
+by accepting some parameters named for
.I \%term\%info
(pseudo-)capabilities:
-.BR clear ,
-.BR init ,
-.BR \%longname ,
+.BR clear ","
+.BR init ","
+.BR \%longname ","
and
-.BR \%reset .
+.BR \%reset "."
However,
because he had only
.I termcap
@@ -813,22 +875,22 @@ it accepted
codes for other capabilities.
Also,
Bostic's BSD
-.B tput
+.I tput
did not modify the terminal modes as the earlier BSD
-.B tset
+.I tset
had done.
-.PP
At the same time,
Bostic added a shell script named \*(``clear\*('' that used
-.B tput
+.I tput
to clear the screen.
-Both of these appeared in 4.4BSD,
-becoming the \*(``modern\*('' BSD implementation of
-.BR tput .
+.\" https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD-Reno/src/usr.bin/tput/clear.sh
+These became the \*(``modern\*('' BSD implementation of
+.IR tput "."
.PP
The origin of
.I \%ncurses
-\fB\%@TPUT@\fP lies outside both System\ V and BSD,
+.B \%@TPUT@
+lies outside both System\ V and BSD,
in Ross Ridge's
.I \%mytinfo
package,
@@ -838,10 +900,10 @@ in December 1992.
Ridge's program made more sophisticated use of the terminal capabilities
than the BSD program.
Eric Raymond used that
-.B tput
+.I tput
program
(and other parts of
-.IR \%mytinfo )
+.IR \%mytinfo ")"
in
.I \%ncurses
in June 1995.
@@ -853,13 +915,19 @@ were handled.
Before
.I \%ncurses
6.1 (2018),
-its \fB\%@TSET@\fP and \fB\%@TPUT@\fP utilities differed.
+its
+.B \%@TSET@
+and
+.B \%@TPUT@
+utilities differed.
.bP
-\fB\%@TSET@\fP was more effective,
-resetting the terminal modes and special characters.
+.B \%@TSET@
+was more effective,
+resetting the terminal's modes and special input characters.
.bP
On the other hand,
-\fB\%@TSET@\fP's repertoire of terminal capabilities for resetting the
+.BR \%@TSET@ "'s"
+repertoire of terminal capabilities for resetting the
terminal was more limited;
it had only equivalents of
.B \%reset_1string
@@ -869,12 +937,15 @@ it had only equivalents of
and
.B \%reset_file
.RB ( rf ),
-and not the tab stop and margin update features of \fB\%@TPUT@\fP.
+and not the tab stop and margin update features of
+.BR \%@TPUT@ "."
.PP
The
-.B \%reset
-program is traditionally an alias for \fB\%@TSET@\fP due to its ability
-to reset terminal modes and special characters.
+.I \%reset
+program is traditionally an alias for
+.B \%@TSET@
+due to its ability
+to reset the terminal's modes and special input characters.
.PP
As of
.I \%ncurses
@@ -882,14 +953,24 @@ As of
the \*(``reset\*('' features of the two programs are (mostly) the same.
Two minor differences remain.
.bP
-The \fB\%@TSET@\fP program waits one second when resetting,
-in case the terminal happens to be a hardware device.
+When issuing a reset,
+the
+.B \%@TSET@
+program
+checks whether the device appears to be a pseudoterminal
+(as might be used by a terminal emulator program),
+and,
+if it does not,
+waits one second in case it is communicating with a hardware terminal.
.bP
The two programs write the terminal initialization strings
to different streams;
that is,
-standard error for \fB\%@TSET@\fP and
-standard output for \fB\%@TPUT@\fP.
+standard error for
+.B \%@TSET@
+and
+standard output for
+.BR \%@TPUT@ "."
.SH EXAMPLES
.TP
.B "@TPUT@ init"
@@ -914,7 +995,7 @@ environment variable.
Set cursor to normal visibility.
.TP
.B "@TPUT@ home"
-Move the cursor to row 0,
+Move the cursor to line 0,
column 0:
the upper left corner of the screen,
usually known as the \*(``home\*('' cursor position.
@@ -935,7 +1016,7 @@ Report the number of columns used by an ADM-3A terminal.
Set shell variables to capability values:
.B strong
and
-.BR normal ,
+.BR normal ","
to begin and end,
respectively,
stand-out mode for the terminal.
@@ -951,7 +1032,7 @@ printf "${strong}Username:${normal} "
Indicate via exit status whether the terminal is a hard copy device.
.TP
.B "@TPUT@ cup 23 4"
-Move the cursor to row 23,
+Move the cursor to line 23,
column 4.
.TP
.B "@TPUT@ cup"
@@ -976,11 +1057,13 @@ The
option can be profitably used with a shell \*(``here document\*(''.
.IP
.EX
+.nf
.RB $\ "@TPUT@ \-S <<!"
.RB >\ clear
.RB >\ "cup 10 10"
.RB >\ bold
.RB >\ !
+.fi
.EE
.IP
The foregoing
@@ -993,7 +1076,9 @@ mode.
.TP
.B "@TPUT@ clear cup 10 10 bold"
Perform the same actions as the foregoing
-.RB \%\*(`` "@TPUT@ \-S" \*(''
+\%\*(``\c
+.B "@TPUT@ \-S\c"
+\*(''
example.
.SH SEE ALSO
\fB\%@CLEAR@\fP(1),
@@ -1001,4 +1086,5 @@ example.
\fB\%@TABS@\fP(1),
\fB\%@TSET@\fP(1),
\fB\%curs_termcap\fP(3X),
-\fB\%terminfo\fP(5)
+\fB\%terminfo\fP(5),
+\fB\%user_caps\fP(5)