How to prevent one app from saving/restoring any Saved State

Solution 1:

You could try modifying the permissions on the saved state folder so it cannot be written to.

Take Preview.app for example.

Open Terminal.app from the Utilities folder under Applications and enter:

sudo chmod 440 ~/Library/Saved Application State/com.apple.Preview.savedState/

So you will want to look in the your "~/Library/Saved Application State" folder for the path to the iTerm saved state and modify the command above accordingly.

Solution 2:

There is a specific command to prevent any app from saving state, rather than just locking the state folder…

defaults write com.apple.Preview NSQuitAlwaysKeepsWindows -bool false

If you don't want a permanent switch, just to prevent it on one single occasion, then deleting/moving the Saved State folder in ~/Library/Saved Application State/ would be the simplest.

Solution 3:

I use RestoreMeNot for this purpose. It adds a prefpane where you can toggle restoration on a per app basis.