I'm using zsh with prezto (on OSX and inside tmux, not sure if it matters), and from time to time history gets shared between multiple terminals.

I already added unsetopt share_history and also unsetopt SHARE_HISTORY to the end of my .zpreztorc, but it keeps mixing up history.

The output of setopt shows that "sharehistory" is still there! Even after adding unsetopt sharehistory.

  • 1
    The output of setopt might help show what options are set, if you don't know how your shell is configured.
    – thrig
    Commented Jul 11, 2016 at 15:03
  • @thrig updated my answer with the output of setopt. "sharehistory" is there o.O
    – amfcosta
    Commented Jul 11, 2016 at 17:08
  • Okay, what does something like zsh -xic exit 2>&1 | fgrep '> setopt ' show happening (or make your changes after prezto does whatever it does).
    – thrig
    Commented Jul 11, 2016 at 17:36

1 Answer 1


Try adding:

setopt no_share_history
unsetopt share_history

to ~/.zshrc ... this should work


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .