Operating System - HP-UX
1845937 Members
4983 Online
110250 Solutions
New Discussion

removing prompt "TERM = (hp)"

 
SOLVED
Go to solution
so.nimda
Super Advisor

removing prompt "TERM = (hp)"

Hi,

Whenever I "su" to a particular ID from root, I'm always greeted with the prompt :

TERM = (hp)

And everytime this appears, I enter "vt100" to get pass this.

How do I remove this prompt?

Thanks in advance.

cheers !!
14 REPLIES 14
Robert Salter
Respected Contributor

Re: removing prompt "TERM = (hp)"

Hi,

Change the particular ID's .profile
Time to smoke and joke
OldSchool
Honored Contributor

Re: removing prompt "TERM = (hp)"

check the "new" user's profile. you should see a "ttytype" command that is causing this prompt.

depending on the options used, you may just be able to hit a carriage return and let ttytype id the terminal.

"man ttytype" for more info
so.nimda
Super Advisor

Re: removing prompt "TERM = (hp)"

thanks all for the reply...

:)
tcsa
Frequent Advisor

Re: removing prompt "TERM = (hp)"

Can someone help me with terminal problem. I am using putty (telnet) to connect to the testdrive servers that are running HP-UX. I am not able to use any key to delete line or a character, or a word on the prompt. Any help will be really appreciated.
Determination is key for success.
Bill Hassell
Honored Contributor

Re: removing prompt "TERM = (hp)"

> any key to delete line or a character, or a word on the prompt.

Not sure what you mean. The testdrive systems are setup to use the POSIX shell which is just like Korn shell or Bash. You delete characters with the backspace key. Verify that stty reports: erase=^H

Now if you have setup your PuTTY configuration to login to a Tru64 system, then the delete key is probably mapped to your backspace key.

Also make sure you put this line of code in your .profile:

exec $(ttytype -s)

That ensures that whatever you setup as a terminal emulator, it will be (or should be) automatically identified.


Bill Hassell, sysadmin
tcsa
Frequent Advisor

Re: removing prompt "TERM = (hp)"

I was referring to ctrl+u, ctrl+h, backspace.

I tried the "env" cmd to verify the value fo ERASE
I saw this "ERASE=^H"
When I try to use backspace key it gives me just a new prompt.

But when I login to the Linux test drive server, I don't have any problem. Backspace, ctrl+u, ctrl+h work.
Determination is key for success.
Dennis Handly
Acclaimed Contributor

Re: removing prompt "TERM = (hp)"

>tcsa: I was referring to ctrl+u, ctrl+h, backspace.

As Bill said, use "stty -a" to see what is set by default. Typically the defaults may be "@" and "#".

>I tried the "env" cmd to verify the value of ERASE I saw this "ERASE=^H"

I have that set but it probably does nothing. Possibly useful if you enclude it in an echo?
tcsa
Frequent Advisor

Re: removing prompt "TERM = (hp)"

Here is the output for :

stty -a
speed 9600 baud; line = 0;
rows = 24; columns = 80
min = 4; time = 0;
intr = DEL; quit = ^\; erase = DEL; kill = @

**************************************

Here is the output for :

ttytype -s
TERM='vt100'; export TERM;
LINES=24; export LINES;
COLUMNS=80; export COLUMNS;
ERASE='^?'; export ERASE;

Determination is key for success.
Bill Hassell
Honored Contributor

Re: removing prompt "TERM = (hp)"

As you can see from the stty output, the settings for erase is DEL and kill is @. These are the archaic defaults leftover from the days of teletypewriters. Since you can't change /etc/profile on the HP-testdrive systems, just add these 3 lines at the top of your .profile:

eval $(ttytype -s)
stty erase "^H" kill "^U" intr "^C" eof "^D" -parity ixoff
stty susp \^Z dsusp \^Y


Bill Hassell, sysadmin
tcsa
Frequent Advisor

Re: removing prompt "TERM = (hp)"

Thanks Bill,

At least the backspace is working now. Not the ctrl +U or ctrl+H

Thanks again,
Determination is key for success.
Dennis Handly
Acclaimed Contributor

Re: removing prompt "TERM = (hp)"

>Not the ctrl+U or ctrl+H

I don't see how you can get one to work without the others.

I do know that several people at work have problems where backspace and ctrl+H don't work the same, like they do for me. This has to do with the terminal emulator they use. I believe on MS, there is an option to make them the same.

In addition to the commands Bill gave you, you should make sure those are conditioned so you don't do them if you are not interactive:
if [ "${-%%*i*}" != "$-" ]; then
ttytype ...
stty ...
fi
sanjayhp
Advisor
Solution

Re: removing prompt "TERM = (hp)"

Hi

in /etc/skel/.login file

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

also in /home//.login

comment same line


sanjay
Bill Hassell
Honored Contributor

Re: removing prompt "TERM = (hp)"

Dennis: I do know that several people at work have problems where backspace and ctrl+H don't work the same, like they do for me. This has to do with the terminal emulator they use.

Yes, this is a very common problem at HP since most HP people (that use a terminal emulator) are running Reflection for HP and the default settings for DEC/VT emulation is backspace = DEL. When I asked the reason, WRQ (now Attachmate) replied that most VT users are connected to DEC/Tru64/VMS type machines and as everyone knows, the delete key is supposed to erase the current character and move to the left. :-(

The erase setup is in the Setup -> Terminal -> Emulation box.


Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: removing prompt "TERM = (hp)"

> Dennis: if [ "${-%%*i*}" != "$-" ]; then

Or my favorite:

if tty -s
then
ttytype...
stty...
fi

which properly bypasses terminal-only code in /etc/profile and .profile when used from cron or batch.


Bill Hassell, sysadmin