* make enter execute the command, tab copy it
* Add config for enter_accept
enter_accept will make Atuin immediately accept an execute a command
when selected. It defaults to false in our binary, but the default
config enables it.
This means that users who already use atuin will not default to the new
behaviour unless they opt in, but new users will have it by default.
Thanks to @davidhewitt for the patch and bulk of this implementation!
Currently we have it just for zsh, but I'll follow up with other shells
(unless anyone beats me to it :D)
* Add docs
* we need to tidy up the ui code anyway
* Check if using zsh
* Update docs/docs/config/config.md
Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
---------
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
* Add commands to print the default configuration
When updating a software I often want to compare my configuration with the
configuration of the new version. To make this possible atuin can now print
the default configuration.
This also updates the example files with the actual values used as default in
the settings.rs files.
* Changed command name to 'default-config'
* Fixed merge
I'd like to extend the regex list here very soon, but start off by
automatically filtering out secrets. Do not store them in history!
I've included regex for:
1. AWS key id
2. Github pat (old and new)
3. Slack oauth tokens (bot, user)
4. Slack webhooks
5. Stripe live/test keys
Will need updating after #806
* Add kv map builder and list function
1. BREAKING - default namespace is now called "default"
2. Build an in-memory hashmap from the kv store
3. Allow listing
I need to cache the hashmap next, probs with a write-through to avoid
constant rebuilds.
Also check if BTreeMap is suitable. Sorted is useful for listing but
there's probs a better ds to use.
* Allow pure kv set, no filesystem
* Add record migration
* Add database functions for inserting history
No real tests yet :( I would like to avoid running postgres lol
* Add index handler, use UUIDs not strings
* Fix a bunch of tests, remove Option<Uuid>
* Add tests, all passing
* Working upload sync
* Record downloading works
* Sync download works
* Don't waste requests
* Use a page size for uploads, make it variable later
* Aaaaaand they're encrypted now too
* Add cek
* Allow reading tail across hosts
* Revert "Allow reading tail across hosts"
Not like that
This reverts commit 7b0c72e7e0.
* Handle multiple shards properly
* format
* Format and make clippy happy
* use some fancy types (#1098)
* use some fancy types
* fmt
* Goodbye horrible tuple
* Update atuin-server-postgres/migrations/20230623070418_records.sql
Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
* fmt
* Sort tests too because time sucks
* fix features
---------
Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
- Updates outdated mac db_path default
- Adds windows db_path default
- Adds windows, mac, linux defaults for key_path and session_path
- Changes example session_path to be different to example key_path
* [feature] store env variables in History records
WIP: remove `HistoryWithoutDelete`, add some docstrings, tests
* Create History objects through builders.
Assure in compile-time that all required fields
are set for the given construction scenario
* (from #882) split Cmd::run into subfns
* Update `History` doc
* remove rmp-serde from history
* update warning
---------
Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
* wip
* Start testing
* Store host IDs, not hostnames
Why? Hostnames can change a lot, and therefore host filtering can be
funky. Really, all we want is a unique ID per machine + do not care what
it might be.
* Mostly just write a fuckload of tests
* Add a v0 kv store I can push to
* Appending works
* Add next() and iterate, test the pointer chain
* Fix sig
* Make clippy happy and thaw the ICE
* Fix tests'
* Fix tests
* typed builder and cleaner db trait
---------
Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
* Add `delete_at` is null condition during search
Since entries are searched everytime a delete process ends, the
--delete-it-all command will enter an infinite loop if searching the
whole history.
* Remove command blanking
Command blanking may violate the `unique(timestamp, cwd, command)`
condition.
* Overwrite command with random string when deleting
* Add rand dependency to client crate
---------
Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
Typo in config key `filter_mode_shell_up_key_binding` that's fixed by
this commit, and while at it fix a minor typo in a comment.
Co-authored-by: Per Modin <per@wgtwo.com>
* Put input chunk at the top in inline mode
* Invert the search results if bar is at top
* fix styling on reversed rendering
* add setting
* settings
---------
Co-authored-by: Patrick Decat <pdecat@gmail.com>
Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
* Stop running triggers on history delete
* Move to account management dir
* Alter trigger function to only run for inserts
* wip
* Add atuin account subcommands, and re-org delete
* Clarify docs
* Delete silly dupe migration
* Um where did this come from
* Oops, insert only plz
* At least patch this on the server side so we don't loop forever
* Postgres doesn't support <microsecond precision
Use millis - almost everything should support them and they are still
faster than a human can reasonably spam a button.
* Try different workspace structure
Move main crate (atuin) to be on the same level with other crates in
this workspace
* extract common dependencies to the workspace definition
* fix base64 v0.21 deprecation warning
* questionable: update deps & fix chrono deprecations
possible panic sites are unchanged, they're just more visible now
* Revert "questionable: update deps & fix chrono deprecations"
This reverts commit 993e60f8de.
Add `-r/--reverse` flag to `atuin search` to allow searching by oldest
results first.
Example to find the oldest `cargo` command:
```
atuin search --limit 1 --reverse cargo
```
* Use XDG data directory for fish import
On MacOS, atuin was looking for fish history under "$HOME/Library/Application Support".
Now atuin honors XDG_DATA_HOME, if set, and otherwise uses "$HOME/.local/share".
* cargo fmt
---------
Co-authored-by: Charles Gould <charles@gould.dev>
* Updated client config docs
- Example `config.toml` now includes all the newest options
- `settings.rs`, `config.toml`, and `config.md` now have uniform option order
* Remove trailing space
This flag allows the user to continue searching at an offset. This is
useful for building tools that use atuin to search for previous
commands and return only one result.
```
atuin search --limit 1
atuin search --limit 1 --offset 1
atuin search --limit 1 --offset 2
```
* feat: add *Nushell* support
* refactor: use `sh` to swap `STDOUT` and `STDERR` instead of using a temporary file
* feat: include both keybindings, with the current REPL buffer passed to *Atuin*'s
* feat: don't record commands run by keybindings
* Delete all instances of a command
Our search command will de-dupe results by default. But... This isn't
great for deleting! You don't want to run it over-and-over-and-over
until all commands are deleted.
Loop the query, and keep on deleting what it returns until they are all
gone.
* Optimize delete upload
It was running a request for every element, on every sync lol
Only push a delete if needed
Future: push all deletes in one request
* Make search_mode a part of SearchState
* Allow changing search mode using ctrl+s
* Tweak state reset for switched_search_mode
* Improve search_mode display in interactive mode
* Incorporate review suggestion
* Tweak language
* Fix Clippy and format
* Support old msgpack
I forgot it isn't backwards compatible... This should fix any sync
issues resulting from the deletion PR
* Update atuin-client/src/encryption.rs
Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
* Bye bye unwrap
---------
Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
* Drop events. I'd still like to do them, but differently
* Start adding delete api stuff
* Set mailmap
* Delete delete delete
* Fix tests
* Make clippy happy
* skim-demo
* skim some more
* Weight first word match higher (#712)
* some improvements
* make skim opt-in
---------
Co-authored-by: Frank Hamand <frankhamand@gmail.com>
* Fix before/after combined with limit
Mixing filters done in Rust with filters done in SQL is _no bueno_.
Been meaning to do this for a while anyways. Search params are getting a
bit fat but oh well!
* Make an excuse for a big function sig
* Do options map_or not if
* Fix tests
* feat: add common default keybindings
* feat: add `WORD_SEPARATORS` to config as `word_chars`, as this is what *Zsh* calls it
* feat: add option for *Emacs* word jumping
* feat: scroll with `PageUp` and `PageDown`, cf #374
* Only show help if terminal strictly has more than one line
* There is no border around the input line in compact mode
* Add command preview
* Dynamic preview height
* Avoid extra allocations
Co-authored-by: Conrad Ludgate <oon@conradludgate.com>
* Address clippy error
* Merge normal and compact views code
* Add show_preview setting, disabled by default
* Convert `bool` to `int` with `if` for legibility
---------
Co-authored-by: Conrad Ludgate <oon@conradludgate.com>
* Rework Bash import
Closes#745
- Imported history is now ordered correctly
- Timestamps (when `HISTTIMEFORMAT` is set) are handled correctly
* Timestamp tests test for strict sorting
Adds a new `history_filter` setting through which users can specify a
list of regular expressions that match commands that should not be
recorded in the history.
* Allow overriding filter and search modes from CLI arguments
* Use session filter mode for bash up key binding
* We precisely do not want to add quotes here so that all arguments are properly passed
* Add --shell-up-key-binding hidden command argument and filter_mode_shell_up_key_binding configuration option to allow customizing the filter mode used when atuin is invoked from a shell up-key binding
* Correct up binding for zsh
Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>