UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 5.3 Setting the Terminal Type When You Log In Chapter 5
Setting Up Your Terminal
Next: 5.5 Querying Your Terminal Type: qterm
 

5.4 Setting the TERMCAP Variable with tset

Warning! For C shell users, tset (5.3) has an even more powerful function. The -s option causes it to send to standard output a series of C shell commands not only to set TERM, but also to set the TERMCAP variable to the actual contents of the termcap entry. This speeds up launch time for programs that use termcap: they no longer need to search through the /etc/termcap file until they find the relevant entry; it is already at hand.

Invoke tset as follows:


eval 
set noglob
eval `tset -Q -s other-options-here`

In order to understand what tset is doing, let's take a moment to send its output to the screen (i.e., issue the command without evaluating it):

% tset -Q -s wy50
set noglob;
setenv TERM wy50 ;
setenv TERMCAP 'n9|wy50:li#24:co#80:am:bs:bw:ul:\
:cm=\E=%+\040%+\040:nd=^L:up=^K:do=^J:ho=^^:bt=\EI:\
:cl=^Z:ce=\ET:cd=\EY:al=\EE:dl=\ER:ic=\EQ:dc=\EW:\
:so=\EG4:se=\EGO:sg#1:ue=\EGO:us=\EG8:ug#1\040:\
:me=\E(EGO:mb=\EG2:mp=\E):mh=\EGp:mr=\EG4:mk=\EG1:\
:kl=^H:kr=^L:ku=^K:kd=^J:kh=^^:k1=^A@^M:k2=^AA^M:\
:k3=^AB^M:k4=^AC^M:k5=^AD^M:k6=^AE^M:k7=^AF^M:k8=^AG^M:\
:k9=^AH^M:k0=^AI^M';
unset noglob;

(Article 41.11 explains the format of termcap entries.) The set noglob command (6.9) causes the shell to suspend interpretation of special characters; the presence of these characters in the termcap entry could cause problems. After execution, the shell is reset to its normal state.

Article 42.3 explains a situation where these changes won't work.

- TOR from O'Reilly & Associates' termcap & terminfo, Chapter 4


Previous: 5.3 Setting the Terminal Type When You Log In UNIX Power ToolsNext: 5.5 Querying Your Terminal Type: qterm
5.3 Setting the Terminal Type When You Log In Book Index5.5 Querying Your Terminal Type: qterm

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System