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

Re: The HIST_EXPIRE_DUPS_FIRST might corrupt and wipe partially history file if many shells exit at the same time



Hi,

On 19/03/2023 22.34, Bart Schaefer wrote:
> On Sun, Mar 19, 2023 at 2:17 PM Piotr Karbowski
> <piotr.karbowski@xxxxxxxxxxxxx>  wrote:
>> Anything else I could provide to help norrowing it down?
> Did you try my suggestion of timestamps from .zlogout?
>
> If the shell is being killed from a controlling app or by the OS,
> there's not a lot we can do.  If that's not what's happening, it would
> be helpful to know.

Added to .zlogout, will report back the findings when I can reproduce it
again. However looking at code, it does write data to new file then does
rename. The rename is guaranteed to be atomic so in case of killing zsh
instances I would expect at worst to lost the new history entires, not
loosing the end-part of the history file, this looks like something bad
has happened and it still renamed the partial(?) file into .zsh_history
at the end.

-- Piotr.





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