Fixing Home, End, and Page Up/Down keys in OS X terminal

The Home, End, Page Up and Page Down keys in Terminal don’t work as you would expect if you’ve come from the land of PCs. To get them them working “properly” again open up Terminal and go to the Preferences dialog. Click on the Settings button at the top and then the Keyboard tab. Change the action for each of the keys as show in the following table.

Key Old Action New Action
home scroll to start of buffer 33[1~
end scroll to end of buffer 33[4~
page up scroll to next page in buffer 33[5~
page down scroll to previous page in buffer 33[6~