1834149 Members
2298 Online
110064 Solutions
New Discussion

TERM Prompt Problem.

 
SOLVED
Go to solution
Mubarak Rebhan
Occasional Advisor

TERM Prompt Problem.

Whenever I su - from root to another user, I am prompted by the following:-
TERM=(hp)
Then I just enter vt100 as the terminal and get into the user home directory.
How can eliminate this from hepnning, I have tried to setup the TERM in the .profile but did not succeed until now.
Please advise??
7 REPLIES 7
manoj_pu
Regular Advisor

Re: TERM Prompt Problem.


Hello Mubarak

You have to set terminal type (eg. vt100)with your terminal name in a file called "/etc/ttytype". Additional info you can get it from #man ttytype.


Rgds

Manoj
Leave with out tense and try best you gets result
T G Manikandan
Honored Contributor
Solution

Re: TERM Prompt Problem.

Just go into the user login.
open the .profile file or the .login file of the user
Comment this line
eval `tset -s -Q -m ':?hp' `
Now add setenv TERM vt100
in the user's login file
or
export TERM=vt100
in the user .profile file.

Thanks
G manikandan
T. M. Louah
Esteemed Contributor

Re: TERM Prompt Problem.

Peter Kloetgen
Esteemed Contributor

Re: TERM Prompt Problem.

Hi Mubarak,

This occurs if you do the switch- user- command like you did:

su -

this doesn't only change your identity, but also the environment. If you do a su without the minus- character, the problem won't be existant. So try the following command:

su

you will switch identities, but the TERM- variable will be the same than before switching. At my level of kowledge there is no way to do su - without destroying TERM- variable.

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Helen French
Honored Contributor

Re: TERM Prompt Problem.

Hi Mubarak,

Try this:

Check your .profile and comment this line.

eval ` tset -s -Q -m ':?hp' `

make it
# eval ` tset -s -Q -m ':?hp' `

and set your term as

export TERM=vt100

or

TERM=vt100;export TERM

HTH,
Shiju


Life is a promise, fulfill it!
Mubarak Rebhan
Occasional Advisor

Re: TERM Prompt Problem.

Thanks to all of you.

I have tried all solutions but the one that worked in this case was updating the .login file by commenting:
eval `tset -s -Q -m ':?hp' `
and adding:
setenv TERM vt100

Thanks again for your support.


Bill Hassell
Honored Contributor

Re: TERM Prompt Problem.

Be aware that su witnout - is a very unsafe way to change users. With su -, you will completely login as the new user and this includes executing the /etc/profile and .profile ( or .kshrc or /etc/csh.login and .login or .cshrc). As you can see, you must understand how all your shells work during login.

Now, the only shell that handles the hundreds of terminal types correctly is the HP default version of /etc/profile (found in /usr/newconfig/etc). There is a command called /sbin/ttytype which will attempt to identify the myriad of real terminals and emulators. NOTE: vt100 is one of the most poorly implemented standards for emulators. vt100 refers to a very old and obsolete DEC VT100 terminal. However, for simple ASCII command lines, most emulators are adequate but may fall apart for menu programs.

Since it appears that you may be using csh (ie, setenv TERM vt100), you'll need to add the ttytype command to /etc/csh.login. The default csh.login has soemthing like:

if ( ! $?TERM )
setenv TERM
endif

This isn't good...some terminal emulators will set the terminal type as part of the telnet negotiation prior to login, and in some emulators, this may not match the actual emulation. Indeed, some users may set TERM in order to communicate a value such as the $DISPLAY variable.

So, rather than test to see if it was set prior to login, ask ttytype to recheck the terminal:

eval /sbin/ttytype -s

ttytype 'guesses' what type of terminal you have by sending specific escape sequences to the terminal and waiting for a reply. If your emulator responds correctly then TERM will be set correctly.

As mentioned, emulators are not real terminals and some have big problems emulating automatic responses. In that case, your solution to forcibly set TERM to vt100 will have to suffice. Note that most modern terminals, especially smart terminals like the HP 700/9x series are better suited for menu programs such as SAM and swinstall.


Bill Hassell, sysadmin