Operating System - HP-UX
1838134 Members
4227 Online
110124 Solutions
New Discussion

Re: vi messed up on System Console

 
SOLVED
Go to solution
Laurie A. Krumrey
Regular Advisor

vi messed up on System Console

Hi All,

My web console won't let me do any vi stuff.
The TERM = hp. I think I should change
it to vt220 but I don't know how to do this
in borne shell.

When I type vi filename I get the file compressed all in one line, kind of hard to read and edit.

HAPPY SYS ADMIN DAY TO ALL...
Laurie
Happiness is a choice
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor
Solution

Re: vi messed up on System Console

Hi Laurie:

Try:

TERM=vt220
export TERM

...JRF...
Magdi KAMAL
Respected Contributor

Re: vi messed up on System Console

Hi Laurie,

You can do the following :
export TERM=vt100 or
export TERM=vt220

You wrote in your question :
TERM = hp

Attention : You don't need to write extra blancs between TERM and hp. Just like :
TERM=hp
export TERM

or

export TERM=hp

Good luck

Magdi
Steve Post
Trusted Contributor

Re: vi messed up on System Console

let's say you in vi and your screen gets messed up. If you're on the console this could happen as you get a console message.
control-L should reset the screen.

:e! will restore the your vi version of the file to the last time you saved it.

:q! will exit without saving changes.

:w /tmp/modded.file will save the file as modded.file in directory /tmp.
Bill Hassell
Honored Contributor

Re: vi messed up on System Console

I'm going to make an assumption that your web console is connected to an A- L- or N-class computer. In this case, HP has created quite a problem for you. All other HP-UX computers will query the terminal for the TERM type. However (for reasons that completely baffle me) the service processor codewriters and the HP-UX commands lab decided to violate the rules about how to determine the terminal type.

Here's how these boxes work: the default setting for the console connection is vt100 for the Guardian Service Processor or GSP. Now the GSP has nothing to do with emulating a terminal but the tset and ttytype programs were modified to ignore the actual terminal connected to the console port (on A/L/N-class) and instead, queried the GSP as to the termin type.

This is why HP service (and even some Response Center engineers) will tell you to turn off HP terminal capability on your 700/92 terminal and use EM100 (short for EMULATE VT100) so that when you login on the console, the cursor won't jump around and vi will work correctly.

What's happening is that regardless of the real terminal (in your case, the web console), the terminal ID programs (ttytype or tset) ignore the terminal and ask the GSP.

So here is are the two fixes:

1. Simple: change the emulation mode of your web console to vt100 and things should start to work better.

2. Better: Have your CE (or you can do it too) upgrade the GSP firmware on your machine to the latest level. Then use CTRL-B to get at the GSP, login (if not setup before, just press Return a couple of times), then type the command CA (Change Async) and use the default answers until you get to the terminal type. Change vt100 to hpterm, then default the rest of the answers.

Now exit out of the GSP and make sure your terminal is set to HP. Now login and all should work on the console. Then change the emulation on your web console to hp2392 and login again. The standard /etc/profile will ask for the terminal type via ttytype so $TERM will already be setup. vi should work fine now.

(BTW: You are probably not using the Bourne shell. The sh shell that ships as default on HP-UX is the POSIX shell which is a superset of the K-shell. Bourne shell is located at: /usr/old/bin/sh is you really want it--but NEVER change root's shell from /sbin/sh)


Bill Hassell, sysadmin
MANOJ SRIVASTAVA
Honored Contributor

Re: vi messed up on System Console

Hi Laurie


Also in the webconsole left hadn side command menu do the following :

Under Config , got to network and click the right arrow on the terminal type u will get 2 options

HP 2392
VT100

Change it to vt100 and you are all set to go .

Manoj Srivastava