$ [sudo] pip install mac-terminal-interpreter
$ [sudo] npm i -g mac-terminal-interpreter
script.ext
#!/usr/bin/env terminal
...
stdout, stderr logs:
~/Library/Logs/<slug>/<date>/out.log
~/Library/Logs/<slug>/<date>/err.log
~/.bashrc
:
export MAC_TERMINAL_CLOSE=0 # doesn't close (default)
export MAC_TERMINAL_CLOSE=1 # close if the shell exited cleanly
export MAC_TERMINAL_CLOSE=2 # close always
Terminal error sound:
$ defaults write .GlobalPreferences com.apple.sound.beep.sound /System/Library/Sounds/Basso.aiff