Command to close terminal window

When I want to close a window I type exit :

 mbp-thomas in ~
○ → exit
logout

[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 ?


Solution 1:

  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