Aug 8 2011
Disable Mac OS Lion’s “Restore windows” setting on an individual per-application basis
The “General” PreferencePane in Lion’s ‘System Preferences’ windows contains a “Restore windows when quitting and re-opening apps” item. However, sometimes this behaviour does’t make sense – after a reboot I found, for example, that the OS X Installer had re-launched and was asking for a package to install!
This can be prevented on a per-application basis with the Terminal command:
(… with a terminating zero, not letter “o”)
This will affect the current user, or the entire system if prefixed with “sudo“. The Application ID can be found in ‘~/Library/Preferences‘ – so, for example, preventing Installer.app from automatically restarting can be achieved by executing in Terminal:
… but this could also be used for other intentionally ephemeral applications such as TextEdit.app or, depending on your normal usage, Terminal.app.
Aug 11, 2011 @ 16:32:29
have you figured out a way to disable this globally? I don’t want any apps to resume
Aug 11, 2011 @ 16:46:58
That I can help you with 😉
Launch System Preferences, choose General, and the third item from the bottom is an option named “Restore windows when quitting and re-opening apps”. Untick this, and no app will open maintain state when restarted.
I’d miss having all of my old tabs open in Safari, though…
(You can also untick “Reopen windows when logging back in” from the Shutdown or Restart dialogs if you only want to prevent state from being restored on reboot.)
Aug 12, 2011 @ 23:14:33
As per this Mac OS X Hints tip, you can also tell an application to resume itself after a reboot, but not to restore any previous state by using:
Not as immediately obviously useful, granted – but I’m sure someone’s crying out for this somewhere!
Aug 20, 2011 @ 01:48:29
The option to remove the “reopen windows when logging back in” doesn’t work. Whether it is checked on unchecked, it will restore everything on my computer. I really really liked that Snow Leopard closed out all of the open programs before it shut down and they stayed that way. It was a nice feature. Now to have to manually close everything is a pain. I hope they fix this bug. Having a option to remove the “reopen windows when logging back in” is nice but since it doesn’t work it is a bug
Ken
Aug 24, 2011 @ 23:24:50
Thanks for this… I just wrapped it in a nice AppleScript:
https://github.com/levigroker/ToggleRestoreWindows
Cheers,
Levi
Sep 21, 2011 @ 06:07:20
I’m having the same issue Ken Bonner is. I uncheck the checkbox, but Window Restore will not turn off. A totally obnoxious bug! I thought a permission repair would do the trick, but still no dice. Not cool!
Sep 22, 2011 @ 19:41:08
In the case of doing this in reverse – i.e. if you want ‘restore windows’ off for most apps and want to individually set just one or two to restore, can I assume it’s the same but ending -int 1 instead?
Sep 22, 2011 @ 22:16:34
How about this hint: Completely disable resume with:
chmod -R a-w "~Library/Saved Application State"
… although a neat alternative to this latter command would be:
The article linked to above also details how to permanently disable “Reopen windows when logging back in“, and some important warnings to bear in mind with any of these fixes…