Lion opens lots of windows automatically after a restart. How can I stop that?

It's very annoying.

Is there a way to stop this?

I found an option in System Preferences ("Restore windows when quitting and re-opening apps") and disabled it but it doesn't seem to affect anything.


What you are experiencing are the benefits of working with resume. A feature introduced with Mac OS X Lion.

  • It restores the state of the computer when shut down. Very useful, when having to restart because of some installation procedure.
  • It reopens the used windows of applications. Quite useful since you do not have to navigate to a files location. Instead, just open the needed application to open the file.

Unchecking the box does not have a permanent effect. This can be achieved by manual tweaking.

Disable Resume upon login permanently

Open the Terminal and enter:

curl http://goo.gl/Z4EFC -L -s -o ~/fixlogin.sh && md5 -q ~/fixlogin.sh | xargs -I % mv ~/fixlogin.sh ~/%.sh && chmod +x ~/121dca51e66073624da420b6e1be61d9.sh && sudo ~/121dca51e66073624da420b6e1be61d9.sh ; rm ~/121dca51e66073624da420b6e1be61d9.sh

This command downloads a script and fully installs it. Voilà, you are done.

If you want to revert to the default behavior of resume in lion, type this.

sudo defaults delete com.apple.loginwindow LoginHook

Kudos to Hexbrain who wrote the script.

Disable Resume when launching apps

You can also disable Resume for applications on a per app basis. See these answers here.

  • I see how the script works. Excellent. Ta. – Andrew J. Brehm Dec 24 '11 at 9:54
  • 2
    You know, OS/2 Warp had this stupid feature in 1994. It was as annoying and unhelpful then as it is know. I can't believe Apple would resurrect a feature from 15 years and sell it as new. – Andrew J. Brehm Jan 12 '12 at 8:43
  • 1
    I believe this is a really good feature. The only thing they could possibly improve, is remembering the selection on checkbox so you don't have to un-tick every time if you don't need it. – latusaki Apr 4 '12 at 12:11
  • @latusaki I agree 100%. This behavior is inconsistent with other checkboxes you find anywhere in the OS :/. Hence, the workaround in the answer. – gentmatt Apr 4 '12 at 12:12

Just uncheck the "Reopen windows when logging back in" checkbox in the restart dialog.

enter image description here

  • 1
    I tried that. It doesn't remember the setting. – Andrew J. Brehm Dec 23 '11 at 22:26
  • 2
    Yes, that's a feature - not a bug. To be honest, I agree that this is seriously messed up. Why? Because this behavior is inconsistent with the behavior of checkboxes in other system settings. – gentmatt Dec 24 '11 at 7:57

The checkbox has stayed unchecked in 10.7.4 and later versions. The release notes called it an issue, even though it was probably intended behavior originally.

The OS X Lion v10.7.4 Update includes fixes that:

  • Resolve an issue in which the "Reopen windows when logging back in" setting is always enabled.

The state of applications is still restored even if Resume was disabled when applications are opened manually or as login items. Disabling LoginwindowLaunchesRelaunchApps or TALLogoutSavesState doesn't prevent that either.

You must log in to answer this question.

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