13

In Mac OS X Lion, when I do Apple > Shut Down, there is a checkbox that says "Reopen windows when logging back in".

Even though I constantly UNCHECK the box, it seems OS X doesn't care - and still opens some Finder windows and sometimes Chrome...

How can I turn this feature off?

bmike
  • 235,889
nute
  • 2,740

5 Answers5

10

For the record, we’re talking about this:

Screenshot

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 Terminal.app and enter the following commands:

defaults write com.apple.loginwindow TALLogoutSavesState -bool false
defaults write com.apple.loginwindow 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.


Update: OS X 10.7.4 fixed this — it now remembers your selection:

Mathias Bynens
  • 11,642
  • 13
  • 66
  • 111
6

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)

gentmatt
  • 49,722
4

Do you ever want applications to restore to their closed state, or just at startup? If you want something resembling pre-Lion behavior (i.e. not picking up where you left off), try this.

Back up your system before trying this, in case it messes anything up, but I'd recommend this procedure: In the Finder, press Command-shift-G for "Go to the folder:" then type "~/Library/Saved Application State/" (without the quotes). Delete all the folders in Saved Application State, then press Command-I to Get File Info. In the Get File Info window, check the "locked" box. This should keep applications from restoring their state.

Daniel
  • 34,803
3

The only thing that actually ever worked for me (MacOS 13.4 or similar) is to find the file:

~/Library/Preferences/ByHost/com.apple.loginwindow.<UUID>.plist

Your file will have a different UUID for every user.

Empty this file: echo "" > ~/Library/Preferences/ByHost/com.apple.loginwindow.<UUID>.plist

And then make it unwritable: sudo chown root ~/Library/Preferences/ByHost/com.apple.loginwindow.<UUID>.plist

This ensures a predictable login time and makes a reboot do what it was designed to do: clear the current state of the computer. I know this thread is old but I am sure that someone else will benefit from this knowledge. I wish I could have found out the easy way.

Karatekid430
  • 141
  • 2
  • 2
    This is what solved it for me, and just to be certain it hopefully sticks, I used sudo chmod 000 and sudo chown nobody:nogroup on this. It's been bugging me for ages that nothing else stuck. – Josh Jun 28 '23 at 05:48
  • I tried this and it helped but somehow Tuple still launched at startup, despite not being in this file, in the login items in my user account settings, and not having its own launch at startup setting checked. Is it just me or has this always been one of the most hard to control things in macOS? – Andy Oct 20 '23 at 20:31
  • Double check using something like launchcontrol (free version should work), or check launchctl list, that sounds like it starts at login instead of relaunching. – Josh Oct 27 '23 at 15:27
1

Be sure that Google Chrome isn't included in System Preferences > Users & Groups > Login Items.

Also, Finder windows restore by default regardless, as they did in Snow Leopard.