I just switched from using Apple’s built-in Terminal.app to the free iTerm 2 on a recommendation from Brett Terpstra. I’m already loving the hot-key profiles to launch uniquely colored remote sessions, the split panes, and the brilliant hotkey window (useful to run a single command and get rid of it).
But there are a few things that needed some work. Some of the usual Mac editing keys did not work, I got rid of a few annoyances and added a few lovely preferences, and I needed the ability to create a new terminal window on the current space as part of my being productive with virtual desktops flow (Just like Browser Windows on All Desktops).
Since I’m not a
emacs pianist, I prefer standard Apple Cocoa Text bindings when editing the command line, so I set them up in iTerm 2’s Global Shortcut Keys in Preferences / Keys.
The changes and settings are:
- ⌥←: Go left one word (Send Escape Sequence | b)
- ⌥→: Go right one word (Send Escape Sequence | f)
- ⌘←: Go to start of line (Send Hex Code | 0x01)
- ⌘→: Go to end of line (Send Hex Code | 0x05)
- ⇧⌘↑: Up one page
- ⇧⌘↓: Down one page
- ⌃⌘↓: Down to bottom (not standard Cocoa, but I find it very useful when perusing real time rails logs)
Thanks to Brett Terpstra for sharing some of these in his Option-arrow navigation in iTerm2 and Twitter. Note: I do not set the Left Option and Right Option keys in profiles to
+ESC, I leave them as
Normal (as per Scott Lee’s response in the comments).
Annoyances and Preferences
I don’t need to confirm quitting (Preferences / General):
I love copy on select, it’s one less keystroke and I usually select with the mouse (Preferences / General):
The red tabs were annoying, gone (Preferences / Appearance):
Added the border around frames, I like this because my terminal background and screen backgrounds are both dark (Preferences / Appearance):
And got rid of the bell icon and Growl notifications in all profiles (Preferences / Profiles / ** / Terminal):
And lowered the line spacing to match Apple’s (Preferences / Profiles / ** / Text /
Change Font) - just move the vertical back 1 notch:
New iTerm 2 in Current Space
While it’s nice to have the hotkey window, I often find myself working on Desktop 1 (Work) and need to jump to Desktop 2 (Alternate) to do some other stuff and leave a terminal running there. Like now, for example, I have a database migration running on Desktop 1 for Kifu and am blogging on Desktop 2, both of which require running iTerm 2 windows.
If you hit ‘⌘N’ on iTerm 2 (or any other OS X app), OS X switches you to the app’s desktop, then creates a new window over there, not what I want. If you right-click on the dock and request a new window, it creates it on the current desktop. But I leave my dock hidden.
The first step, the AppleScript code, launches a new “Default” terminal, and it does so on the current space:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
The second step resizes the window so that it is 100 x 42 lines, my personally preferred terminal window size.
So far, I am really enjoying the small touches that make iTerm 2 that much better than Terminal.app.
Related Reading: Fast SSH Windows With iTerm 2