Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 15 down vote accepted

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

unsetopt inc_append_history
unsetopt share_history
share|improve this answer
Do I add these to my .zshrc? – nathanvda Dec 21 '12 at 11:04
and with bash??? – nkint Jan 22 '13 at 21:31
@nathanvda yep, you add this to .zshrc. – Aram Kocharyan Jan 27 '15 at 3:00
What about bash shell? – Adi Jul 14 at 16:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.