Hacker News new | ask | show | jobs
by monroewalker 487 days ago
Anyone else have their zsh history get truncated occasionally? Not sure where in my setup the issue is but sometimes the history file will just be recreated. I have all the histsize and other env vars set correctly and I haven’t been able to correlate it to anything in particular I’m doing when it happens
1 comments

Occasionally happens to me too. I believe I researched the cause being some kind of history corruption (eg bad control characters mistakenly pasted/output), and zsh will just make new history file if it detects corruption.

Now, I made myself a cron script that once a day just copies the history file to a backup folder, so that I can bring it back if it ever corrupts.