This history popup window is enabled when you have "iTerm2 Shell Integration" installed: https://iterm2.com/documentation-shell-integration.html
More detailed: it's the "View command history"-feature:
It can be seen and searched in the toolbelt or quickly accessed in a popup window.
You can either:
ITERM_SHELL_INTEGRATION_INSTALLED=Yes
in $HOME/.iterm2_shell_integration.zsh
or
[[ -e "$HOME/.iterm2_shell_integration.zsh" ]] && source "$HOME/.iterm2_shell_integration.zsh"
from your $HOME/.zshrc