Hello,
I believe I discovered an issue with saving the history file. Here's a minimal reproducer:
~ ❯ mkdir /tmp/zsh-repro
~ ❯ print "HISTFILE=/tmp/zsh-repro/histfile;HISTSIZE=100;SAVEHIST=100;setopt hist_ignore_all_dups" > /tmp/zsh-repro/.zshrc
~ ❯ ZDOTDIR=/tmp/zsh-repro zsh
rcarch% ls >/dev/null
rcarch% exit
~ ❯ ZDOTDIR=/tmp/zsh-repro zsh
rcarch% ls >/dev/null # scroll up 2 times
rcarch% kill -SIGHUP $$ # or just close the terminal
~ ❯ cat /tmp/zsh-repro/histfile
ls >/dev/null
exit
ls >/dev/null
kill -SIGHUP $$
If we launch zsh again and scroll up the history, we will receive duplicate entries.
OS: Arch Linux
zsh: 5.8, also reproducible on current master
---
Robert