Patricio Treviño

Patricio Treviño

Husband . Father . Developer

Exit and quit terminal with a single command

Syntax

export TERMINAL=<TERMINAL>
alias quit='/usr/bin/osascript -e "tell application \"$TERMINAL\" to quit"; exit'
view raw syntax.sh hosted with ❤ by GitHub

Option Description
TERMINAL An environment variable with the name of the terminal you prefer (I export this in .bash_exports)

Example

# This will exit the terminal process and then close the terminal window (no more ⌘ + Q)
$ quit
view raw example.sh hosted with ❤ by GitHub

References

Automatically quit Terminal when typing exit