LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (http://www.linuxquestions.org/questions/%2Absd-17/)
-   -   End & Home keys for Bash on FreeBSD (http://www.linuxquestions.org/questions/%2Absd-17/end-and-home-keys-for-bash-on-freebsd-257114/)

mdixon 11-20-2004 01:10 AM

End & Home keys for Bash on FreeBSD
 
How do I configure the keyboard on a terminal session?

I connect to a new FreeBSD box via OpenSSH (in PuTTY). My shell is BASH. The Delete, End and Home keys just type a tilde ("~") instead of doing what I expect. How do I change this to make the End key jump to the end of the command line, the Home key jump to the beginning and the Delete key delete the currently highlighted character on the command line.

Software:
FreeBSD 5.3-RELEASE (i386 on a Pentium II)
PuTTY Release 0.53b / OpenSSH 3.8.1pl
GNU Bash 2.05b.0(1)-release

nixcraft 11-20-2004 03:54 AM

Here is my ~/.inputrc (create this file in your home dir); only works if your shell is BASH and add following two line :

Code:

"\e[1~": beginning-of-line
"\e[4~": end-of-line

You can also create /etc/inputrc system wide file.

nixcraft 11-20-2004 03:59 AM

Sorry i forgot to add delete key code:

Code:

"\e[3~": delete-char

mdixon 11-20-2004 05:44 AM

Thanks Vivek / Nixcraft. That works perfectly. :) Cheers, Mark.

chort 11-20-2004 08:57 PM

BTW ctl + a and ctl + e should work perfectly. I find them easier to use since I don't have to take my fingers off the home row.


All times are GMT -5. The time now is 08:50 AM.