Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug: Losing .zsh_history
- X-seq: zsh-users 28181
- From: Dominik Vogt <dominik.vogt@xxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Bug: Losing .zsh_history
- Date: Wed, 5 Oct 2022 23:32:57 +0100
- Archived-at: <https://zsh.org/users/28181>
- In-reply-to: <CAH+w=7ZrrKqW35H6uX623KOCe7Bx1BJyCiRzc+F=24spHD6=dA@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- Mail-followup-to: Zsh Users <zsh-users@xxxxxxx>
- References: <Yz3hLjGCw/bccjFY@localhost> <CAH+w=7ZrrKqW35H6uX623KOCe7Bx1BJyCiRzc+F=24spHD6=dA@mail.gmail.com>
- Reply-to: dominik.vogt@xxxxxx
On Wed, Oct 05, 2022 at 03:16:27PM -0700, Bart Schaefer wrote:
> On Wed, Oct 5, 2022 at 12:55 PM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
> >
> > I wonder if this situation could be prevented by changing the code
> > that writes the history file at exit. Is truncating the file to
> > zero size part of the procedure? When I need to write a file in a
> > safe manner, the procedure normally looks like this:
> >
> > * Create file.new
> > * Rename file to file.old
> > * Rename file.new to file
> > (* Possibly sync filesystem)
> > * Erase file.old
>
> zsh is not going to sync the filesystem for you.
Of course.
> Other than that,
> though, the default behavior should be close to what you just
> described, see the HIST_SAVE_BY_COPY option (which you should make
> sure has not been unset).
> You might also look at the setting of the HIST_FCNTL_LOCK option.
Both at default:
$ set -o
nohistsavebycopy off
histfcntllock off
So, the question is how this can happen at all.
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
Messages sorted by:
Reverse Date,
Date,
Thread,
Author