I am running iTerm2 (v 3.2.9) and zsh (v 5.7.1). I normally have 3-4 iTerm tabs opened at the same time and each tab has its own history thanks to the following settings in my .zshrc file

SAVEHIST=10000 # Number of entries

unsetopt inc_append_history
unsetopt share_history
setopt appendhistory

However, when I close and re-open iTerm2 all tabs share the same history (I suppose they are reading from the very same HISTFILE): for example, if I have two tabs (say A and B), where the last command from A is foo and the last command from B is bar, when I close and re-open iTerm2 both tabs see either bar or foo (depending on the latest command which has been run, regardless of A or B) as the last entered command (arrow up key).

My question is: it is possible to keep separate histories even after re-launching iTerm2?

You must log in to answer this question.

Browse other questions tagged .