Skip to main content

Fix corrupted zsh error

If you see this error in your terminal

zsh: corrupt history file /home/go/.zsh_history

This means that your history won't be saved and it will break reverse search too.

Here are the steps you can use to fix the issue:

cd ~

mv .zsh_history .zsh_history_bad

strings .zsh_history_bad > .zsh_history

fc -R .zsh_history

rm ~/.zsh_history_bad