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

Re: Bug: Losing .zsh_history



On 10/5/22, Dominik Vogt <dominik.vogt@xxxxxx> 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).  This is on Linux 4.x

Since this is linux, and assuming the problem is only the display and
you haven't fully locked the kernel, you could enable the sysrq magic
keys[1] if they aren't already, and instead of doing a hard power off,
press altgr(right alt) + printscreen + s u s b (wait a little between
each), the u will remount all mounts readonly, the s issues a sync,
and b will soft-reboot.

[1] See sysrq.txt in the kernel source

-- 
Mikael Magnusson




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