Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 13 down vote accepted

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

defaults write NSQuitAlwaysKeepsWindows -bool false

This is general, so of course, substitute safari or quicktimeplayerX or whatever in the 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.

share|improve this answer
You can also close all the windows when quitting. Sometimes I like it to be clean. Sometimes I like retaining the old output. – bahamat Sep 14 '11 at 2:26

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 RestoreScrollbackLines 0
share|improve this answer

There seems to be one case where disabling NSQuitAlwaysKeepsWindows does not work: When the Terminal is killed by killall Terminal, and probably also when it crashes or when it is forced quit.

I use killall Terminal regularly, but when the resume kicks in, it messes up my bash history. Basically, commands from the session after the resume will not be saved. Normal saving behaviour is only restored after I quit and reopen It appears, though, that completely disabling any resume features fixes bash history:

chmod a-rwx ~/Library/Saved\ Application\ State/

Thanks to willWorkForCookies’s answer to How to prevent one app from saving/restoring any Saved State.

share|improve this answer

You can actually deactivate "save state" on per-app basis, have a look at


share|improve this answer
Welcome to Apple! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – daviesgeek Mar 17 '12 at 16:28
This provides no more information than the original accepted answer. – Tetsujin Mar 12 '15 at 11:01
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Tetsujin Mar 12 '15 at 11:02

The only way to do this is to completely disable the resume feature in Lion

share|improve this answer
This does work, but it's overkill since defaults write NSQuitAlwaysKeepsWindows -bool false will quash this behavior on terminal only. – bmike Sep 13 '11 at 22:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.