How to see terminal history on Mac (and find output that scrolled away)
You can find the command you ran yesterday, and the output that told you what broke is gone.
To see terminal history on a Mac, type history in Terminal. Since macOS 10.15, Apple says a Mac uses zsh as its default shell, and the zsh manual says history is the same as fc -l, which lists your recent commands. Run fc -l 1 to list from the first event in your history list. The output those commands printed lives in the Terminal window's scrollback, not in that list.
When the output scrolled away or got cleared, a screen history app like ReMynd can find it, if your terminal was the window you were working in after you installed it.
Lost the error message your terminal printed an hour ago? Download ReMynd
Do you need the command, or what it printed?
Ask that first, because on a Mac they live in two places. Commands sit in your shell's history list. What they printed sits in the terminal app's scrollback, which you set per profile.
If you're not sure which app the thing was even in, which app did I see it in helps you narrow it down. And if you can't find the Terminal app itself, where is Terminal on Mac covers that.

Your zsh history keeps commands, and the scrollback keeps what they printed. Illustration by ReMynd.
The 4 places terminal history lives on a Mac
Terminal history on a Mac lives in these places, and each one keeps something different.
- The zsh history list.
historyorfc -llists it. The zsh manual says HISTSIZE is the maximum number of events stored in the internal history list. - The zsh history file. HISTFILE is the file to save the history in when an interactive shell exits. If it's unset, the history is not saved. SAVEHIST sets the maximum number of history events to save in that file.
- Terminal's scrollback. Apple's Terminal guide says the Window settings let you set a limit to the number of rows in the Terminal window that you can scroll back through. A separate Resume option restores the text from a previous app session.
- iTerm2 scrollback. If you use iTerm2, its Scrollback lines setting is the number of lines kept above the visible part of the screen.
How to see zsh history with dates and search it
zsh history gets more useful with two flags.
- List from the start.
fc -l 1lists from event 1. The zsh manual says that with -l and no range, fc lists the last 16 events. - Add timestamps.
fc -liprints full time-date stamps in ISO8601 format. To write timestamps into the history file, turn on EXTENDED_HISTORY, which saves each command's beginning timestamp and duration. - Search for one command.
fc -l -m 'kubectl' 1lists only the history events matching the quoted pattern.
What each kind of terminal history keeps
Each tool keeps a different slice of your terminal output history.
| Where you look | What it keeps | What it misses | Source |
|---|---|---|---|
| zsh history (history, fc -l) | Your history events, and their saved timestamps if EXTENDED_HISTORY is on | Events past HISTSIZE or SAVEHIST | zsh builtins, zsh options, zsh parameters |
| Terminal scrollback | Rows you can scroll back through, within the limit you set | Rows past the limit you set | Apple Terminal guide |
| Terminal export (Command-S) | The window's text, through Export text as | Anything printed after you export | Apple Terminal guide |
| iTerm2 scrollback | Lines kept above the visible screen | Lines from alternate screen mode, which are saved only if that option is enabled | iTerm2 docs |
| ReMynd screen history | Text that was on your screen in the window you were working in, after install | Anything before install, apps and sites you exclude | ReMynd |
A simple decision path
Start with the quickest check and stop when you find it.
- Search the open window. Press Command-F in Apple's Terminal and type a word from the output. Command-Home scrolls to the top.
- Jump between marks. Command-Up Arrow jumps to the previous mark in Apple's shortcut list.
- Find the command. Run
fc -l -m 'word' 1to get the exact command back, then run it again if it's safe to. - Export before you clear. Command-S exports the window's text. Do it before Command-K, which Apple lists as Clear to start.
- Search your screen history. If the output scrolled past your limit, got cleared, or the window is closed, and ReMynd was installed when it printed, search what was on your screen for a word from the error.
My own fix, not Apple's: raise the scrollback limit on the profile you use for long builds, and keep iTerm2 off unlimited unless you've got the memory for it.
Where ReMynd fits
ReMynd is a desktop app that gives your computer local photographic memory, for you and your AI agents. It locally captures your screen history and keeps the searchable index on your computer.
So a stack trace, a config value or a build log that was in your terminal, while it was the window you were working in after you installed ReMynd, becomes searchable by the words in it. Text recognition reads the window you're working in, not the windows behind it.
Same idea as finding something you saw on your screen. If the output came from an agent, Claude Code keeps suggesting the fix I already tried and recovering a Claude Code session after a crash cover the agent side.
If the output came from Claude Code, Ctrl+O opens its transcript viewer, which Anthropic's docs say shows detailed tool usage and execution. Developers can also run ReMynd's command from the terminal itself, once Claude Code or Codex is turned on in Settings, Integrations.
Your screen history is stored on your computer by default, and nothing is uploaded to us unless you turn on optional cloud sync. You can pause capture or block any app or site. That's how ReMynd's own pages put it, as of December 2026. On a Mac, ReMynd needs screen recording permission, which Apple's guide puts in System Settings under Privacy & Security, Screen & System Audio Recording.
Honest limits
These limits matter before you rely on any of this.
- None of the zsh manual pages I read on December 3, 2026 describes the history list or history file keeping a command's output. For output, use scrollback, an export or your screen history.
- ReMynd captures only what is on your screen, starting from install. It can't recover output from before that.
- Output in a window you weren't working in, or in a terminal behind another window, isn't read.
- On a Mac, ReMynd needs Apple silicon and macOS 15 or later. ReMynd also runs on Windows 11 (x64 or arm64).
The short version
Use history or fc -l when you need the commands. For output, search the open window with Command-F, and export with Command-S before you clear. When an incident is the reason you're digging, the incident timeline template helps you write it up.
Want the next error your terminal prints to stay findable after it scrolls away? Download ReMynd