OS X Default keys

25 February 2008, 12:53 CDT

Some default key bindings in OS X are, honestly, annoying. Especially the home/end keys. Of the “big three” desktop OSes, Mac seems to be the odd man out. Most windows/linux applications treat home/end the same way. In the OS X terminal application, the home key sends you to the top of the scroll buffer. The end key sends you to the end of the window’s scroll buffer. Not the expected behavior. Home means “home” – the beginning of the line. End means “end” – the end of the line. Pgup and pgdn are supposed to serve to move in large chunks around the buffer. I can’t count the number of times I’ve hit the end key expecting to get to the end of the line (like while I’m typing this post) and instead get the end of the buffer. Highly annoying to have my work interrupted by this constantly. Instead of me trying to learn how to use yet another interface/computer, I’m making the computer learn this time.

Here is how to remap the home/end keys in the terminal application

Terminal>Window Settings>Keyboard

end:

\033[4~

home:

\033[1~

the 033 part can be obtained by ^[ (aka ctrl+[ )

After doing that, you need to modify (or create) your .inputrc file to contain the following

# Be 8 bit clean.
set input-meta on
set output-meta on
set convert-meta off
# allow the use of the Home/End keys
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# allow the use of the Delete/Insert keys
"\e[3~": delete-char
"\e[2~": quoted-insert

Restart the terminal and you’ll be good. Firefox, however still acts whacked out. That one is more complicated.