Mac OS X may have a friendly, easy-to-use interface, but underneath that appealing UI is Unix. Which means OS X also has a shell—a command-line interface. Most Mac users who’ve accessed the shell, perhaps to enter a command they discovered on Mac OS X Hints, have done so using OS X’s Terminal utility (located in
/Applications/Utilities). But if you frequently use Terminal, and most of that use is for quick, in-and-out tasks, check out DTerm
(Mac App Store link), a nifty utility that provides instant access to a Terminal-like shell interface from within whatever application you’re currently using. I originally reviewed DTerm 1.0.1 back in 2008, but it’s gained quite a few features—and a new, low price—since then.
With DTerm running (it can run either as a standard application or as a background application that doesn’t appear in the Dock) you press a user-defined keyboard shortcut and a small, command-line dialog appears on the screen. (Depending on the active application, DTerm’s dialog appears either at the top of the active window or just below the menu bar.) Type or paste your command—DTerm supports the
bash shell’s autocomplete feature for commands and paths—and press return, and the command or program is executed, with any results displayed in just below. When you’re done, press Escape, and DTerm disappears—you can get right back to work. DTerm is ideal for simple commands and for running command-line programs that don’t require much interaction.
But DTerm offers a number of features designed to make it even more convenient. For example, if the active window is a document or a Finder window, DTerm sets the shell’s current working directory—the “active” folder in the shell—to the location of the document or Finder folder, respectively, displaying that path at the top of the DTerm dialog. DTerm also provides an option to insert, in your command, the name of the current document or, if you’re in a Finder window, the name(s) of selected item(s). The drawback to this “always in the right place” approach is that you can’t force DTerm to change the current working directly—the
cd command simply doesn’t work. (If you want to use a different directory as an argument for a command, you must include that directory path in the command itself.)
If you need a persistent shell, or a traditional interactive shell, for a particular task—for example, to use
vi, to use
sudo, or if you need to change the working directory when running a command—simply enter your command in DTerm and press Command+Return (or choose Execute in Terminal from DTerm’s action menu); your command will be sent to Terminal instead. (If your normal shell program is iTerm, you can instead send commands to iTerm.)
You can cycle through previously used commands and their results by clicking the small left and right arrows at the top of the results display (or by pressing Command+Option+left arrow or +right arrow, respectively). You choose, in DTerm’s Preferences window, how many previous commands and results should be preserved between activations of DTerm’s dialog.
If you’re running a shell command while working in a document or application, there’s a good chance the results from that command are important. In fact, you may want to copy them from the shell and paste them into your document. DTerm makes this easy: Just press Shift+Command+C, or choose Copy Results And Dismiss from DTerm’s action meu, and the contents of the results display are copied to the Clipboard.
Finally, DTerm offers a few options for customizing its display, including letting you choose the font, font size, and font color for its results/output display. However, I wish you could also set a default width for the DTerm dialog and display—each time you access DTerm, its width is reset to a size that often isn’t wide enough to display the shell’s output, resulting in wrapped lines.
DTerm is a great utility for the sort of quick, in-and-out Terminal work many power users perform. And perhaps best of all, the price of DTerm has dropped from $20 to free since my original review.
Want to stay up to date with the latest Gems? Sign up for the Mac Gems newsletter for a weekly e-mail summary of Gems reviews sent directly to your Inbox. You can also follow Mac Gems on Twitter.