jimhester / per-directory-history

Per directory history for zsh, as well as global history, and the ability to toggle between them with ^G.
zlib License
259 stars 36 forks source link

Corrupt history file causes inability to execute commands #34

Open piegamesde opened 4 years ago

piegamesde commented 4 years ago

Reopen of https://github.com/jimhester/per-directory-history/issues/16

literalsands commented 4 years ago

Error handling would be better, but this is a workaround.

You can add a space before a command to avoid adding it to the history.

 mv /path/to/corrupted/history/file /path/to/corrupted/history/file_corrupted
# Recover history file.
strings /path/to/corrupted/history/file_corrupted > /path/to/corrupted/history/file

Notice the space before mv.