A long-standing bug causing intermittent data loss in Zsh history files has been addressed in Zsh version 5.9.2, released on July 12th, 2026. Users previously experienced commands disappearing from their ~/.zsh_history file, making them unsearchable via Ctrl+R.
The primary symptom was the absence of recently executed commands in the shell history, often resulting in the history file containing only very old entries. The file itself showed no visible corruption, but the number of lines varied inconsistently. The cause was initially unclear, with possibilities including Zsh itself, other programs, or interactions between multiple Zsh processes.
The user's investigation involved several steps. After initial attempts to restore from backups, the issue persisted. Advice from Mastodon led to exploring file system change monitoring tools like inotify. The ultimate solution involved patching Zsh to crash loudly upon encountering the bug and then analyzing the resulting core dump to pinpoint the root cause.
The user's Zsh history configuration included `HISTSIZE=4000`, `SAVEHIST=10000000`, `setopt HIST_IGNORE_DUPS`, and `setopt INC_APPEND_HISTORY`. Crucially, `unsetopt SHARE_HISTORY` was also set, meaning individual shell sessions streamed commands to a shared history file but did not share history in real-time.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
A Zsh history data loss bug, where commands disappeared from the history file, has been fixed in Zsh version 5.9.2. The fix resulted from a user's detailed investigation into the intermittent issue, which involved tracing file system changes and ultimately patching Zsh to analyze crash dumps.