Is there a way to get Terminal on Lion to start up cleanly (without the buffered history)?

How can I prevent Terminal from showing me my old output when it starts?

I would like it to always start with a clean window.


You can change terminal only with this one command to write a new preference for that specific app.

defaults write com.apple.terminal NSQuitAlwaysKeepsWindows -bool false

This is general, so of course, substitute safari or quicktimeplayerX or whatever in the com.apple.terminal portion of the command as needed. This setting switches the default save behavior upon quitting that one app. You'll find many of the other apps that work well with this setting by searching on NSQuitAlwaysKeepsWindows.

Of course, you should issue this defaults command after closing all windows and then quitting the application to ensure the settings are read the next time Terminal starts.


Besides setting the preference to always suppress Resume, you can also control this when quitting by pressing the Option modifier key, so that "Quit …" becomes "Quit and Discard Windows". e.g., you can type Option-Command-Q to quit without saving state. You can also press the Shift modifier when an application is opening to prevent it from restoring state for Resume.

There is also a Terminal preference (without UI) for controlling how many lines of the scroll-back to restore, which you can set to zero, although it still restores the display contents:

defaults write com.apple.Terminal RestoreScrollbackLines 0