I am using iTerm2 (with zsh), and for some reason the history is shared between the different tabs and windows that are open. In most of the cases for me, this is annoying, since I have tabs per specific task, and if I have to redo some commands, I just want to be able to go back (up) in history to retrieve the last action for that window/tab only.

I have no idea how to disable this shared history, I read somewhere that you can enable shared history in zsh, but afaik I have done no such thing.

Can anybody point me in the right direction?


Executing the following should do the trick (use setopt to reenable them):

unsetopt inc_append_history
unsetopt share_history
  • 3
    Do I add these to my .zshrc? – nathanvda Dec 21 '12 at 11:04
  • 1
    and with bash??? – nkint Jan 22 '13 at 21:31
  • 3
    @nathanvda yep, you add this to .zshrc. – Aram Kocharyan Jan 27 '15 at 3:00
  • 1
    What about bash shell? – A.D Jul 14 '16 at 16:03
  • 4
    I am getting -bash: unsetopt: command not found. Is it possible that this is something tmux related? Afaik I am not using tmux, but I am still experiencing the same problem as OP – TabeaKischka Oct 18 '16 at 16:26

You must log in to answer this question.

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