If you are using Zsh as your shell in Monterey, each time the Terminal is quit, and relaunched, there is no scrollable history available in the new Terminal window until you issue new commands. The following commands will show a brief, or entire history. The assumption is that one knows how to correctly configure history in the ~/.zshrc startup file:
# brief history since Terminal was launched
history
# entire history across multiple Terminal launches
history 1
and the following Zsh function placed in your ~/.Zshrc file can act like grep across all history to find a command or argument to a command:
hgrep () { fc -Dlim "*$@*" 1 }
For instance, to locate the history item where I opened a custom AppleScript to flatten a PDF:
hgrep flat
992 2022-08-04 07:00 0:00 open flatxPDF.applescript
No need to scroll through any history with this Zsh function.