When I want to close a window I type exit :

 mbp-thomas in ~
○ → exit

[Opération terminée]

Then cmd + w to close the window.

Is there a way to do it with a little script like if I type quit it exit the session then close the window ?

  • Can you configure Terminal to close when the shell closes? – glenn jackman Jun 10 '14 at 15:11
  • @glennjackman that's a damn good question ! I'll try it right now – Thomas Ayoub Jun 10 '14 at 15:12
  • @glennjackman post it as an answer, you'll win +25 – Thomas Ayoub Jun 10 '14 at 15:13
  • 2
    While the question already has a great answer, a quick tip on the side: CTRL-D does the same as typing exit and hitting ENTER, but is much quicker. Also works when logging off a remote server in an SSH session. – ssc Jun 13 '14 at 20:07
  1. Open Terminal.

  2. Go to TerminalPreferences….

    Image of the Terminal panel

  3. Select the Settings tab, then your profile, and choose the Shell tab.

  4. Set When the shell exits to Close if the shell exited cleanly.

    Close if the shell exited cleanly


You could also simply quit Terminal by using Cmd+Q

  • 2
    He did not ask how to quit terminal. This is not answer to his question. – AllInOne Jun 12 '14 at 21:00
  • True, and while it is technically and semantically different, for all intents and purposes, that is what's happening, except if there are multiple instances open (or wants an app without window processes running). – Hugo Jun 16 '14 at 2:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .