diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2022-04-22 21:05:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-22 21:05:02 +0100 |
| commit | 508d4f476157384b0d454bee3dd6e9256560561b (patch) | |
| tree | 9eb2fbc5a9a51d3419e9e684a01fe5a2106e77c9 /src/command/client/history.rs | |
| parent | refactor (#327) (diff) | |
| download | atuin-508d4f476157384b0d454bee3dd6e9256560561b.zip | |
History filter (#329)
* 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
Diffstat (limited to 'src/command/client/history.rs')
| -rw-r--r-- | src/command/client/history.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/command/client/history.rs b/src/command/client/history.rs index b2f68f93..994cbfd5 100644 --- a/src/command/client/history.rs +++ b/src/command/client/history.rs @@ -6,7 +6,7 @@ use clap::Subcommand; use eyre::Result; use tabwriter::TabWriter; -use atuin_client::database::Database; +use atuin_client::database::{current_context, Database}; use atuin_client::history::History; use atuin_client::settings::Settings; use atuin_client::sync; @@ -97,6 +97,8 @@ impl Cmd { settings: &Settings, db: &mut (impl Database + Send + Sync), ) -> Result<()> { + let context = current_context(); + match self { Self::Start { command: words } => { let command = words.join(" "); @@ -168,7 +170,7 @@ impl Cmd { }; let history = match (session, cwd) { - (None, None) => db.list(None, false).await?, + (None, None) => db.list(settings.filter_mode, &context, None, false).await?, (None, Some(cwd)) => { let query = format!("select * from history where cwd = '{}';", cwd); db.query_history(&query).await? |
