Traditional Chinese Solaris User's Guide

TTY Setup Examples

The system administrator can add setterm in the startup script in /etc/rcn.d directory (where n is the run level) to run at the system boot time. Also, users can run the setterm command at login to configure the stream for their terminal, including the appropriate modules for Traditional Chinese input code conversion. The following examples using setterm can be run as commands typed at a system prompt or included in system files such as .cshrc, .login, and the startup script. Such commands can either explicitly set the device type or use the terminfo database.

Configuring STREAMS for Traditional Chinese Solaris Software

Use the following command to explicitly configure the STREAMS module for a BIG5 terminal use.


setterm -x big5

This usage is independent of terminfo.

You can use a VT-100 terminal, which is BIG5 compatible, on a system with an entry such as the following example in the terminfo database:


vt100-b|VT-100-compatible with Big-5 chars,
lines#40, .csin=E(BE)IE[?1h, csin=E(BE)I, devt=PACKBig5,
s0ds=E(H, s1ds=E$@, s2ds=E(H, use=cit600,

Use the following configuration command to reference the VT-100 entry:


setterm -t vt100-b

For setterm to work properly in this application, /usr/share/lib/setterm/zh_TW/conf.file must contain an entry that corresponds to the device type. An entry such as the following example instructs setterm to place the appropriate conversion modules in the TTY stream.


#
big5throw \
			popto zs|mcp|mti|ptem \
			push big5euc \
			push ldterm \
			push ttcompat \
			run {stty defeucw} \
			catch
#
GenericEUC|EUCthrow \
			popto zs|mcp|mti|ptem \
			push ldterm \
			push ttcompat \
			run {stty defeucw} \
			catch
#
ASCIIthrow \
			popto zs|mcp|mti|ptem \
			push ldterm \
			push ttcompat \
			catch
#

Once configured, conversion is enabled by default. Applications can also set features through ioctl() function calls.