Monday, March 27th, 2006...5:18 pm
HOWTO: Make Terminal.app behave properly
This is just a pet peeve I have with Mac OS X’s Terminal.app. PageUp, PageDown, Home, and End control the line buffer saved in Terminal.app, but doesn’t control those features in whatever program you’re using.
For example, if you’re using vim, emacs, or you’re ssh’ed into another computer and using a command-line irc client (in my case, irssi), you may want the “page up” command to be sent to that program. Holding down Shift *should* make this work, but on my MacBook Pro it doesn’t (maybe because I also have to hold down fn?).
Anyhow, open up a terminal, go to the Terminal menu, and select “Window Settings”. Select “Keyboard”, and now you can see all of the actions for various key commands.
We’re trying to set the following keys to do these actions:
- PageUp = “\033[6~”
- PageDown = “\033[5~”
- Home = “\033[1~”
- End = “\033[4~”
Unfortunately, it’s not that easy. If you go find the PageUp key and click on “Edit”, you may notice that when you try to type a backslash (\) it enters a double backslash (\\). Also can’t use your delete key to edit the string.Do the following:
- Find the key “F20″ and click on “Edit”
- Highlight the String (\033[34~) and hit command+c to copy it.
- Close the window -Find “PageUp” and click on “Edit”
- Make sure the “key” is PageUp, the “Modifier” is none and the “Action” is send string to shell:
- Hit command+v to paste the string from F20 into the box.
- Use the “delete” button in the window (NOT on your keyboard) to delete the last 3 characters. (3, 4, and ~)
- Enter in “6~” (you will have \033[6~ when you are done)
- Hit “ok” and the window will close
- Click “Use Settings as Defaults” to keep your changes.
- Repeat process for PageDown, Home, and End (the string will be different, see above listing).
Again, don’t forget to save your settings as deafaults otherwise new terminals won’t have the same settings.
Enjoy your (now working) Terminal.app.
If you need to scroll up or down in Terminal.app ’s buffer, use the slider or arrows on the right, or you can hit command+up arrow or command+down arrow on your keyboard.
This works on Mac OS X 10.4.5 with Terminal.app version 1.5 (133)
Comments are closed.