Automatically quitting Terminal.app windows

Quite often I find myself using a particular application for a long time, and only realising that something I'm doing can be done a lot simpler, or even automatically. A quick smack on the head with the palm of my hand and a few shots of espresso is generally called for, followed by implementing the previously unused feature.

In this case it's a feature of the improved and vastly more usable new Terminal.app bundled with Mac OS X Leopard. In earlier versions of OS X I used mrxvt in X11 for most of my shell goodness; a less elegant alternative to iTerm but one which I found more reliable. Unlike previous Terminal.app versions, mrxvt had a tabbed interface, and exited automatically whenever the process you were working on finished cleanly. I knew Terminal.app in Leopard had the former feature but not the latter… despite it being right under my nose the whole time.

The Leopard Terminal indicating a process has been completed, with the window still open
The Leopard Terminal indicating a process has been completed, with the window still open

To get the Leopard Terminal.app to automatically close its window when the process you're working on finishes cleanly:

  1. Hit [Command]+[,] to bring up the Preferences screen
  2. Click Settings, then click the theme you want to change.
  3. Click Shell and choose Close if the shell exited cleanly from the When the shell exits: listbox.

Now whenever a process you've initiated finishes, or if you type exit in your shell, the window closes automatically. When you have tens of tabs open at once, this saves a LOT of time!

The Leopard Terminal Preferences window
The Leopard Terminal Preferences window showing changed setting


Imprint

This is one of about 5000 posts on Rubénerd. View the home page for the latest, or related posts also tagged with:

If you liked this post, feel free to buy me a coffee, leave me a comment on Twitter, or email me at weblog2017@rubenschade.com. Thanks :).