Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The shutdown/restart dialog has a check-box Reopen windows when logging back in which is checked by default. I need to change its behavior to be unchecked by default. Is this possible? If yes, how can I do that?

enter image description here

share|improve this question

Edit: since 10.7.4, the "Reopen windows when logging back in" checkbox has stayed unchecked if you uncheck it once, so the hacks below are not needed anymore.

One option is to set the LoginwindowLaunchesRelaunchApps key to false in ~/Library/Preferences/

defaults write LoginwindowLaunchesRelaunchApps -bool false

You could also save this property list as ~/Library/LaunchAgents/logout_saves_state.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN>
<plist version="1.0">

Then load the property list by running launchctl load ~/Library/LaunchAgents/logout_saves_state.plist or by logging out and back in once.

TALLogoutSavesState sometimes got reset to true when I logged out and back in, so just running defaults write TALLogoutSavesState -bool false once wouldn't have worked.

Neither of these options actually makes the checkbox appear unchecked, but they have the same effect.

share|improve this answer
I found a reason to still do this on 10.7.5: the box in the Restart dialog is now unchecked by default, and state is not restored. But if I forced a reboot by holding down the hardware power button on my MacBook, it restored state. After applying this fix, when rebooting with the button, I now get a dialog upon reboot that says "You shut down because of a problem. Do you want to restore state?", so I can get a clean reboot. – Andrew Janke Oct 18 '12 at 0:42

No, it is always set to "on." However there does exist a script you can run, that disables the feature. The box will still be checked, but the feature will no longer function:

Paste the following into a single line within the Terminal:

curl -L -s -o ~/ && chmod +x ~/ && sudo ~/ ; rm ~/

That command downloads a script, places it in the appropriate location, makes it executable, and then removes the temporary file. If you are wondering, the contents of the downloaded bash script are the following:

echo "#!/bin/bash" > /tmp/
echo "rm /Users/*/Library/Preferences/ByHost/*" >> /tmp/
mv /tmp/ /usr/bin/
chmod +x /usr/bin/
defaults write LoginHook /usr/bin/

If you ever want to revert back to the default behavior of this OS X Lion feature, just type the following defaults write command:

sudo defaults delete LoginHook

And you’ll be back to be able to select window restore based on that checkbox’s choice.


share|improve this answer
You can also disable Resume for applications on a per app basis. See these answers here. – gentmatt Dec 24 '11 at 12:39
Thank you for the script, it fixes one of the most annoying "features" of the latest Macs. – Tobia Aug 4 '14 at 8:04

This bug has been fixed with the Lion update 10.7.4:

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.

enter image description here

(click here for more information)

share|improve this answer

For the record, we’re talking about this:


The problem is that OS X doesn’t remember if you uncheck the checkbox on the last shutdown — it will always keep the checkbox checked by default on subsequent shutdowns.

I found two different solutions for this problem, that seem to do the trick, although they aren’t ideal.

Open and enter the following commands:

defaults write TALLogoutSavesState -bool false
defaults write LoginwindowLaunchesRelaunchApps -bool false

This effectively disables the “reopen windows when logging back in” option, although the checkbox will still appear to be checked. You can just ignore it.

I’m afraid there’s no better solution, at least not at the moment.

It’s possible to disable Resume on a per-app basis, too.

There’s also a system setting that allows you to disable it for all apps, system-wide. Go to System PreferencesGeneral:


Alternatively, you can run this command in

# Disable Resume system-wide
defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false

(Taken from my .osx file.)

share|improve this answer
TALLogoutSavesState sometimes gets reset to true after logging out and back in though. defaults write TALLogoutSavesState -bool false would need to be run at login using a launchd agent or something. – user495470 Mar 21 '12 at 12:41
@Lri It seems to work fine for me, even after multiple logouts/reboots, in combination with the LoginwindowLaunchesRelaunchApps setting. I remember testing the two separately, in which case I ran in to the issues you described in your answer. AFAICT, there’s something about the combination of the two settings that does the trick. – Mathias Bynens Mar 21 '12 at 12:44
I just ran both again, logged out and back in twice, and defaults read TALLogoutSavesState returned 1. – user495470 Mar 21 '12 at 12:48
TALLogoutSavesState still gets set to true by itself. But just LoginwindowLaunchesRelaunchApps -bool false alone seems to be enough to disable restoring windows. – user495470 May 10 '12 at 17:56

This has changed in Mac OS X Update Version 10.7.4.

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

enter image description here

Here is the new option, as you can see (although it isn't proof in itself as it's easy to uncheck and then screen grab, but please trust me - I was pretty stoked when I checked out this update as this bug was really annoying me!)

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.