Separate zsh histories after restart (iTerm2)
I don't use iTerm, but I think this is a property of its Session Restoration feature: https://iterm2.com/documentation-restoration.html
Try turning it off and see if it makes any difference.
Besides, starting with macOS Big Sur, you don't even need this feature. macOS now comes with &quot;Resume Support: Save/Restore Shell State&quot;, which is by default enabled for both Bash and Zsh, no matter what terminal you use, and which support per-session history. Read the file /etc/zshrc_Apple_Terminal for more info.