version 1.18, 2011/12/28 22:27:18 |
version 1.19, 2013/09/18 16:21:30 |
|
|
.Nd terminal initialization |
.Nd terminal initialization |
.Sh SYNOPSIS |
.Sh SYNOPSIS |
.Nm tset |
.Nm tset |
.Op Fl cIQqrSsVw |
.Op Fl cIQqrsVw |
.Op Fl |
.Op Fl |
.Op Fl e Ar ch |
.Op Fl e Ar ch |
.Op Fl i Ar ch |
.Op Fl i Ar ch |
|
|
.Op Fl m Ar mapping |
.Op Fl m Ar mapping |
.Op Ar terminal |
.Op Ar terminal |
.Nm reset |
.Nm reset |
.Op Fl cIQqrSsVw |
.Op Fl cIQqrsVw |
.Op Fl |
.Op Fl |
.Op Fl e Ar ch |
.Op Fl e Ar ch |
.Op Fl i Ar ch |
.Op Fl i Ar ch |
|
|
.Pp |
.Pp |
If the terminal type was not specified on the command line, the |
If the terminal type was not specified on the command line, the |
.Fl m |
.Fl m |
option mappings are then applied (see below for more information). |
option mappings are then applied (see the |
|
.Sx TERMINAL TYPE MAPPING |
|
section below for more information). |
Then, if the terminal type begins with a question mark |
Then, if the terminal type begins with a question mark |
.Pq Ql \&? , |
.Pq Ql \&? , |
the user is prompted for confirmation of the terminal type. |
the user is prompted for confirmation of the terminal type. |
An empty response confirms the type, or another type can be entered to |
An empty response confirms the type, or another type can be entered to |
specify a new type. |
specify a new type. |
Once the terminal type has been determined, the termcap entry for the terminal |
Once the terminal type has been determined, the terminfo entry for the terminal |
is retrieved. |
is retrieved. |
If no termcap entry is found for the type, the user is prompted for another |
If no terminfo entry is found for the type, the user is prompted for another |
terminal type. |
terminal type. |
.Pp |
.Pp |
Once the termcap entry is retrieved, the window size, backspace, interrupt, |
Once the terminfo entry is retrieved, the window size, backspace, interrupt, |
and line kill characters (among many other things) are set and the terminal |
and line kill characters (among many other things) are set and the terminal |
and tab initialization strings are sent to the standard error output. |
and tab initialization strings are sent to the standard error output. |
Finally, if the erase, interrupt and line kill characters have changed, |
Finally, if the erase, interrupt and line kill characters have changed, |
|
|
.Ar ch . |
.Ar ch . |
.It Fl m Ar mapping |
.It Fl m Ar mapping |
Specify a mapping from a port type to a terminal. |
Specify a mapping from a port type to a terminal. |
See below for more information. |
See the |
|
.Sx TERMINAL TYPE MAPPING |
|
section below for more information. |
.It Fl Q |
.It Fl Q |
Don't display any values for the erase, interrupt and line kill characters. |
Don't display any values for the erase, interrupt and line kill characters. |
Normally |
Normally |
|
|
not initialized in any way. |
not initialized in any way. |
.It Fl r |
.It Fl r |
Print the terminal type to the standard error output. |
Print the terminal type to the standard error output. |
.It Fl S |
|
Print the terminal type and the termcap entry to the standard output. |
|
See the section below on setting the environment for details. |
|
.It Fl s |
.It Fl s |
Print the sequence of shell commands to initialize the environment variables |
Print the sequence of shell commands to initialize the environment variable |
.Ev TERM |
.Ev TERM |
and |
|
.Ev TERMCAP |
|
to the standard output. |
to the standard output. |
See the section below on setting the environment for details. |
See the |
|
.Sx SETTING THE ENVIRONMENT |
|
section below for details. |
.It Fl V |
.It Fl V |
Report the version of ncurses which was used in this program, and exit. |
Report the version of ncurses which was used in this program, and exit. |
.It Fl w |
.It Fl w |
|
|
It is often desirable to enter the terminal type and information about |
It is often desirable to enter the terminal type and information about |
the terminal's capabilities into the shell's environment. |
the terminal's capabilities into the shell's environment. |
This is done using the |
This is done using the |
.Fl S |
|
and |
|
.Fl s |
.Fl s |
options. |
option. |
.Pp |
.Pp |
When the |
When the |
.Fl S |
|
option is specified, the terminal type and the termcap entry are written |
|
to the standard output, separated by a space and without a terminating |
|
newline. |
|
This can be assigned to an array by |
|
.Xr csh 1 |
|
and |
|
.Xr ksh 1 |
|
users and then used like any other shell array. |
|
.Pp |
|
When the |
|
.Fl s |
.Fl s |
option is specified, the commands to enter the information into the |
option is specified, the commands to enter the information into the |
shell's environment are written to the standard output. |
shell's environment are written to the standard output. |
|
|
.Bd -literal -offset indent |
.Bd -literal -offset indent |
eval \`tset -s options ... \` |
eval \`tset -s options ... \` |
.Ed |
.Ed |
.Pp |
|
To demonstrate a simple use of the |
|
.Fl S |
|
option, the following lines in the |
|
.Pa .login |
|
file have an equivalent effect: |
|
.Bd -literal -offset indent |
|
set noglob |
|
set term=(`tset -S options ...`) |
|
setenv TERM $term[1] |
|
setenv TERMCAP "$term[2]" |
|
unset term |
|
unset noglob |
|
.Ed |
|
.Sh TERMINAL TYPE MAPPING |
.Sh TERMINAL TYPE MAPPING |
When the terminal is not hardwired into the system (or the current system |
When the terminal is not hardwired into the system (or the current system |
information is incorrect), the terminal type derived from the |
information is incorrect), the terminal type derived from the |
|
|
.Ev TERM |
.Ev TERM |
environment variables. |
environment variables. |
.Sh FILES |
.Sh FILES |
.Bl -tag -width /usr/share/misc/termcap -compact |
.Bl -tag -width /usr/share/misc/terminfo.db -compact |
.It Pa /etc/ttys |
.It Pa /etc/ttys |
port name to terminal type mapping database |
port name to terminal type mapping database |
.It Pa /usr/share/misc/termcap |
.It Pa /usr/share/misc/terminfo.db |
terminal capability database |
terminal capability database |
.El |
.El |
.Sh SEE ALSO |
.Sh SEE ALSO |
|
|
.Xr sh 1 , |
.Xr sh 1 , |
.Xr stty 1 , |
.Xr stty 1 , |
.Xr tty 4 , |
.Xr tty 4 , |
.Xr termcap 5 , |
.Xr terminfo 5 , |
.Xr ttys 5 , |
.Xr ttys 5 , |
.Xr environ 7 |
.Xr environ 7 |
.Sh STANDARDS |
.Sh STANDARDS |
|
|
.Xr terminfo 5 |
.Xr terminfo 5 |
database where previous versions used |
database where previous versions used |
.Xr termcap 5 . |
.Xr termcap 5 . |
To make the |
.Pp |
.Fl s |
Historic versions of the |
and |
.Xr termcap 3 |
.Fl S |
library limited entries to 1023 bytes. |
options still work, |
Modern |
.Nm tset |
.Xr terminfo 3 |
also reads in the terminal entry from |
entries are often much larger, making it impossible to |
.Xr termcap 5 . |
store the full entry in the |
However, this info is used for setting |
|
.Ev TERMCAP |
.Ev TERMCAP |
only. |
environment variable. |
If the terminal type appears in |
Because of this, the |
.Xr terminfo 5 |
.Fl S |
but not in |
option is no longer supported (it prints an error message to the standard |
.Xr termcap 5 , |
error and exits) and the |
the |
.Fl s |
.Fl q |
option only sets |
option will not set |
.Ev TERM , |
.Ev TERMCAP |
not |
and the |
.Ev TERMCAP . |
.Fl Q |
|
option will not work at all. |
|
.Pp |
.Pp |
The |
The |
.Fl A , |
.Fl A , |