UNIX System Administration Handbook - Evi Nemeth [72]
9600 -T vt100 -s /usr/bin/login`"
The /etc/ttydefs file is used much like gettydefs on other systems to set speed and parity parameters.
See the manual pages for saf, pacadm, pmadm, ttyadm, and ttymon as well as the terminals chapter in the Solaris AnswerBook for more information about setting up these monitors. Have fun.
Terminal support: the termcap and terminfo databases
UNIX has always supported many different terminal types, as opposed to some large vendors whose software only worked with their own brand of terminals. UNIX provides this support through a database of terminal capabilities that specifies the features and programming quirks of each brand of terminal.
Some systems call this database termcap; others use a different format that’s called terminfo. A few provide both terminal databases for maximum compatibility. The databases are usually found in /etc or /usr/share.
As shipped, both databases contains entries for hundreds of different terminals. It’s highly unlikely that you would ever need to write your own terminal description. However, some vendors insist on renaming the “xterm” terminal type, so you might have to add a new and improved name for an existing entry.
UNIX programs look at the TERM environment variable to determine what kind of terminal you are using. The terminal can then be looked up in termcap or terminfo. Alternatively, the terminal’s termcap entry can be placed directly in the environment under the TERMCAP environment variable. Users normally arrange to have their TERMCAP and TERM variables set up at login time.
See page 112 for more information about configuring terminals at login time.
Now that physical terminals are no longer much used, only a handful of terminal types are relevant to daily life. A good rule of thumb is that everything emulates a DEC VT100 until proven otherwise.
7.9 SPECIAL CHARACTERS AND THE TERMINAL DRIVER
The terminal driver supports several special functions that you access by typing particular keys (usually control keys) on the keyboard. The exact binding of functions to keys can be set with the tset and stty commands. Table 7.8 lists some of these functions, along with their default key bindings.
Table 7.8 Special characters for the terminal driver
Depending on what a vendor’s keyboards look like, the default for ERASE might also be the delete character, for which different OSes have different text representations. It’s indicative of the disastrous fragmentation of the UNIX industry that vendors cannot even agree on what code the backspace key should generate.
On very early systems, the characters #, @, and delete were the defaults for ERASE, KILL, and INTR. A few systems still secretly use those defaults before you log in, so don’t use these characters in passwords.
7.10 STTY: SET TERMINAL OPTIONS
stty lets you directly change and query the various settings of the terminal driver. There are about a zillion options; these are documented in the man page for the tty driver (usually tty(4) or tty(5), not tty(1), which is a simple program that tells you which terminal or pseudo-terminal you’ve logged in on).
In most cases, the option names used in the tty man page are the same names used by stty, but sometimes there are slight differences. Many options are the same among systems, but there are enough discrepancies, even among related variants, that you should consult the man page for your local system.
Options to stty can be placed on the command line in any order and in any combination. A dash before an option negates it. For example, to configure a terminal for 9,600 bps operation with even parity and without hardware tabs, use the command
% stty 9600 even -tabs
A good combination of options to use for a plain-vanilla terminal is
% stty intr ^C kill ^U erase ^H -tabs
Here, -tabs prevents the terminal driver from taking advantage of the terminal’s built-in tabulation mechanism, which is useful because many terminals are not very smart about tabs. The other options set the interrupt,