Lion saves your Applications in the state they were in when they were quit, or you lost power, or your cat peed on your keyboard.

That’s great for the most part – but there are some apps I just don’t want to save the state of. When I quit, I really want to quit.  Those windows no longer mean anything to me and I want them dead.

Lets take Safari for example – I have no desire to reopen it to find the 30-odd tabs I had open previously (I’m a messy browser).

Open up a Terminal and perform the following commands:

cd ~/Library/Saved\ Application\ State/

rm com.apple.Safari.savedState/*

chmod -w com.apple.Safari.savedState

Obviously you can change ‘com,apple.Safari.savedState’ to any application you want to remove this behaviour for.  You can find a list of apps with current saved states by running:

ls -l ~/Library/Saved\ Application\ State/

Now next time you quit Safari Lion will be unable to save the Application State and all will be right with the world again.  I understand why Apple put this behaviour in, but it would make more sense to me to only occur if an application crashes or you lose power suddenly.

UPDATE :: Fix for Preview:

For whatever reason Preview doesn’t appear under ~/Library/Saved Application State.  Instead it lives in it’s own little world in ~/Library/Containers/com.apple.Preview/Data/Library/Saved Application State/com.apple.Preview.savedState.

Fire up Terminal and run the following:

cd ~/Library/Containers/com.apple.Preview/Data/Library/Saved\ Application\ State/

rm com.apple.Preview.savedState/*

chmod -w com.apple.Preview.savedState

You may even need to run the ‘rm’ command as sudo, my user didn’t have access to delete the saved states!