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

Re: Bug: Losing .zsh_history



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.  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).

So, where would one find the backup file if shutdown was
interrupted.  THere was nothing obvious like ~/.zsh_history.bak or
something.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt




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