Operating System - HP-UX
1755515 Members
4899 Online
108834 Solutions
New Discussion юеВ

Re: Vi editor problem when using SSH

 
SOLVED
Go to solution
Kevin Westover
Advisor

Vi editor problem when using SSH

I installed HP's SSH product on my RP8400 running 11i and now when I edit files with vi the screen display is not right. The top line of the text file being edited begins at about 10 lines from the botom of the screen. The top half to 3/4's of the screen is just blank. All editing functions seem to work fine. I have tried 2 different SSH client programs and the results are the same. Any ideas? Thanks.

Kevin
9 REPLIES 9
James Specht
Trusted Contributor

Re: Vi editor problem when using SSH

We use putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/) as our client and it works just fine...except for the function keys are a little flaky.

--Jim
"Everyone can be taught to sculpt: Michelangelo would have had to be taught how not to. So it is with the great programmers."
Elmar P. Kolkman
Honored Contributor

Re: Vi editor problem when using SSH

The problem has nothing to do with your ssh software, but with the terminal (emulation) on the machine you run the client and the kind of terminal the server thinks you have.

First make sure what terminal program you use on the client side. For instance, putty (a freeware ssh client for windows) can run as vt100 or xterm.

Then take a look at your TERM environment variable on the server and make it match (vt100 or xterm when using putty, for instance).

Then it should work like you want.
Every problem has at least one solution. Only some solutions are harder to find.
RAC_1
Honored Contributor

Re: Vi editor problem when using SSH

check TERM.

export TERM=vt100.

Also check LINES and COLUMN settings.

env to get these values.
There is no substitute to HARDWORK
Sanjay_6
Honored Contributor

Re: Vi editor problem when using SSH

Hi Kevin,

Try some different TERM entries.

export TERM=vt220
also export the editor and try,

export EDITOR=vi

Hope this helps.

Regds
Mark Greene_1
Honored Contributor

Re: Vi editor problem when using SSH

look at the output of stty -a and see if rows and columns are specified.

I am running Exceed as my xwindows emulator, and here's the stty settings that I have found to work best:

speed 9600 baud; line = 0;
rows = 44; columns = 133
min = 4; time = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U
eof = ^D; eol = ^@; eol2 ; swtch
stop = ^S; start = ^Q; susp ; dsusp
werase ; lnext
parenb -parodd cs7 -cstopb hupcl -cread -clocal -loblk -crts
-ignbrk brkint -ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon -ixany ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
-echoctl -echoprt -echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop

See also the man pages for resize and tset.

mark
the future will be a lot like now, only later
Jeff Schussele
Honored Contributor

Re: Vi editor problem when using SSH

Hi Kevin,

If the $TERM setting matches OK you may just need to resize the screen - try the command

resize

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Kevin Westover
Advisor

Re: Vi editor problem when using SSH

It turns out the root login had an environment variable in it's .profile called UNIX95 set to true. This seemed to be causing the problem because when I commented it out, the vi problem went away. Anyone know what the environment variable UNIX95 does? This same .profile file was working fine on an N4000 running HPUX 11.00.

Kevin
Steven E. Protter
Exalted Contributor
Solution

Re: Vi editor problem when using SSH

UNIX95 lets you take advantage of some enhanced unix functionality. It also messes up the sh command for unsharing depots.

UNIX95=1
export UNIX95

ps -efH | grep root

This will return an enhanced ps output that indents child processes making them easier to spot. This is one of many features you get by setting UNIX95

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Hassell
Honored Contributor

Re: Vi editor problem when using SSH

A little moe about UNIX95: DON'T set it unless you've searched through all the mqan pages and docs for all your current and future programs. It changes features and behaviors for libraries and programs but as you've seen, an entirely unexpected behavior was introduced by setting it in a profile.

To avoid all the side effect, use it only for the duration of a command such as ps:

UNIX95= ps -e -H

A lot of sysadmins misunderstand the defining of a variable on the same line as a command. It works just fine. Setting UNIX95 equal to nothing defines the variable name, and according to XPG4 standards, that's all that is necessary. See the man page for ps, particularly options -H -C and -o. So avoid lots of future problems and only use UNIX95 for specific commands based on the manpage.


Bill Hassell, sysadmin