Why doesn't my history save between zsh tabs?

Viewed 582

I do some work in a single terminal tab:

> ls
> ps

Then I close the terminal, and open a new terminal, and run history

> history
    1  history

Here is another wierd thing

> echo $0
-zsh
> echo $SHELL
/bin/bash

My .zshrc file looks like this

setopt inc_append_history
setopt share_history

How can I make it preserve the history between tabs?

1 Answers

I think I figured it out.

I had HISTFILE specified in my .zprofile; but I had setopt share_history in my .zshrc. I moved the HISTFILE into the .zshrc, prior to the setopt line. Now it works fine. Thanks

Related