Some Handy Terminal.app Crud
Thomas Ingham | 08-17-08Recently we’ve been doing a bunch of stuff that has required the use of the terminal. This includes interacting with some Sqlite databases as well as our normal pattern of server work. It’s been incredibly frustrating because for whatever reason the Terminal.app configuration that ships with every Mac doesn’t really play that nicely with the remainder of the Cocoa Text System.
So… dilemma; how to make Terminal.app work like say, BBEdit?
Here are a couple of really simple things you can do with the Leopard Terminal.app profiles to speed up your day.
Setting up Terminal.app to use option-left and option-right to move words:
- Open Terminal.app and crack open the preferences for the application (Apple+Comma)
- Choose whichever profile is your default style (I like homebrew but I’m old.) Then select the “Keyboard” tab.
- In the cryptic list of settings (one wonders why they don’t use the configurator from XCode) there is a plus button at the bottom of the window, hit that sucker.
- In the dialog that pops up, set the first drop-down to “cursor left”
- Set the second drop down to “option”
- Set the third drop down to “send string to shell:” (way to be consistent with the capitalization of stuff, Apple tech)
- In the text field simple Press the Escape key. Then type a lower-case b
- Hit the Ok button and switch to your terminal window to test by typing out a harmless sentence and then Press (Option+Left Arrow), voila!
- Go back to the keyboard settings tab and do the same for “cursor right” only this time, use a lower case f instead.
Getting back to the start quickly using the Home and End keys.
We do a lot of SQL here at Coalmarch. Anyone that does a lot of SQL knows that the first bits of the query when doing select statements are usually the ones you end up modifying the most (the field specifiers.) Getting back to the front of your string quickly is therefore of a fairly high priority. Control+A will take you there, but who in the world can remember that shortcut when really you just want Apple+Left arrow to take you to the front of the line? Well, you can’t bind the Apple key in terminal so instead I use the Home and End keys.
- Add a new entry for the “home” key with no modifier.
- Send the following string to the shell:
- Ctrl+A
- For the end of line, use Ctrl+E in tied to the End key.
Case Insensitive Completion in Terminal.app
- Open a new terminal window.
- Paste in: echo “set completion-ignore-case On” >> ~/.inputrc
- Love your tab key to death like a feather stuffed monkey.
These little shortcuts speed up my keyboarding quite a bit; (it’s way faster than Escape-Delete, Escape-Delete, retype broken bit, retype what I just deleted..) Hopefully they’ll be of some use to somebody else out there in the interwebs.

Comments
Thanx! Just what I was looking for…