« Is the NEW media distribution method like FreewareBiting the bullet »

Laptop HOME key produces ~ (tilde) in shell

I recently installed Slackware 10.2 on my Acer Extensa 368T laptop. The installation went fairly smoothly except that I noticed the HOME key produced a ~ while in a shell.

I had an idea that this was just a miss-mapped key so I started looking around. While many people had posted solutions, for MY situation, they didn't work.

Most of the solutions stated that you should ensure that the line:

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

Appeared in my /etc/inputrc or .inputrc. This was already the case so I was somewhat confused.

Follow up:

Some more digging says that readline is the thing responsible for the interaction. A handy tip (http://www.cygwin.com/ml/cygwin/2003-12/msg00079.html
)
from the cygwin mailing archive provided some help.

Basically, if you press CTRL-V, followed by the questionable key (in this case the HOME key) it will display the scan "value" of that key. In my case it displayed ^[[7~. This would be entered as \e[7~ in your inputrc file. So, while most people (and indeed Slackware's default /etc/inputrc file) seemed to suggest that \e[1~ was the HOME key, at least for my laptop it is \e[7~.

Interestingly enough, I have a Mandrake 10.1 system and in it's /etc/inputrc \e[7~ IS the value set for beginning-of-line. Go figure.

One other thing I noticed too is that on Slackware 10.2 at least, it appears that if a .inputrc file exists in your home directory, the /etc/inputrc file is ignored. This isn't totally unexpected however other config files are like this also. Just don't assume that you'll still have all the /etc/inputrc entries when creating a .inputrc.

As a side note, CTRL+A and CTRL+E do indeed perform the same operations as HOME and END respectively. This is actually faster and easier if you are typing as you've already got your left hand over the home keys. It is therefore simply a matter of little-fingering the CTRL and then either ring-fingering the A or index-fingering the E. As usual with Linux, it's up to you!

So anyway, if you have this problem like me, just add this to your /etc/inputrc file:

"\e[7~": beginning-of-line

OK, that's it for now.

Permalink 17/02/06 12:34:46 am, by Todd Harbour Email , 359 words, Categories: Hardware, Linux , Leave a comment »Send a trackback »

Trackback address for this post

This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

No feedback yet

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

You can just use your OpenID to provide your name, e-mail and url.