1833046 Members
2522 Online
110049 Solutions
New Discussion

How to decide TERM value

 
ezhilarasan_1
Occasional Advisor

How to decide TERM value

Hi,

I do not have clear idea in setting TERM value. We are using different software ( telnet, Crt, Tnvt, ..) to connect to many Unix m/c. If vi ( editing file ) is not OK, we change TERM=vt100 or vt220 or hp .., it works.

But how to decide on TERM value ?
does it depend on Unix m/c or software we are using to connect or depend on our PC

Thanks
R.Ezhil

2 REPLIES 2
Karthik S S
Honored Contributor

Re: How to decide TERM value

Hi Ezhil,

It sometimes depends on the unix box you use. Mostly with all Unix flavors vt100 works just fine. You don't have to set it every time but you can put the same in your .profile.

Regards,
Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Bill Hassell
Honored Contributor

Re: How to decide TERM value

It is best NEVER to hardcode the TERM value in /etc/profile and/or .profile since there may are dozens of different terminals (and emulators) that might be used. Hardcoding TERM means that some users will be OK and others will not. HP-UX has a program that identifies terminals (and emulators) automatically: ttytype

However, the standard /etc/profile will bypass this invaluable tool by testing whether TERM has been set before /etc/profile starts. This is a problem since telnet has a subcode that some opsystems will pass through to HP-UX and may not be useful for HP-UX. So, eliminate the test in /etc/profile to see if TERM has been set:

if [ "$TERM" = "" -o "$TERM" = "unknown" -o "$TERM" = "dialup" -o "$TERM" = "network" ]
then
eval `ttytype -s -a`
fi


and replace it with:

eval $(ttytype -s)

Now, every login will be correctly evaluated and programs like vi will work correctly.


Bill Hassell, sysadmin