Part One: Send the escape sequences appropriately from the terminal app
Part Two: Interpret them correctly at the other end
Part Three: Know how to use Page Up on an Apple keyboard
Part one involved opening up your terminal preferences, and finding the "keyboard" section. At the time of writing, this is in the profiles area, then over to the right of the .
You may or may not already have an entry for "Page Up" and "Page Down". It looks like a kind of double up arrow. If you've never been into these settings before, you shouldn't have one.
Hit the plus sign. You can now choose your key, your modifier, and your action. Page Up should be an available choice. The tricky part is not so tricky, and it is sending the right control codes. The first character is produced by hitting the escape key in the text box. It should produce something like \033. Following that (without any white space), type [5~. This is the control code for page up.
To add page down, the procedure is identical. The control code is [5~.
You have now completed part one. I chose not to use a modifier, because I don't feel the need to use page up and down for scrolling through the buffer (its normal use). You might like to use a modifier like control or apple-key.
> nano ~/.bash_profilethen add the following lines: