* Batch input events and only query once they are finished
This simplifies the code a lot (no more bounded channel) and yields
the same performance improvement with scroll wheel spam while fixing copy/paste
* Clippy
* fmt
* Use blocking wait before emptying events channel
This was causing a busy loop
* Update query on filter mode change
* Attempting to implement zsh-histdb import
Import compiles passes tests, but doesn't run b/c of async runtime.
zsh-histdb uses sqlite, and sqlx-rs is async, but import code is sync.
* More working on importing histdb
* Rewriting tests and using `Vec<u8>` instead of `String`
- Rewriting tests to eliminate depencency on local file system
- Using `Vec<u8>` for command strings instead of `String` to eliminate
the utf8 errors i was seeing previously. Seems to be working.
* Running fmt
Co-authored-by: Bradley Noyes <b@noyes.dev>
* Add history filters, and hotkey toggle
Switch between different search modes to narrow down the history you
want - global search for all history, host for all history from your
current machine, session for the current shell session, and directory
for the current directory
The default can be configured via `filter_mode`
* Update docs
* Add context
* Add SearchMode fzf.
Add a new search mode "fzf" that tries to mimic the search syntax of
https://github.com/junegunn/fzf#search-syntax
This search mode splits the query into terms where each term is matched
individually. Terms can have operators like prefix, suffix, exact match
only and can be inverted. Additionally, smart-case matching is
performed: if a term contains a non-lowercase letter the match will be
case-sensitive.
* PR feedback.
- Use SearchMode::Fuzzy instead of SearchMode::Fzf
- update docs
- re-order tests so previous fuzzy tests come first, add more tests for each operator
* PR comments: remove named arguments, match expression
* PR comments: macro -> async func
* add test demonstrating problem
* add a reordered fuzzy-search mode that presents shorter matches first,
rather than using strict chronological ordering.
* fix warnings, refactor interface to minspan slightly
The data part of the add history request is actually a string. I don't
want to introduce any structure here, and would rather keep it as "just
a blob". Even if that blob has structure secretly!
My fault for missing this in the last review
Also:
- Ensures that a key is generated as soon as a user registers!
- Ensures that "atuin key" will generate a key if needed, and doesn't
double base64 encode data
And a few other little fixes :)
Resolves#85Resolves#86
* Begin moving to sqlx for local too
* Stupid scanners should just have a nice cup of tea
Random internet shit searching for /.env or whatever
* Remove diesel and rusqlite fully
* Switch to Cargo workspaces
Breaking things into "client", "server" and "common" makes managing the
codebase much easier!
client - anything running on a user's machine for adding history
server - handles storing/syncing history and running a HTTP server
common - request/response API definitions, common utils, etc
* Update dockerfile