Source: How-To Geek
If you’re a fan of shell scripts in macOS, you’ve probably noticed how running one will leave you with a useless Terminal window after it’s completed. You can fix this from the Terminal settings.
This method only works if you’re launching a shell script outside of bash, such as by clicking on it in Finder or by setting a custom hotkey to open the program.
Otherwise, you’ll just be taken back to the command prompt. You can always usekillall Terminal
to make the Terminal app close itself from within a script, but that will close every open Terminal window, so it’s not ideal. Change This Behaviour in the Profile Settings
Open up the Terminal app from the Dock or your Applications folder, then open the settings by pressing Command+Comma.
In the Settings window, switch to the Profiles tab. The default profile (the one at the top) should be selected by default. In the settings on the right, click the “Shell” tab and then click the “When the shell exits”…
The post How to Close the macOS Terminal Automatically When a Process Exits appeared first on FeedBox.