OSX - How to auto Close Terminal window after the "exit" command executed.

darksteel picture darksteel · Apr 6, 2011 · Viewed 179.3k times · Source

When I'm done with Terminal, I want to exit it. Right now, I have three options:

  1. killall Terminal. It will end the process, but rather abruptly. I don't think this is the best idea.

  2. Call exit. I've changed the settings so exit closes Terminal. The app still appears open in the Dock though, and doesn't do what I want it to do.

  3. Right click>Quit. However, this isn't a Terminal command to exit it.

So now, what is the way I should exit and close Terminal? I've heard something about osascript but I'm not too sure. I want to exit and close, so that Terminal is no longer open, both as a window and as a process.

Answer

Duke picture Duke · Jul 28, 2013

in Terminal.app

Preferences > Profiles > (Select a Profile) > Shell.

on 'When the shell exits' chosen 'Close the window'