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

Re: Bug: Losing .zsh_history



On Wed, Oct 05, 2022 at 04:01:01PM -0400, Eric Cook wrote:
> On 10/5/22 15:55, Dominik Vogt wrote:
> > Due to some hardware problem with the display adapter my box
> > sometimes fails to show anything on the screen but just emits some
> > error beeps while it boots.  Since I cannot log in and stop the
> > machine without the screen, I can only switch off the power.
> >
> > It has now happened twice that in the wake of the hard switch-off,
> > ~/.zsh_history got completely erased, replaced with all null
> > characters, but keeping its size (or at least nor being truncated
> > to zero size).
>
> Is it actually erased or the last line is full of null bytes?

I have no way to reproduce that at will and it has only happened
twice in the last ten years.  (Since the first time I make a copy
once in a while.)  The second time is several weeks ago.

So, I can say with certainty that when this happened I used vim to
look at the history file in a 80x24 terminal window and that
showed all "^@"s (i.e. 23 lines * 40 nulls = 920 nulls).  I'm not
sure whether I looked at any other portion of the file, but
normally I'd check the last line too.  I definitely didn't check
what was in between and definitely didn't see anything but nulls.
(The last line may be identical to the first line.)

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt




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