修复 zsh: corrupt history file

2023-05-12 01:36:13 +0800 CST 1 min read views: 113

错误

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
zsh: corrupt history file /home/deloz/.zsh_history

执行以下命令修复

cd ~
mv .zsh_history .zsh_history_bad
strings .zsh_history_bad > .zsh_history
fc -R .zsh_history
rm ~/.zsh_history_bad