Vi Question


Forum: Apps
Topic: Vi Question
started by: adssse

Posted by adssse on Nov. 06 2005,16:26
When I am using Vi and am in insert mode some keys are not working right. When I press the up arrow it displays a 'A' instead of moving up a line and the down arrow displays a 'B' instead of moving down a line.  Also I have to ssh into a red hat server for school. When using vi on there the backspace key displays '^?' instead of backspacing. This happens on both my desktop and laptop. Not sure what other information to provide but any help would be appreciated.
Posted by clacker on Nov. 06 2005,16:58
Are you using dsl embeded?  I was having this issue about a year ago, and it was with dsl embeded.  At the time people thought it was a qemu problem since dsl worked fine from the live cd.
Posted by adssse on Nov. 07 2005,01:30
Nope, I am using a 1.5 frugal install on both systems. When I am using the other system over ssh I have always had that problem, but for some reason it doesnt happen on my windows machine. On my own dsl systems it hadnt done it before and I just tried it by starting a new file and it isnt doing it now. Kinda wierd. Any ideas?
Posted by supertrekkie on Nov. 10 2005,03:45
There's not problem, you're just using vi instead of vim. The original vi does not support the arrow keys or the backspace, just go to command mode and navigate or delete as needed. It may take some getting used to for the first few minutes, but after 10 minutes or so you won't even notice.
Posted by mikshaw on Nov. 10 2005,04:21
actually vi in DSL is vim, as far as i know...it just has some things not compiled into it to save space (and uses the "vi" command for some reason).
The backspace and arrow keys will work in insert mode, but i don't know exactly what causes them to not work in the default configuration. I'm guessing it has to do with .vimrc.  I copied mine from another system, and the settings in it allowed the use of backspace and arrows.

Posted by adssse on Nov. 11 2005,13:35
Thanks for the info guys. I have used the arrow keys many times before without problems, not sure what the deal was this time. But when I ssh to the red hat server at school and edit a file there using vi, I always run into the problem with the backspace. This problem doesnt seem to exist if I am using putty to connect from a windows machine. Is this some kind incompatibility issue?
Posted by RHTopics on Nov. 12 2005,20:05
When you run ssh, try using the "-t' option to force a pseudo tty allocation.  This may solve your problem.  Below is information from the man page for ssh describing what the "-t" option does:

Quote
   -t      Force pseudo-tty allocation.  This can be used to execute arbitrary screen-based programs on a remote machine, which can be  very useful, e.g., when implementing menu services.  Multiple -t options force tty allocation, even if ssh has no local tty.

Posted by adssse on Nov. 12 2005,21:06
RHTopics, thanks for the suggestion. Unforunately the '-t' didnt seem to make a difference.
Posted by adssse on Nov. 21 2005,00:07
Ok, I have finally had a little time to do some digging around and this is what I found out. As far as I can tell my problem is a tty configuration mismatch. On the Red Hat server that I am logging into for school 'stty -a' responds with (among other things), 'erase = ^H;'
In dsl running the same command the erase portion of the output reveals 'erase = ^?;' this seems to be the reason why when I backspace on the Red Hat server I am getting '^?' instead of it actually backspacing.
So I now know what the reason is for this, but dont really know what the best way to go about correcting this is...

EDIT:
It seems like I can set this using 'stty erase NN' (with NN being something like '^?' or '^H'), although I dont really understand the difference between the two or what ramifications this will have on the system.

Posted by adssse on Nov. 22 2005,02:04
I used 'ssty erase ^?' while logged into the red hat server and it corrects the problem. It only lasts that session, so it looks like I will need to do it everytime I log in, but I can deal with that. Just thought I would post in case someone runs into this in the future.
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.