Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

History not deduplicated when zsh is killed by SIGHUP



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


Messages sorted by: Reverse Date, Date, Thread, Author