Traditional Chinese Solaris User's Guide

TTY Commands

The two commands for configuring and using the TTY environment are setterm and /bin/stty. setterm is used primarily to build the TTY stream for a particular terminal type, pushing the necessary modules onto the stream. stty changes the behavior of the modules in the stream.

setterm Command

The setterm command is used to configure the TTY STREAMS environment. This command can inquire about and manipulate STREAMS modules for a particular TTY port. The setterm command enables users to tailor their TTY STREAMS environment using system-provided or user-provided STREAMS modules.

The setterm command uses a terminal device name that reflects the devt (device type) field in the terminfo database for configuring STREAMS modules for a TTY port. The device name is matched with an entry of the same name in the setterm configuration file, /usr/share/lib/setterm/zh_TW/conf.file. This entry contains detailed instructions on which modules to pop and push in order to properly configure the STREAMS environment.

The setterm command can also take the device type as a direct argument. The device type is similarly matched with an entry in /usr/share/lib/setterm/zh_TW/conf.file.

The setterm configuration file uses a special language for instructions on what actions to take. This language enables users to determine the names of modules on the STREAMS stack, to push or pop modules on the stack, and to do other operations. manipulates the STREAMS stack by making ioctl calls.

The Traditional Chinese Solaris Operating System provides special modules to enable or disable code conversion and to properly handle multibyte and wide characters. Pushing a module onto the stack enables the corresponding conversion. The default state for conversion is enabled.

For more information, see the setterm(3CURSES) man page.

/bin/stty Command

The -defeucw option to the /bin/stty command is used to modify STREAMS modules to reflect changes in the user's environment. The option does not work with a /usr/ucb version of stty, which has not been internationalized.

The following command queries the user's environment for information on EUC code set width and sets that information in the line discipline:


system% /bin/stty defeucw

For example, if the user has the environment variable LC_CTYPE set to locale, this option gets information on the number of bytes per character and the screen width per character for the code sets in the zh_TW environments. The option then sends this information to relevant modules in the stream.