Skip to main content
Commonmark migration
Source Link

The approach given here looks a little simpler—maybe it would work for you?

If you don't want to remember to type "quit" instead of "exit", and you're using bash, just add the following to your .bashrc or other shell startup script:

 
trap '/usr/bin/osascript -e "tell application \"terminal\" to quit"' 0
 

What's it do? When the shell receives signal 0 (zero), that is, told to exit, it will execute this command as the last thing it does. This allows your shell, etc, to exit gracefully, and asking Terminal.app to exit via applescript makes sure it does the same. In other words, type 'exit', and your shell exits, then Terminal quits, all cleanly and the way nature intended.

The full thread can be found here.

The approach given here looks a little simpler—maybe it would work for you?

If you don't want to remember to type "quit" instead of "exit", and you're using bash, just add the following to your .bashrc or other shell startup script:

 
trap '/usr/bin/osascript -e "tell application \"terminal\" to quit"' 0
 

What's it do? When the shell receives signal 0 (zero), that is, told to exit, it will execute this command as the last thing it does. This allows your shell, etc, to exit gracefully, and asking Terminal.app to exit via applescript makes sure it does the same. In other words, type 'exit', and your shell exits, then Terminal quits, all cleanly and the way nature intended.

The full thread can be found here.

The approach given here looks a little simpler—maybe it would work for you?

If you don't want to remember to type "quit" instead of "exit", and you're using bash, just add the following to your .bashrc or other shell startup script:

trap '/usr/bin/osascript -e "tell application \"terminal\" to quit"' 0

What's it do? When the shell receives signal 0 (zero), that is, told to exit, it will execute this command as the last thing it does. This allows your shell, etc, to exit gracefully, and asking Terminal.app to exit via applescript makes sure it does the same. In other words, type 'exit', and your shell exits, then Terminal quits, all cleanly and the way nature intended.

The full thread can be found here.

added 618 characters in body
Source Link
nohillside
  • 104.4k
  • 42
  • 222
  • 275

The approach given here looks a little simpler—maybe it would work for you?

If you don't want to remember to type "quit" instead of "exit", and you're using bash, just add the following to your .bashrc or other shell startup script:

trap '/usr/bin/osascript -e "tell application \"terminal\" to quit"' 0

What's it do? When the shell receives signal 0 (zero), that is, told to exit, it will execute this command as the last thing it does. This allows your shell, etc, to exit gracefully, and asking Terminal.app to exit via applescript makes sure it does the same. In other words, type 'exit', and your shell exits, then Terminal quits, all cleanly and the way nature intended.

The full thread can be found here.

The approach given here looks a little simpler—maybe it would work for you?

The full thread can be found here.

The approach given here looks a little simpler—maybe it would work for you?

If you don't want to remember to type "quit" instead of "exit", and you're using bash, just add the following to your .bashrc or other shell startup script:

trap '/usr/bin/osascript -e "tell application \"terminal\" to quit"' 0

What's it do? When the shell receives signal 0 (zero), that is, told to exit, it will execute this command as the last thing it does. This allows your shell, etc, to exit gracefully, and asking Terminal.app to exit via applescript makes sure it does the same. In other words, type 'exit', and your shell exits, then Terminal quits, all cleanly and the way nature intended.

The full thread can be found here.

Source Link
Dori
  • 7.2k
  • 1
  • 34
  • 41

The approach given here looks a little simpler—maybe it would work for you?

The full thread can be found here.