Weird key bindings in vi in an ssh session

Asked by Mitch Claborn

I support a number of systems remotely, and often find myself using vi in an ssh session to edit various files. In some cases, but not all, when I press the up arrow (in insert mode) I get a capital letter A and a new line instead of the cursor moving up. Other arrow keys have similar issues. This only seems to be a problem when in insert mode.

On other systems, the arrow keys work as I want them to, moving the cursor.

I can't figure out what causes the weirdness.

Any ideas?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu vim Edit question
Assignee:
No assignee Edit question
Solved by:
Mitch Claborn
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What are yuo using to connect to the SSH service?

Revision history for this message
Mitch Claborn (mitch-news) said :
#2

Command line ssh:
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

tried in putty, is it the same?

Revision history for this message
Mitch Claborn (mitch-news) said :
#4

Yes, it behaves the same when when I use putty.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

I suggest you report a bug with openssh-server

Revision history for this message
Mitch Claborn (mitch-news) said :
#6

Out of curiosity, why do you think it is a bug with openssh-server as opposed to the ssh client or vi?

Revision history for this message
Mitch Claborn (mitch-news) said :
#7

Just had an epiphany: This only happens when I connect from a 64 bit machine to a 32 bit machine. If both are 64 or both are 32, it works fine.

Given that, I'm going to move this question to openssh-server and maybe open a bug if I don't find an answer there.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#8

Try:

sudo wget -O /usr/bin/ssh32 https://dl.dropbox.com/u/8850924/ssh

May help, that's the ssh binary from my 32bit OS, may work.

Revision history for this message
Mitch Claborn (mitch-news) said :
#9

Tried that, did not help.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#10

did you try running:

ssh2 -C -X user@server

To see if it runs ok?

If its no good I suggest you report a bug and report your findings.

Revision history for this message
Mitch Claborn (mitch-news) said :
#11

I don't have an ssh2 program, only ssh. Is that a typo?

ssh -C -X did not help.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#12

You will have made it after you ran the command I gave.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#13

Please also try to install on the remote systems the vim-full package

Revision history for this message
Mitch Claborn (mitch-news) said :
#14

Marco - I could not find any such package to install.

Revision history for this message
Mitch Claborn (mitch-news) said :
#15

Marco - the package I needed was "vim". The systems I was having trouble with were desktop systems that only install vim-tiny. Installing vim on the remote system fixed this problem, for both 32 and 64 bit systems.