Limit what Terminal remembers—and stop old windows reopening on your Mac
Terminal can retain a long live scrollback and can restore text when a window reopens. They have separate controls. This is mainly about privacy, speed and calmer sessions—not a typical multi-gigabyte cleanup target.
Set both row limits
- Open Terminal > Settings > Profiles.
- Select the profile you actually use, then open Window.
- Under Scrollback, turn on Limit number of rows to and enter your chosen count.
- Under Resume, keep or clear Restore text when reopening windows.
- If restore stays on, also set Limit number of restored rows to.
A value such as 10,000 rows is only an example you choose, not an Apple recommendation and not a byte estimate. Row width, Unicode and command output all change the memory and storage involved.
Forget the previous windows once
Hold Shift while opening Terminal. Apple says this makes the app forget the windows that were open when it last quit, without changing the global setting. At logout or restart, clear Reopen windows when logging back in if you do not want the whole session restored.
The global switch overrides Terminal
System Settings > Desktop & Dock > Windows > Close windows when quitting an application prevents saved windows from reopening and overrides Terminal's restore choices. Do not manually delete ~/Library/Saved Application State or Terminal databases; the settings preserve the behavior you actually want.
For genuinely large development leftovers, Homebrew's Cellar, Caskroom and cache are usually more useful to measure than Terminal text.
Zofle points you toward storage that is actually large, while Terminal's own settings control what it remembers.
Download Zofle for MacSources
- Apple Terminal User Guide, Limit the number of scrollback rows.
- Apple Terminal User Guide, Change Profiles Window settings.
- Apple Support, Prevent apps and windows from reopening on Mac. Checked 11 November 2026.
Zofle Pro news
People signing up now will get Zofle Pro, with more features, for free when we launch it.