1 2 Previous Next 15 Replies Latest reply: Oct 25, 2013 5:26 AM by David Glasgow
George Botley Level 1 Level 1 (20 points)

Hello Guys,

 

I have been a Mac user for around 4 years now and can't fault them.

 

But as of recently, with the introduction of Lion, my opinions are begining to change....

 

Mac OS X 10.7.1 introduced many new features, many helping, but one in particular that is winding me up the wall is Window Restore.

 

I have turned it off within System Preferences but whenever I restart my Mac or logoff and logon again all the Windows I had open re-open... making a boot time of less than 30 seconds increase - which is not helpful when working with large client workflows in a tight deadlined business environment.

 

I'm sure many of you will agree with this annoyance, but can any of you offer a hint as to how to prevent this feature entirely...

 

It is starting to make me want to downgrade to 10.6, which I don't really want to do as Lion brings increased performance in many areas.

 

Thanks for the help guys,

 

George.


MacBook Pro, Mac OS X (10.7.1), 15-inch, Core i7, Mid-2010
  • 1. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    Barry Hemphill Level 7 Level 7 (34,500 points)

    Hello:

     

    I have turned it off within System Preferences

    Did you do this in system preferences>general (uncheck the box "restore windows when quitting and reopening apps")?

     

    Barry

  • 2. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    George Botley Level 1 Level 1 (20 points)

    I have done this, but they still seem to come back up which is soo frustrating..

  • 3. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    Barry Hemphill Level 7 Level 7 (34,500 points)

    Hello:

     

    Try trashing a preference file (com.apple.systempreferences.plist) and restarting.  Then reenter your own preferences and see if that helps.

     

    FWIW, what I asked above worked for me - even after restarts.

     

    Barry

  • 4. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    francesfromet Level 1 Level 1 (0 points)

    Am having exactly the same problem, along with others unrelated (maddening!) and Tech Support cannot help. I have updated System Prefs but that doesn't stop the windows from opening on startup. Please give further details on trashing a preference file—where do I find it?

  • 5. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    Barry Hemphill Level 7 Level 7 (34,500 points)

    The preference file is located in the home folder (~library>preferences).  To display the library folder from the Finder, click on the menu bar "go" while holding the option key down.

     

    Barry

  • 6. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    Hugo Gernsback Level 1 Level 1 (0 points)

    You may find this link interesting:

     

    http://forums.macrumors.com/archive/index.php/.../t-1191622.html

     

    you have to scroll down a bit to a user VicAnd7:

     

    "VicAnd7

     

    Jul 26, 2011, 10:02 PM

    After digging around for a while, I found a way of dealing with this annoying feature.

     

    On terminal, you need to run the following command:

     

    defaults write com.apple.loginwindow TALLogoutSavesState 0

     

    This, despite the fact that the checkbox will still be marked, will kill every app when you turn off your Mac.

     

    The only catch is that you have to run the command each time that you're going to either reboot or shut down since the system automatically changes the value to "1" again.

     

    To sort this out, I created an AppleScript-based app that with just clicking its icon, it will run the command and shut your mac down for you.

     

    You can download it here (http://www.gizmoblurb.com/count/CleanShutDown/csd.php) for free.

     

    Let me know if it works for you!

     

    Victor Andreoni

     

    source: GizmoBlurb (http://www.gizmoblurb.com)"

     

     

  • 7. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    SteveKir Level 3 Level 3 (545 points)

    I have squirreled this away and will give it a go in due course. Thanks to gizmoblurb.com. (Actually, I hardly ever shut down and restart my Mac.)

  • 8. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    shakamar Level 1 Level 1 (0 points)

    To disable or enable it again open terminal and copy and paste one of the following depending on it you are enabling it or disabling it. The resme box will still show when you are restarting, but it will be disabled regardless if the box is checked or not.

    To Disable The Checkbox:
    curl http://goo.gl/Z4EFC -L -s -o ~/fixlogin.sh && chmod +x ~/fixlogin.sh && sudo ~/fixlogin.sh ; rm ~/fixlogin.sh

    To Enable The Checkbox:
    sudo defaults delete com.apple.loginwindow LoginHook

  • 9. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    shakamar Level 1 Level 1 (0 points)

    Forgot to say that after you paste it into terminal, hit enter.  It will then ask for your password.  Enter your password and hit enter.  Exit terminal. 

  • 10. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    billearl Level 2 Level 2 (175 points)

    Hugo Gernsback wrote:

     

    On terminal, you need to run the following command:

     

    defaults write com.apple.loginwindow TALLogoutSavesState 0

     

    This, despite the fact that the checkbox will still be marked, will kill every app when you turn off your Mac.

     

    The only catch is that you have to run the command each time that you're going to either reboot or shut down since the system automatically changes the value to "1" again.

    Setting TALLogoutSavesState to "0" simply sets a flag to delete the plist file:

    /Users/yourUsername/Library/Preferences/ByHost/com.apple.loginwindow.*.plist

    at shutdown (where * is a string of 12 characters).

     

    I use an AppleScript which runs automatically at every restart/shutdown to do this directly:

    do shell script "rm -f ~/Library/Preferences/ByHost/com.apple.loginwindow.*.plist"

    (replace * with the actual string of 12 characters).

  • 11. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    Zacharias Beckman Level 1 Level 1 (100 points)

    Yea, this is the worst idea I've seen, especially with Lion's inherent instability issues. My regular workflow, which seems to take place at least once, sometimes three or more times a day:

     

    1. System starts to get boggy, and I notice a few apps (Finder usually the real kicker) stop responding.
    2. Attempt to reboot... baby sit, often have to force reboot.
    3. At login, as many as 10 apps restart, reload window configurations, and start doing exactly what it was that led to the system starting to bog down and freeze up...
    4. After waiting 1-3 minutes for login to finish, I quit all the apps that I don't need anymore.

     

    Godawful stupid idea... When did Apple start hiring all the Microsoft programmers, huh?

     

    Anyhow, I found this over on MacRumors, and it seems like a pretty decent way to prevent this idiotic behavior without being a "hack" per-se. Note this is the same reference posted above, but with more detail so you can read about it and understand better:

     

    Link: http://osxdaily.com/2011/08/25/disable-reopen-windows-when-logging-back-in-in-ma c-os-x-lion-completely/

     

    Meat of the article reproduced here:

     

    Paste the following into a single line within the Terminal:

    curl http://goo.gl/Z4EFC -L -s -o ~/fixlogin.sh && chmod +x ~/fixlogin.sh && sudo ~/fixlogin.sh ; rm ~/fixlogin.sh

    (The above text is intentionally small so that it will fit on a single line)

    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:

    #!/bin/bash
    echo "#!/bin/bash" > /tmp/loginfix.sh
    echo "rm /Users/*/Library/Preferences/ByHost/com.apple.loginwindow.*" >> /tmp/loginfix.sh
    mv /tmp/loginfix.sh /usr/bin/loginfix.sh
    chmod +x /usr/bin/loginfix.sh
    defaults write com.apple.loginwindow LoginHook /usr/bin/loginfix.sh

    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 com.apple.loginwindow LoginHook

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

  • 12. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    babowa Level 7 Level 7 (23,295 points)

    I have found this little trick which has worked for me since I invoked it back in August (without doing the terminal commands):

     

    Hold Option key while going to Go menu in menu bar to unhide User Library folder.

    Once in Library, scroll down to Saved Application State folder.

    Open folder and move everything to trash (this will disable ALL!!).

    Highlight folder icon and use Command key + I (Get info)

    Once window is open, scroll to bottom, unlock lock and enter your admin password.

    Scroll back up and check the "locked" option:

     

    Screen Shot 2011-11-20 at 11.59.33 AM.png

     

    Scroll back down and lock the lock.

     

    As you can see my folder contains zero bytes; since it is locked, no application can save anything to it. This is system wide though, so if you like some to open, don't use this method.

  • 13. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    Courtlandmcdonald Level 1 Level 1 (0 points)

    Babowa:

    This is a great work-around and so far I have not seen any problems with it.

     

    Another benefit I found with your work-around is with Xcode. I want the Xcode 'Welcome Screen' to launch by default ALWAYS! However, it always launches in the state it was in when I closed the application even though I checked the box at the bottom of the Xcode Welcome Screen that says "Show this window when Xcode Launches".

     

    So Xcode now works the way I believe it was intended to work. I love OS X Lion, I think it is a beautiful product and integrates with iOS  very well. Following that thought however, I am guessing that Lion was developed to mimic iOS in many ways. So maybe Apple just assumed that when you restart or cold start Lion OS X, you would want all your apps to reload from a suspended state just as they do on the iPhone/iPad.

     

    I see where they are coming from but, my preference would be to have the checkmark for "Reopen windows when loggin back in" removed by default, or at least include that option - maybe somewhere in System Prefs?

     

    So, thank you for this work-around. It is very much appreciated.   - Courtland

     

    Welcome.png

  • 14. Re: Any way to complete turn off Reopening Windows on Login/Reboot???!!
    babowa Level 7 Level 7 (23,295 points)

    I'm glad to hear that worked for you! I'm not sure I share your enthusiasm regarding Lion: I don't want my 27" iMac to mimic an iPhone and I prefer having control over simple functions. I sent in a report requesting a System Preference Option to have an on/off switch (either system wide or by application) - obviously didn't meet their criteria of worthwhile suggestions......

1 2 Previous Next