Search code examples
zshiterm2oh-my-zsh

How to stop ZSH from merging history for all closing tabs?


I use combination of zsh with oh-my-zsh and iTerm2 for development on Mac. I'm frustrated with the following issue:

  • N tabs opened
  • close the terminal
  • reopen it (with Use system Window Restoration Setting)
  • the history from all previously opened tabs got merged into one for every reopened tab

The question: How to preserve separated history for every reopened tab?


Solution

  • Per https://github.com/robbyrussell/oh-my-zsh/issues/2537,

    Add unsetopt share_history to your .zshrc file.