Page 1 of 1

Arrow Keys not working in vi on Ubuntu 16.04 LTS

Posted: 3. May 2016, 17:24
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

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

Posted: 3. May 2016, 18:44
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.

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

Posted: 3. May 2016, 19:28
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