[X-Unix] Quit Terminal on exit

Marley Graham mgraham at aquaflo.com
Fri Mar 12 12:22:41 PST 2004


On Mar 12, 2004, at 11:12 AM, James Bucanek wrote:

> No, as it would be a very hazardous option (having a window option 
> that closes *all* windows).  Note that your solution will have the 
> same problem, so be warned.

No, actually, my program works just fine; on exit it closes the window, 
but leaves Terminal running.

The users generally have only one reason to run Terminal - to log onto 
the main application on our server. I originally set up a template for 
users by sending the ssh login command to the server. At that point, I 
issued a Save As command to create the template file, which I then 
modify with TextEdit for the individual users as noted, and put in the 
user's Document folder. Then I copy the file to the Dock on the user's 
machine. Most users will just click on that icon to launch the program, 
and not even be aware that they are running Terminal. When they log out 
of the main program, the window closes and, as far as they are 
concerned, they have quit the program.

So, an embedded command that caused Terminal to quit when the window 
closed would, in this case, be a good thing.

> However, I've used the following trick on .command files that I have 
> set to execute on login.  I didn't want the Terminal application left 
> running after every login.  I wanted my script to run, and Terminal to 
> quit.  My script looks something like this:
>
>     cd ~/bin
>     <do some setup, start a few deamons, etc.>
>     osascript -e 'tell application "Terminal" to quit' &
>
> Note that the '&' is important, or it causes a fatal embrace.


Yes, I realize I could write an osascript to quit Terminal; but in the 
scenario above, how would it know when to run? That's why I was looking 
for a way to embed a "quit Terminal" string in the property list.

Marley Graham
Aqua-Flo Supply



More information about the X-Unix mailing list