ddworken / hishtory

Your shell history: synced, queryable, and in context

Home Page:https://hishtory.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regexp search supports.

hongyi-zhao opened this issue · comments

Can we let hishtory support regexp-based search?

Hishtory is built on top of sqlite, and sadly, sqlite doesn't support regex by default. Furthermore, since we use modernc.org/sqlite it isn't possible to load sqlite extensions. All of this makes it rather difficult to support regexes. Technically, I think this could be done via a trigram-like approach where we could use sqlite to extract potential matches, and then use a go-based regex to filter those matches. This would work, but performance wouldn't be great.

But I am a bit curious: How important is this feature request in your eyes? If it is rare need, you could just do hishtory export | grep .... Or if this is a common need, I'm curious about what shortcomings you're running into with the default search?

It is not that the regexp search is necessary, and I just say that this will bring greater flexibility.