Take the 2-minute tour ×

In OSX is it possible to set a preference for a program for whether it fully quits or stays running in the dock on closure of the last window? e.g. Netbeans for MAC defaults to completely quitting, so it's possible for a program to internally set this preference. Is it possible for the user to alter the preference in general?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

There isn't a general preference that says to the applications if they should quit when their last window is closed, or if they should stay open; that behavior is hard coded in their code.

A general setting would not make sense, as the behavior depends from the type of application. Apple has guidelines about this.

In general, quit when users close the last open window in your app. In apps that are not document-based, users generally expect the app to quit when they close the main window. If an app continues to perform some function when the main window is closed, it might be appropriate to leave it running after the user closes the main window. For example, iTunes continues to play after the user closes the main window. If users close the last remaining document window in a document-based app and switch to another app, it’s appropriate to quit the app.

While saying to a document-based application to quit when the last window is closed would make sense, it would probably make less sense to say to an application like the preference panel to stay open when its window is closed.

share|improve this answer
Apple need to follow their own advice. Some of the apps I'd like to set this preference on are apple's own because they stay running despite not being document based e.g. terminal. And many document based ones (e.g. preview, textedit) don't follow the second half of the guidelines. In fact these guidelines appear to be widely ignored by many apple and 3rd party apps. –  wheresrhys Feb 21 '12 at 15:06
I've never seen any document-based app quit after the last window is closed, as that quote recommends. –  Kevin Reid Feb 21 '12 at 16:33
@KevinReid The quotes says, "and switch to another app." I tried with TextEdit, opening a text file; Simply closing the document window doesn't close the application, but if I select "Hide TextEdit" (or pass to another application with Cmd-Tab) after I closed its last document window, TextEdit closes itself. –  kiamlaluno Feb 21 '12 at 16:40
to name another, activity monitor completely fails to satisfy these guidelines. Apple, kings of seamless, consistent user experience... I think not! –  wheresrhys Feb 22 '12 at 14:20
@kiamlaluno maybe it's OS version specific as that isn't happening on my machine –  wheresrhys Feb 22 '12 at 14:21
show 2 more comments

Your Answer


