Arrow Keys not working in vi on Ubuntu 16.04 LTS

Discussions about using Linux guests in VirtualBox.
Post Reply
Chris6502
Posts: 2
Joined: 3. May 2016, 17:08

Arrow Keys not working in vi on Ubuntu 16.04 LTS

Post by Chris6502 »

Hi,

I'm running the latest Virtual Box 15.0.20. I have a CentOS system running fine. I recently installed the new Ubuntu 16.04, using all the default options (Engligh, English keyboard, etc). Everything works fine, except when I run vi (vim) and use the arrow keys in Insert mode, I get "A", "B", "C", and "D" with erratic cursor movement. $TERM is set normally, as "xterm-color256"

Any ideas on how to fix this?

Thanks,
CHRIS
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Arrow Keys not working in vi on Ubuntu 16.04 LTS

Post by Perryg »

Not a VirtualBox issue. You need to fix this at the OS level. Search for "vi arrow key in insert mode" in your favorite search program.
Chris6502
Posts: 2
Joined: 3. May 2016, 17:08

Re: Arrow Keys not working in vi on Ubuntu 16.04 LTS

Post by Chris6502 »

Well, I guess 'vim' isn't installed by default. This was happening with 'vi'. Before I saw your post, I installed vim (sudo apt install vim) and the problem went away. Not sure what fix you're referring to; doing a search seemed to indicate that I should create a .vimrc file with "set nocompatible" in there. Never got to that point, since issue was fixed by installing vim.

Thanks, I think.

-- CHRIS
Post Reply