FreeBSD: Customize Home, Del, Insert keys for BASH shell

November 15, 2010 by: upa_kid


By default when you use FreeBSD’s BASH shell and if you hit Home, Del, Insert keys all of them just prints ~ (some garbage is printed ). To get rid of this problem, edit /etc/profile file and define key binding.

1) Open your bash global profile file:
# vi /etc/profile

2) Add following line to it:
export INPUTRC=/usr/local/etc/inputrc

3) Close and save the file

4) Open the file /usr/local/etc/inputrc and define / modify key binding:
# vi /usr/local/etc/inputrc

5) Append following config data:

set meta-flag on
set input-meta on
set convert-meta off
set output-meta on

“\e[1~”: beginning-of-line
“\e[4~”: end-of-line
“\e[5~”: beginning-of-history
“\e[6~”: end-of-history
“\e[3~”: delete-char
“\e[2~”: quoted-insert
“\e[5C”: forward-word
“\e[5D”: backward-word

6) Close and save the file

7) Now logout and login back again to test your new key settings.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
Have you found this script useful? Please support author by PayPal donation.

Comments

One Response to “FreeBSD: Customize Home, Del, Insert keys for BASH shell”
  1. Hi there, just doing some browsing for my Augusta 4g website. Can’t believe the amount of information out there. Wasn’t exactly what I was looking for, but interesting page. Have a nice day.

Leave a Reply