Fixing terminal page up and page down

If you use a windows ssh terminal client, or even macosx’s terminal.app, the functionality of your page up and page down key may not behave like you want it to. For example, in SecureCRT using pageup will actually page up your scroll buffer, and pagedown will scroll down your page buffer.

You’ll need to remap your keys to send the correct signal to your terminal. Change it from the default system function to “send string” and the following strings:

PageUp = \033[5~
PageDown = \033[6~

\033 is a shortcut for the ESCAPE key (esc) since in some programs you can’t type in the actualy escape key.

Here are some other codes as well in case you need to remap keys.

Pause = \032
Macro = \003 # Break (Shift-Pause)
Home = \033[1~
Insert = \033[2~
Remove = \033[3~ # Delete
End = \033[4~

In SecureCRT the area to remap your keys is Tools -> Keymap Editor.

This is especially handy if you use command line IRC clients such as Irssi or BitchX.

Share and Enjoy:
  • Twitter
  • del.icio.us
  • Digg
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Print
  • StumbleUpon

1 Trackbacks

  1. [...] is a useful piece on how to get Mac OS X’s terminal to forward Page Up and down to the [...]

7 Comments

  1. zoja

    How about just using shift+fn+pgup/pgdown, which seems to go thru to the program as page up? :)

    Posted July 22, 2007 at 3:17 pm | Permalink
  2. thanks . very helpful

    Posted August 16, 2007 at 3:49 pm | Permalink
  3. amazing! thank you so much for this tip! This is one of the main things that has been keeping me off of os x!

    Posted October 30, 2007 at 11:40 am | Permalink
  4. This is very helpful. I’ve forwarded it to many of my co-workers.

    Posted November 20, 2007 at 7:39 pm | Permalink
  5. todd

    IS there a way to map these to windows mobile. I use irssi within pocketputty but cant do page up / page down :(

    Posted April 14, 2008 at 2:33 am | Permalink
  6. Chrome

    Yay, great, thanks! That solved my terminal –> screen –> irssi problem!

    Posted May 20, 2008 at 7:48 am | Permalink
  7. james

    Worked great for me! thanks so much, back to my terminal again!!

    Posted July 30, 2008 at 12:01 am | Permalink