Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
"\e[H":beginning-of-line
"\e[F":end-of-line
# rxvt and konsole (i.e. the KDE-app...)
"\e[7~":beginning-of-line
"\e[8~":end-of-line
"\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).

share|improve this question
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

...in your .profile.

share|improve this answer
    
I checked set and my TERM is already xterm. – Kuroki Kaze May 31 '10 at 9:40
    
Ah, if it's putty, then try the accepted answer to this: stackoverflow.com/questions/161676/… – Jeremy Smyth May 31 '10 at 9:52
    
I use different clients, not only PuTTY. Still, it seems I partially solved the problem. – Kuroki Kaze May 31 '10 at 10:04
up vote 1 down vote accepted

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

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .