Changing KeyBindings on Mac Terminal

From Mavaball

Jump to: navigation, search

This page describes how to change the Home/End/PageUp/PageDown keys in Mac OS X Terminal to behave as you'd expect in Linux or Windows.

(I got these notes from Keybindings in Mac OS X’s Terminal.app).

By default in Mac OS X, these keys just move the current view around without sending the keys to the ssh session you're in. To make them send the Home/End/PageUp/PageDown keys to the ssh session, make the following changes

These instructions apply to OS X 10.5 and may be different in other versions:

  • Open Terminal.app (usually in the /Applications directory)
  • Go to Terminal->Preferences...->Settings->Keyboard and make the following changes by selecting the appropriate key and clicking "Edit":
Key Escape Sequence
End \033[4~
Home \033[1~
Page-Down \033[6~
Page-Up \033[5~

It's a little tricky to enter this sequence. The \033 character is the 'Esc' key, and you have to press 'Esc' to get it (don't literally type "\033". The other characters can be typed directly (e.g., "[" "4" "~" for End).

After these changes, you'll get the expected Linux/Windows behavior for these keys.

Personal tools