One of the most useful features in OS X Lion is the ability for applications to automatically resume where they left off. This is apparent in applications such as Safari when after quitting and subsequently reopening, the previous tabs and websites are displayed. If the application was in fullscreen mode, it will reopen in the space space fully sized.
Auto-Resume is very convenient if you wish to continue working from the previous application state, but it can be rather irritating in apps such as Preview because all the documents that were open in the last session are opened again when Preview loads.
Auto-Resume can be desirable in certain applications but not others; it can cause your computer to seem sluggish because applications can also take longer to open.
Fortunately, there are several simple techniques to disable Resume as follows.
- Disable systemwide for every application
- Disable per application using the Terminal application
- Disable once only upon quitting the application
Disable Resume For All Applications
To turn off automatic resume for every application in Lion, perform the following steps.
- Open System Preferences either from the Dock or the Apple Menu
- Select the General settings in the Personal section
- Enable the tick box in the lower section named Restore windows when quitting and reopening apps
Once this setting is enabled, whenever you reopen an application its previous state will not be not remembered.
Disable Resume Per Application
Depending on the situation, it may be desirable to selectively choose which applications can resume automatically. In Safari it can be particularly useful, but you may prefer to disable it in Preview and Pages for example.
There are two main methods as follows.
Method 1: The Alternative Quit Command
Rather than exit an application using the Command + Q shortcut (⌘Q), the alternative combination of Option + Command + Q will temporarily disable Resume. In this case when Safari reopens, it shows the default new page rather than reloading any tabs that were open before. It also means that applications don’t necessarily reopen in the same mode (i.e. fullscreen or windowed) or space.
The shortcut sequence above doesn’t permanently alter the resume function for the application. In other words, the next time you exit an application with a regular Command + Q, its current state will be saved and resumed the next time it’s opened.
Method 2: Change the Application Permissions Using Terminal
You can disable Resume for individual applications using the defaults write command within Terminal. This method should be used with care as it’s quite easy to accidentally change file permissions and even delete files if you are not familiar with Terminal.
Here are some common examples to disable Resume.
- Preview: defaults write com.apple.Preview NSQuitAlwaysKeepsWindows -bool false
- Safari: defaults write com.apple.Safari NSQuitAlwaysKeepsWindows -bool false
- Pages: defaults write com.apple.iWork.Pages NSQuitAlwaysKeepsWindows -bool false
Of course, Resume can be turned off for any application you choose. But how do you know which name to use in the default writes command?
Open the Saved Application State folder named ~/Library/Saved Application State/. A simple method is to type this path into the Go To Folder popup from the Finder’s Go menu. Alternatively just use press Command + Shift + G and enter the folder name.
This folder displays a list of subfolders for each application in the following format: com.developer.application.savedState.
For example, com.apple.iCal.savedState
This makes it straightforward to determine the parameters to use in the default writes command. Note that the savedState suffix is always omitted when the command is entered.
The basic steps to run the defaults write command and disable Resume is:
- Open the Saved Application State folder as above
- Open Terminal from the Applications folder, or from Spotlight
- In Terminal type defaults write com.developer.application NSQuitAlwaysKeepsWindows -bool false
Example: defaults write com.Apple.Preview NSQuitAlwaysKeepsWindows -bool false
To enable Resume once more, simply change the -bool false flag to -bool true
Example: defaults write com.apple.Preview NSQuitAlwaysKeepsWindows -bool true