Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bash end-of-line and beginning-of-line not working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
fIREfox
n00b
n00b


Joined: 30 Oct 2002
Posts: 12

PostPosted: Tue May 13, 2003 5:39 pm    Post subject: Bash end-of-line and beginning-of-line not working Reply with quote

Something that was peeing me off for a time was bash's apparent unwanting to move the cursor to the start/end of the line when hitting the home or end keys. It was the same regardless of the user I logged in as and as on the terminal aswell as over ssh.

I finally found the 'problem' to be in the /etc/inputrc script, first make a backup of the default file :

Code:

mv /etc/inputrc /etc/inputrc-orig


then create a new file from a 'basic' layout I found through google :

Code:

# Begin /etc/inputrc

# Make sure we don't output everything on the 1 line
set horizontal-scroll-mode Off

# Enable 8bit input
set meta-flag On
set input-meta On

# Turns off 8th bit stripping
set convert-meta Off

# Keep the 8th bit for display
set output-meta On

# none, visible or audible
set bell-style none

# All of the following map the escape sequence of the
# value contained inside the 1st argument to the
# readline specific functions

"\eOd": backward-word
"\eOc": forward-word

# for linux console
"\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

# for xterm
"\eOH": beginning-of-line
"\eOF": end-of-line

# End /etc/inputrc


Finally, re-login and home/end is now happily working. I havent noticed any adverse effects is any other text editors [ I use nano and vim ] :)
Back to top
View user's profile Send private message
Safrax
Guru
Guru


Joined: 23 Apr 2002
Posts: 422

PostPosted: Wed May 14, 2003 11:23 am    Post subject: Reply with quote

I've been looking for a solution to that problem for quite some time now. Thanks for posting this solution!
Back to top
View user's profile Send private message
arlequin
l33t
l33t


Joined: 16 Nov 2002
Posts: 707
Location: grep $USER /etc/passwd | cut -d':' -f6

PostPosted: Wed May 14, 2003 11:28 am    Post subject: Reply with quote

You can use 'Ctrl + A' and 'Ctrl + E' to move to begin/end of the line.
Thanks for the tips :wink:
_________________
J'vous dis ciao !
Au fait, ciao ça veut dire bye en anglais.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum