Skip to content

Instantly share code, notes, and snippets.

@edugon
Created May 2, 2020 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edugon/c37049b4c35fe512bfdf29e685ef3e86 to your computer and use it in GitHub Desktop.
Save edugon/c37049b4c35fe512bfdf29e685ef3e86 to your computer and use it in GitHub Desktop.
Fix corrupt history file for zsh
#!/usr/bin/env zsh
# George Ornbo (shapeshed) http://shapeshed.com
# License - http://unlicense.org
#
# Fixes a corrupt .zsh_history file
mv ~/.zsh_history ~/.zsh_history_bad
strings ~/.zsh_history_bad > ~/.zsh_history
fc -R ~/.zsh_history
rm ~/.zsh_history_bad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment