OSX - How to auto Close Terminal window after the "exit" command executed.
Solution 1:
in Terminal.app
Preferences > Profiles > (Select a Profile) > Shell.
on 'When the shell exits' chosen 'Close the window'
Solution 2:
How about the good old Command-Q?
Solution 3:
In the Terminal app, Preference >> Profiles tab.
Select the Shell tab on the right.
You can choose Never Ask before closing to suppress the warning.
Solution 4:
Actually, you should set a config on your Terminal, when your Terminal is up press ⌘+, then you will see below screen:
Then press shell tab and you will see below screen:
Now select Close if the shell exited cleanly
for When the shell exits.
By the above config each time with exit
command the Terminal will close but won't quit.
Solution 5:
You could use AppleScript through the osascript
command:
osascript -e 'tell application "Terminal" to quit'