Share history in multiple zsh shell

Posted by michael on Super User See other posts from Super User or by michael
Published on 2012-12-15T00:34:31Z Indexed on 2012/12/17 23:05 UTC
Read the original article Hit count: 262

Filed under:

I am trying to setup zsh so that it shares command history between different zsh sessions:

  • in multiple tabs
  • in multiple gnome-terminals
  • in different screen sessions

I have put this in .zshrc

#To save every command before it is executed (this is different from bash's history -a solution):
setopt inc_append_history

#To retrieve the history file everytime history is called upon.
setopt share_history

but that does not work.

e.g. I type 1 command: gedit afile and then I go to and zsh and type history. I don't see gedit afile.

output of 'setopt' is

 % setopt
nohistbeep
histexpiredupsfirst
histfindnodups
histignorealldups
histignoredups
histignorespace
histnostore
histreduceblanks
histsavenodups
histverify
incappendhistory
interactive
monitor
promptsubst
sharehistory
shinstdin
zle

How can I achieve this?

© Super User or respective owner

Related posts about zsh