Greg Hinkel's UNIX Tip of the Week for March 31, 1996
Messages like "unknown terminal type" or "using open mode," when running
things like vi, giving you the blues?
The reason for the "problem" is that each vendor tries to be fancy and
supply a pretty terminal emulation package. However, the other vendors have
no knowledge (or at least they pretend) of these packages. As long as you
stay on platforms that are similar everything is fine. But, alas, you want
to venture off to another vendor's machine. When you log on, the 2
machines pass info about the type of terminal you are emulating. However, the
remote (other vendor) machine has no knowledge of the local emulation package,
and so throws up its arms in disgust. e.g., You are logged into an SGI
machine and bring up a "winterm." The default terminal emulation
for "winterm" is "iris-ansi." You then log into a Sun machine. The SGI
tells the Sun that you are emulating an "iris-ansi" terminal. The Sun looks
up "iris-ansi" in its terminal definitions database (/usr/share/lib/terminfo
by default) and can't find a match, so it throws up its arms and tells you
"unknown terminal type" (or something similar). Consequently, vi and other
programs dont' work properly.
The best solution (IMHO) is to ALWAYS emulate a vt100 terminal cause every
machine (that I've ever used) knows about the vt100. The best way to do that
is to use "xterm -tn vt100" and NOT use aixterm, winterm, hpterm, Sun's command
tool, etc. Actually, you can use winterm if you first
setenv WINTERM 'xterm -tn vt100'
This will make winterm emulate a vt100. Supposedly you can use aixterm if you
use the -v switch (aixterm -v). This will make aixterm emulate a vt100.
In all cases you should set your "TERM" environment variable to "vt100" with
setenv TERM vt100
because your TERM variable and your emulation package have to be the same.
And btw, xterm supports "everything" you need (from a terminal emulation
package). Try this (all on one line).
xterm -tn vt100 -fn 9x15 -fg black -bg SkyBlue -sb -j -rw -aw -s -sl 1000
-title "Hi Ho Hi Ho" -bd Orange -cr red
Check this out also. Press the "control" key and then each mouse button (while
the mouse pointer is in the xterm window) to see some available options.
If there are still stubborn folks who don't wanna use "xterm" - there is
still hope.
You can place the necessary terminal descriptions in the /usr/lib/terminfo
directory or in your own personal "terminfo" database (say ~/terminfo).
Each user can specify their own "terminal definitions database" by setting the
environment variable "TERMINFO." Either way (/usr/lib/terminfo or a personal
terminfo database), you need to put it on every machine that you use. If you
use the personal terminfo approach then you need to do the following (for
C-Shell users).
setenv TERMINFO /home/myhome/terminfo
And put the appropriate entries in that directory. I have several entries
that I will provide if you are interested (All I've done is extract them from
each vendors /usr/lib/terminfo database). Send me e-mail and I'll forward
them.
This will allow you to use, say, an "IRIX winterm" and log into a Sun
or IBM without getting those pesky "unknown terminal type" messages - or worse,
no message and things like "vi" don't work.
Note for PeeCee Users
If you happen to be a PeeCee user and are using a software package such as
FTP Software's PC/TCP (or whatever they call it now) and get messages like,
dec-vt100: Unknown terminal type
then you should do this
setenv TERM vt100
and everything should work okay. For some reason (duh!) their software passes
the string "dec-vt100" or "dec-vt220," as the terminal type, to the host
machine. However, no vendor (that I know of) has a terminfo (or termcap) entry
with this name. They do actually emulate a vt100, they just pass a goofy
name to the host machine.
N.B. I assume you know that the "setenv" commands should go in your
.cshrc or .login file (in your home directory) so you don't have to enter
them each time you log in.
Previous Tip of the Week ·
Next Tip of the Week ·
Index
Greg's Home Page
Greg Hinkel / (hinkelgc AT ornl.gov)
Last Modified: Friday, 02-Sep-2005 12:52:17 EDT
Visitors: 8362 since March 18, 1996