-1

I have this in my .zshrc:

setopt -o sharehistory
HISTFILE=~/.histfile.$TTY:t
HISTSIZE=500
SAVEHIST=$HISTSIZE

My understanding of sharehistory is that this would cause the HISTFILE to be updated after each command. However, it is still written only when the shell exits.

What am I missing?

1

Ah, my mistake! I need one more option:

setopt -o incappendhistory

With this, it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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