zsh-workers
 help / color / mirror / code / Atom feed
From: "Robert Cegliński" <rob.ceglinski@gmail.com>
To: zsh-workers@zsh.org
Subject: History not deduplicated when zsh is killed by SIGHUP
Date: Sat, 5 Dec 2020 11:04:29 +0100	[thread overview]
Message-ID: <CAEyK4ex8Uru_tN6oGNqMwHEDkqDzBhYk+sNeiKgak3vnV_q_YA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 730 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 951 bytes --]

                 reply	other threads:[~2020-12-05 10:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEyK4ex8Uru_tN6oGNqMwHEDkqDzBhYk+sNeiKgak3vnV_q_YA@mail.gmail.com \
    --to=rob.ceglinski@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).