Subject: Re: little things that bother me
To: None <port-cobalt@NetBSD.org>
From: Christopher Schultz <christopher.d.schultz@comcast.net>
List: port-cobalt
Date: 02/02/2005 15:17:16
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig2A9C5761409EC20CBCF0BA9A
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Justin,

> When i am ssh'd into the qube, and i am trying to edit a file in vi or
> vim, when i go into insert mode, for some reason it inserts a capital
> A when i press the up arrow, B for down, C for right, and D for left. 
> each character is inserted into a new line, and it can get quite
> annoying having to insert before the last character in a line, type it
> again, type what i need, then escape out of insert mode and delete the
> extra character

Sometimes this has to do with the terminal type that you're using. I 
know that the arrow keys typically send escape sequences to the 
terminal. If the terminal is set incorrectly, then the escape sequences 
can be interpreted incorrectly.

If you have a Linux box, you can see the escape sequences by running 
this from a terminal:

$ echo $TERM   <- tells me what terminal type I'm running
xterm
$ sleep 30     <- this just keeps the shell off you back while
                   you type some stuff

Then press UP, DOWN, RIGHT and LEFT.

This is the output that I get:

^[[A^[[B^[[C^[[D

So, UP => ^[[A
DOWN => ^[[B
RIGHT => ^[[C
LEFT => ^[[D

It looks like whatever terminal type you are using is stripping-off the 
escape sequences or otherwise misinterpreting them.

You can change your terminal type by just doing

$ export TERM=<terminal type>
or
$ setenv TERM <terminal type>

Depending on the shell you use (export for sh/bash, setenv for csh/tcsh, 
not sure about others).

'vi' should respect your selected terminal type. My Qube is currently 
not in service, so I can't check out what happens to me, or what my 
terminal type is on the Qube.

I home that helps,
-chris


--------------enig2A9C5761409EC20CBCF0BA9A
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCATVN9CaO5/Lv0PARAsQOAKDC58ViYVYRtgzPFpaz8kkpWdL7YwCdFLfd
H0LNwxWW9PBHZZ86cZDIRvw=
=tr6I
-----END PGP SIGNATURE-----

--------------enig2A9C5761409EC20CBCF0BA9A--