0

I have enabled the option to quit Finder. However, if Finder is the only remaining open app and I quit it, it will launch again.

Personally I don't find the scenario of having all apps closed that nonsensical... I might want to close everything, and then open a different set of apps (because I switched from coding to making music, for example)

Can I prevent this behavior?

4
  • The Finder is just not designed to be 'not running' It controls more than just the open windows on the desktop.
    – Tetsujin
    Commented Jan 4, 2015 at 18:11
  • Just out of interest: what option did you enable to Quit Finder?
    – Ruskes
    Commented Jan 4, 2015 at 18:15
  • @Buscar웃 the following command: defaults write com.apple.finder QuitMenuItem -bool YES
    – deprecated
    Commented Jan 4, 2015 at 21:30
  • @Tetsujin What important tasks does Finder do?
    – deprecated
    Commented Jan 4, 2015 at 21:30

2 Answers 2

2

If you open Terminal and enter "launchctl list" it will list all of the programs kept running by launchd, the "launch daemon" that keeps system software running even after it is quit/force quit/killed/crashed.

Scroll to the top the results, and you will see "com.apple.Finder" keeping the Finder always running as long as the OS is running. Finder does much more than browse the file system, and it should always be running (same for the Dock). However, if you want to quit it and keep it from relaunching, you will need to remove it from launchctl first. I wouldn't do this personally, but here's how:

  • Open Terminal
  • Enter: sudo launchctl remove com.apple.Finder
  • Enter your password and hit return.

Now you should be able to quit Finder without it relaunching.

To undo this:

  • Open Terminal
  • Enter: sudo launchctl load System/Library/LaunchAgents/com.apple.Finder.plist
  • Enter your password and hit return.
1
  • Worked! It was necessary to not use sudo in my case. What important tasks does Finder do?
    – deprecated
    Commented Jan 4, 2015 at 21:28
1

You can quit Finder using the AppleScript command tell application "Finder" to quit. It will stay quit until you launch it again with tell application "Finder" to launch (or tell it to activate), or click on its Dock icon.

The AppleScript commands can be issued from the command line, using

/usr/bin/osascript -e 'tell application "Finder" to quit'
/usr/bin/osascript -e 'tell application "Finder" to activate'

From Terminal, with the normal PATH settings, you can save some typing by leaving off the /usr/bin/ part, but when writing shell scripts it's prudent to spell out all commands using full paths.

When Finder quits normally, as above, launchd will not automatically respawn it. If it quits abnormally, for example using kill or killall or via force quit, or if it crashes, launchd will respawn it immediately.

Most of the important work Finder did in the background has been shifted to System Events or to Dock. The split between Finder and System Events is basically that System Events has taken over manipulation of files and folders, leaving Finder to focus on just their visual appearance. When an AppleScript tells Finder to do something that is now System Events' responsibility, Finder just passes the request along, but still gets launched along the way.

But generally, the only reason to quit Finder is to manipulate something behind its back, for example in the common sequence

osascript -e 'tell application "Finder" to quit
defaults write com.apple.Finder ...
osascript -e 'tell application "Finder" to launch

or because you've just gone into System Preferences→Language & Region to change your language defaults and want Finder to start using the new settings.

I can't think of a reason to make Finder stay quit. If you're worried about visual clutter, just hide it. If you're worried about CPU usage, it doesn't use any while it's hidden (except to respond to Apple Events), and not much while it's not. Time-consuming tasks like copying files or emptying the trash get passed off to the background process racoon.

If you're worried about its RAM usage, it doesn't use much (under 45MB on my system), and since Mavericks it supports Sudden Termination. If the system sees it's not doing anything (because it's hidden, for example) and has a use for the RAM (for example, to delay having to start swapping to disk), it'll silently quit it without telling you. The Dock will continue to show it as running, but Activity Monitor will show that it actually isn't.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .