Guillaume-Jean Herbiet on Nostr: Moving away from #iTerm2 back to #macOS #terminal and would like the app to close ...
Moving away from #iTerm2 back to #macOS #terminal and would like the app to close when you quit your last shell? Add the following to ~/.zlogout :
```
if [ "$(ps | wc -l)" -eq 4 ]
then
osascript -e "do shell script \"osascript -e \\\"tell application \\\\\\\"Terminal\\\\\\\" to quit\\\" &> /dev/null &\""
exit
fi
```
Yes, that’s a lot of backslashes but we are doing #AppleScript inside #ZSH, inside #AppleScript inside #ZSH…
```
if [ "$(ps | wc -l)" -eq 4 ]
then
osascript -e "do shell script \"osascript -e \\\"tell application \\\\\\\"Terminal\\\\\\\" to quit\\\" &> /dev/null &\""
exit
fi
```
Yes, that’s a lot of backslashes but we are doing #AppleScript inside #ZSH, inside #AppleScript inside #ZSH…