Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ reset(1) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

csh(1)

sh(1)

stty(1)

tset(1)

termcap(4)

ttytype(4)

environ(5)




tset(1) tset(1)
NAME tset, reset - set or reset the terminal to a sensible state SYNOPSIS tset [-] [-a type] [-A] [-d type] [-ec] [-Ec] [-kc] [-l] [-m port] [-p type] [-Q] [-r] [-s] [-S] reset ARGUMENTS - Prints the terminal type on the standard output. For compatibility with earlier versions of tset, this option is accepted, but its use is discouraged. -a type Operates the same as the -m arpanet:type. For compatibility with earlier versions of tset, this option is accepted, but its use is discouraged. -A Prompts the user for the terminal type. -d type Operates the same as the -m dialup:type. For compatibility with earlier versions of tset, this option is accepted, but its use is discouraged. -ec Sets the erase character to be the named character c on all terminals, the default being the backspace character on the terminal, usually CONTROL-H. -Ec Sets the erase character to c only if the terminal can backspace. For compatibility with earlier versions of tset, this option is accepted, but its use is discouraged. -kc Sets the line kill character to be the named character c on all terminals. The c character defaults to CONTROL-X (for purely historical reasons); CONTROL-U is the preferred setting. No kill processing is done if -k is not specified. -l Suppresses outputting terminal initialization strings. -m port Specifies which terminal type is used on the given port type identifier, port, an optional baud specification. and the terminal type to be used if the mapping conditions are satisfied. If more than one mapping is specified, the first applicable mapping prevails. A missing type identifier matches all identifiers. To avoid problems with metacharacters, it is best to January 1992 1



tset(1) tset(1)
place the entire argument to the -m (map) option within quotation marks (''). Users of csh must also put a \ before any ! used here. -p type Operates the same as the -m plugboard:type. For compatibility with earlier versions of tset, this option is accepted, but its use is discouraged. -Q Suppresses printing the Erase set to and Kill set to messages. -r Prints the terminal type on the diagnostic output. For compatibility with earlier versions of tset, this option is accepted, but its use is discouraged. -s Returns the terminal type as specified by the -m option, and information about the terminal to a shell's environment. When using the Bourne shell, sh, the command: eval `tset -s option ... ` or when using the C shell, csh, the command: tset -s options... > tset$$ source tset$$ rm tset$$ generates as output a sequence of shell commands which place the variables TERM and TERMCAP in the environment; see environ(5). -S Outputs the strings to be assigned to TERM and TERMCAP in the environment, rather than commands for a shell. DESCRIPTION tset causes terminal-dependent processing, such as setting erase and kill characters, setting or resetting delays, and so on. It first determines the type of terminal involved, names for which are specified by the /etc/termcap data base, and then does necessary initializations and mode settings. In the case where no argument types are specified, tset simply reads the terminal type out of the environment variable TERM and reinitializes the terminal. The rest of this discussion concerns itself with type initialization, typically done once at login, and options used at initialization time to determine the terminal type and set up terminal modes. When used in a startup script .profile (for sh users) or .login (for csh users), it is desirable to give information 2 January 1992



tset(1) tset(1)
about the types of terminals usually used when connecting to the computer through a modem. These ports are initially identified as being dialup, plugboard, or arpanet, and so on. Bauds are specified as with stty, and are compared with the speed of the diagnostic output (which is almost always the control terminal). The baud test may be any combination of: >, =, <, @, and !; @ is a synonym for = and ! inverts the sense of the test. Once it knows the terminal type, tset engages in terminal mode setting. This normally involves sending an initialization sequence to the terminal and setting the single character erase (and optionally the line-kill (full line erase)) characters. tset reports these settings by printing the diagnostic messages Kill set to c and Erase set to c on the standard error output, unless the -Q option is specified. On terminals that can backspace but not overstrike (such as a CRT), and when the erase character is the default erase character (# on standard systems), the erase character is changed to a CONTROL-H (backspace). reset sets the terminal to cooked mode, turns off cbreak and raw modes, turns on nl, and restores special undefined characters to their default values. This is most useful after a program dies, leaving a terminal in a funny state; you have to type newline reset newline to get it to work, since RETURN (CONTROL-M) may not be recognized in this state; often none of the input will be echoed. It is a good idea to follow reset with tset. EXAMPLES If the port in use is a dialup at a speed greater than 300 baud or if the port is a dialup at a speed of 300 baud or less, you can set the terminal type to an adm3a or to a dw2, respectively, by entering: tset -m 'dialup>300:adm3a' -m dialup:dw2 \ -m 'plugboard:?adm3a' Note: The above command can be entered on one line by omitting the backslash character. January 1992 3



tset(1) tset(1)
If the type argument begins with a question mark (such as ?adm3a), you are asked if you really want that type. A null response means to use that type; otherwise, another type can be entered which will be used instead. Therefore, in this case, you will be queried on a plugboard port as to whether you are using an adm3a. For other ports, the port type will be taken from the /etc/ttytype file or a final, the default type option may be given on the command line, not preceded by a -m option. A typical .login file for a csh user that invokes tset would be: set noglob set term = (`tset -e -S -r -d\?h19`) setenv TERM "$term[1]" setenv TERMCAP "$term[2]" unset term noglob This .login sets the environment variables TERM and TERMCAP for the user's current terminal according to the file /etc/ttytype. If the terminal line is a dialup line, the user is prompted for the proper terminal type. reset returns the user's terminal to a usable state after being accidentally set by an interrupted process. LIMITATIONS Should be merged with stty. reset doesn't set tabs properly; it can't intuitively read personal choices for interrupt and line kill characters, so it leaves these set to the local system standards. It could be well argued that the shell should be responsible for insuring that the terminal remains in a sane state; this would eliminate the need for this program. FILES /bin/tset /bin/reset Executable file /etc/ttytype File containing terminal types /etc/termcap Terminal capabilities file SEE ALSO csh(1), sh(1), stty(1) 4 January 1992



tset(1) tset(1)
termcap(4), ttytype(4), environ(5) in A/UX Programmer's Reference January 1992 5

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026