Using apps via telnet : terminal error

I am connecting to my linux machine via telnet
from an OS/2 v4.0 workstation.  I connect fine
but when I try to use an application (eg. pine) it
gives me an "unknown terminal vt220" error.  I have
tried typing "set term vt100" but it does not seem to
help.    I connect to other unix machines (solaris, bsd)
from the same OS/2 machine and it works great!  Any
ideas would be appreciated.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Your telnet client is obviously advertising itself as a vt220
terminal, and for some reason your Linux system doesn't appear to have an entry in /etc/termcap for a vt220. This is odd, as these are common terminals, and I thought most distributions had them. You may want to look into this - get an updated termcap package for whatever distribution you are using.

Anyway, to solve your immediate problem, if you are using bash, try:-

export TERM=vt100

or for csh (tcsh):-

setenv TERM vt100

The variable names are case sensitive.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
deatherAuthor Commented:

I looked at termcap...seems to be just a text file.  Can I
just download a termcap file and overwrite it?

Secondly, what does  export TERM=vt100 do?  Do I have to do this
locally first under root, then logon remotely and it will be fine?  Or just do this remotely when I log in via a telnet session?    Is it permanent or must it be done each time?

Thanks again
Termcap is indeed just a text file. Yes, you should just be able to download a more complete termcap, and overwrite it, but make sure you back up first. You'll find loads of things stop working without a proper termcap file. Some apps also use the terminfo database.

>Secondly, what does export TERM=vt100 do?

Well, when you telnet into your remote machine, most telnet clients will communicate a terminal type to the remote host. This info ends up in an environment variable called TERM. If you telnet into your system, and then type 'echo $TERM', the shell will give you the value of the variable, probably vt220 in your case.

Bash allows you to set an environment variable by using syntax like VAR=name, so doing TERM=vt100 sets your terminal type to vt100, which is pretty much a 'lowest common denominator' terminal type. If you have anything in your termcap, you should have this.... Using the export command simply makes sure that processes spawned by the shell (e.g. Pine) inherit the new variable setting.

When you start Pine, it uses the TERM variable to reference /etc/termcap, and from the termcap information, it can figure out how to control the screen it is running on.

You will have to re-export the variable every time you want to use Pine (or vi, or loads of other things). You just do this after you log in via telnet each time. Better solutions are:-

1/ Change your /etc/termcap to include an entry for a vt220
2/ Change the setup of your telnet client to send a different
teminal type, that you have a termcap entry for.
3/ Add the export TERM line to your ~/.bash_profile so it gets set every time you log in.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.