hishtory
hishtory copied to clipboard
Indexing prior history
Prior to installing hishtory, my zsh history was stored in $HISTFILE. Is there an existing tool to do a one time index of that into hishtory.db?
Yes! Just do cat $HISTFILE | hishtory import to import it. This generally happens by default, but if you have a non-standard HISTFILE it currently won't work (though I will fix that).
Documented in ed3c67daf9b63aac245cc77f072da5a3817c08ed
Just checked, and it should have respected HISTFILE for zsh, did it not? Though I realized that it didn't respect it for bash which I fixed in 6ded150.
Marking as closed. Please reopen if you're still running into this or have any other issues.
@ddworken I appreciate the details and added documentation, but it still doesn't work, even after the manual import. See the following screenshot:
Any suggestions on how to debug?
Can you execute PRAGMA journal_mode = WAL; in sqlite and then re-run the SELECT count(*) FROM history_entries? I suspect that the history entries were imported, but they just weren't ever checkpointed. If that doesn't show all of them, can you run hishtory export | wc -l?
No luck unfortunately

Importing does not work for me. I have $HISTFILE in a non-standard location.
@ddworken It's a bit of a minor issue, but the installation script does not respect $ZDOTDIR, it instead creates a new .zshrc in ~. I was a bit confusing because adding these lines isn't mentioned in the readme.
re: importing: Thanks! I'm still looking into this.
re: ZDOTDIR: Thank you for pointing this out! I filed #29 to track this and will absolutely get this fixed.
@ddworken Do you have any updates regarding indexing prior history?