It seems my FreeBSD console is misconfigured (i guess). I cannot use home or end buttons in command line (it prints ~), and in vi left arrow is switching me from edit to command mode, which makes editing a little difficult. How can I know what's wrong and fix it?

I'm not a root, by the way, I just hope it's something with my profile or bash configuration.

Shell version: GNU bash, version 4.0.35(0)-release (i386-portbld-freebsd8.0)

UPD: fixed home and end keys in console by creating ~/.inputrc and pasting this:

"\e[3~": delete-char
# this is actually equivalent to "\C-?": delete-char
# VT
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# kvt
# rxvt and konsole (i.e. the KDE-app...)
"\e[1;5C": forward-word     # Ctrl+right  => forward word
"\e[1;5D": backward-word    # Ctrl+left   => backward word

(solution from here)

Still, left arrow in vi bothers me, and I cannot install vim on the machine (maybe it's some vi quirk, idk).

  • 1
    Is this locally, or over ssh? – Jeremy Smyth May 31 '10 at 9:34
  • Over SSH. Client is NuSphere PHPEd embeded (though I may test with PuTTY). – Kuroki Kaze May 31 '10 at 9:42
  • No, PuTTY has the same problems. It must be server. – Kuroki Kaze May 31 '10 at 9:46
  • vi does not support arrow keys. When it was written, keyboards had arrows on HJKL keys. – grawity May 31 '10 at 18:22
  • Shouldn't vi use .inputrc stuff? I have another GNU/Linux box where arrows in vi work just fine. – Kuroki Kaze Jun 1 '10 at 10:17

You may find you can fix it all by doing something like:

TERM=xterm your .profile.

up vote 1 down vote accepted

Fixed by creating .inputrc file (see question update).

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.