Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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 ?

share|improve this question
    
Can you configure Terminal to close when the shell closes? –  glenn jackman Jun 10 at 15:11
    
@glennjackman that's a damn good question ! I'll try it right now –  Thomas Jun 10 at 15:12
    
@glennjackman post it as an answer, you'll win +25 –  Thomas Jun 10 at 15:13
    
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 at 20:07
add comment

2 Answers 2

up vote 13 down vote accepted
  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

share|improve this answer
add comment

You could also simply quit Terminal by using Cmd+Q

share|improve this answer
    
He did not ask how to quit terminal. This is not answer to his question. –  AllInOne Jun 12 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 at 2:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.