I recently switched from Apple’s Terminal to iTerm. At first, it was just an experiment, to see if iTerm was really usable. I’ve used iTerm before, but it was some years ago, and at the time it was buggy, slow, and unstable. I’m glad to report that it has grown by leaps and bounds, and is now my full-time terminal.
Things I find superior to Apple Terminal:
Real xterm keys
I didn’t realize I was missing these before I had them again. I’ve used
xterm and similar (e.g. rxvt) in the past, of course, but it’s been
some time. Xterm passes through keys like
PageDown, and most
unix programs know how to use those keys (Vim, for example).
Apple Terminal uses
PageDown for moving through your scrollback
buffer. You can send
PageDown through to your session, but only
Shift to the mix. That works, but I found I never used it. In fact,
I didn’t really remember if it worked; I just had to fire up Terminal and test
it to be sure it worked.
You can send
End, function keys, etc., in this way as well. iTerm
lets you define custom key maps if you need to (though I haven’t).
Support for up to 256 colors
Another thing I wasn’t aware I was missing. It took a bit of finagling, and on
Solaris systems I needed to add an entry for
xterm-256color in my
$HOME/.terminfo directory, but I can now support 256 colors in my terminal
sessions. I use this for my shell prompts and Vim, primarily, but you can use
extended color support in other programs as well, like Emacs or Mutt.
Particularly when colorizing code in a text editor, you’d be surprised what a
difference this makes. The default palette of 16 colors just doesn’t cut it.
Compare these two editing sessions. On the left is Vim in its default color scheme, using 16 colors. On the right is a 256-color supported session using my favorite colorscheme, zenburn.
Call me crazy, but if I’m looking at something all day, I’d rather it look like the one on the right.
Here are two shell prompts. These use the same
$PS1 value in bash, but
one uses color and one doesn’t.
It’s very easy for me to spot commands in my scrollback buffer. They stuck out like sore thumbs.
Also, the colors help with certain visual cues. The green
(master) is the
current branch if I am in a Git repository. The color draws my attention
Next to the
$ input prompt are two bracketed numbers. The one on the right is
a count of current background jobs. It uses orange to make itself noticeable
(and being right next to the place I’m typing doesn’t hurt either). The number
to its left is the value of
$? (the exit code of the last command). If it’s
anything other than zero, it turns bright red to draw my eye to it.
This prompt packs a lot of useful information into a small area, and uses color to help draw my attention where I want it to be drawn. The numbers go gray when they aren’t of any use (when they are zero). The git branch vanishes if I’m not in a git repository.
iTerm has an option to set the zoom button to maximize the window vertically
only. I used to have to do this with an Applescript, but now all I need to do
is click the green bubble in the title bar, or hit a key combo that I’ve bound
Zoom menu command. Perfect.
Visible status for background tabs
When you have multiple tabs in an iTerm window, they will show you an indication of what’s happening using color. Normally a tab’s title is black. If the session dies, it turns gray. If there is output coming through, it turns violet, and if that new output stops, it turns red.
This turns out to be very useful to keep track of things going on that will take a while, or output intermittently. For instance, running a long make, or tailing a log file.
iTerm is free, so why not give it a try?