Keybindings in Mac OS X 10.4's

I use PINE as my email client.

Why are you living in the late 1970s?” you ask.

But I’ll refrain from answering that question for now. And I’ll even refrain from correcting you in that PINE wasn’t available until 1989.

And, so, in fighting the ongoing war against email, I tend to spend a lot of my day interacting with Mac OS X’s I SSH into one of our Fedora Core Linux servers and run PINE there.

The default keybindings used by leave a bit to be desired, however

– particularly when editing in a visual editor such as PINE’s PICO. Home, End, Page-Up, and Page-Down – as is typical on Mac – all modify the viewport, but not the location of the cursor. And, coming from using X-Window on Linux for the last twelve years, I’m a bit frustrated when pressing Home whisks me to the beginning of the buffer, rather than the beginning of the current line I’m editing.

It’s actually pretty easy to modify the keybindings – go to Terminal / Window Settings / Keyboard – but you need to know the right escape sequences.

Here’s what I find useful to replace:

Key Escape Sequence
End \033[4~
Home \033[1~
Page-Down \033[6~
Page-Up \033[5~

Page-Up / Page-Down Before: Page-Up / Page-Down After:
Keybindings, before Keybindings, after

Much better.

Steve Mokris is a developer at Kosada, Inc.



It’s important to note here that you cannot simply type “\033” to get the escape character. Typing ” gives you 2 backslashes in the box: “". To get the \033 part you need to press escape (esc) or type \033 and then use fn-delete to remove one of the extra slashes.


Right. Also, you can just cut-and-paste from the table above, or from another keybinding entry.


I’m a Mac user, and although I haven’t used Pine in a few years, I loved it when I did, especially its “select” functions and automatic monthly archiving. Found your page while looking for a way to get page up/page down to work after a terminal window has exited, and although this isn’t that, I can think of a few places this tip could come in handy. Thanks!


The page-up/page-down thing is driving me crazy, too. I’m using OS X 10.2.8, and there is no “Keyboard” option under Terminal, Window Settings (I am guessing because this was added in a newer version of Terminal). Do you know of another way to change the keybindings?


Eugene -

Yikes, I haven’t used 10.2 for three years.

On 10.4, stores its preferences in ~/Library/Preferences/ Inside, there’s a “KeyBindings” section. It looks like page up and page down are keys “F72C” and “F72D”, respectively. If these keys exist in 10.2’s plist, you might be able to set their values to those I described in the original post.



the home and end values in the table do not work for 10.5. check out the shift-home and shift-end.

on 10.5 I got this from infocmp (good old terminfo utility):

$ infocmp -L|grep cursor cursor_address=\E[%i%p1%d;%p2%dH, cursor_down=^J, cursor_home=\E[H, cursor_left=^H, cursor_right=\E[C, cursor_up=\E[A, delete_character=\E[P, parm_down_cursor=\E[%p1%dB, parm_left_cursor=\E[%p1%dD, parm_right_cursor=\E[%p1%dC, parm_up_cursor=\E[%p1%dA, restore_cursor=\E8, save_cursor=\E7, scroll_forward=^J, $

which means: use \E[H for home key

Don’t ask me why the end key is missing in terminfo.


Thank you, thank you very much !

I was looking for it for many hours, that’s work perfect.

Do you know if I is possible to change the Tab’s moving keys. Actualy use Cmd+Alt+( and Cmd+Alt+), I prefer to use Shift+LEFT and Shift+Right if it’s possible.

Thank’s again.


Thanks so much! This makes os x livable for me.


on 10.5.6 I needed to use the (esc) key in order to get the escape command for the home and end keys, and then use the modifier as per ¼rgen’s comments above. So home became: 33[H And end became: 33[F Copy and paste does not always work, so the (escape) key function is useful.


Here’s the thing that’s making me crazy: cmd-w in Terminal kills the tab. ctrl-w in pine searces for stuff in your email. I keep accidentally killing the Terminal tab in which I’m running pine. How do I change this key binding in Terminal, I wonder. Sigh…