MacOS – Unchecking “Restore windows when quitting and re-opening apps” doesn’t work

macos

Unchecking "Restore windows when quitting and re-opening apps" under
System Preferences -> General doesn't work – for example, when I re-open an app (e.g. Preview) it restores a window (call it 'PDF 1') I had open before quitting that app. (At least when I quit it by logging out, even with 'Reopen windows when logging back in' unchecked.) Any pointers?

I've found people describing similar problems, around the web and on StackExchange (in answers/comments, but not dedicated questions). But no answers that work for me. I've tried the solutions suggested at Disable resume for all apps in Daniel's answer (after which ~/Library/Saved Application State/ has stayed empty) and joelseph's comment on his answer.

Best Answer

The following Terminal command (found it here) will disable Resume for applications that ignore the "Restore windows when quitting and re-opening apps" settings (for Preview in this example):

defaults write com.apple.Preview ApplePersistenceIgnoreState -bool yes

Swap 'Preview' in the above command with 'TextEdit', 'Safari', 'Xcode' etc.

Also, check out this Terminal command that not only disables Resume, but also Auto Save and Versions.