|
|
A script to quit the Terminal from the Terminal
Even doing a
If you want something that you can always run when you're done with a window, which will quit Terminal.app in the event it was the last window, a larger script might be in order. First create this AppleScript:
Then just alias it to whatever command you want and add osascript to the list of ignored processes under the Processes section of the window settings.---
Just 'trap' it
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:
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.Note:You'll need to add login, bash, and osascript to the exclude list under "Prompt before closing window" or terminal will whine at you before exiting. Or you could just choose "Never". Something similar is surely possible with tcsh...but I have no idea how. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.14 seconds |
|