diff options
| author | Lucas Burns <44355502+lmburns@users.noreply.github.com> | 2022-03-13 14:53:49 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-13 19:53:49 +0000 |
| commit | 7f587418daf8e7ddc5e32f06f85e9724c2ecf355 (patch) | |
| tree | 0b99cff50d1507a90409e2efe536da0bed8af1e4 /src/command | |
| parent | Update fish bindings. (#265) (diff) | |
| download | atuin-7f587418daf8e7ddc5e32f06f85e9724c2ecf355.zip | |
Fix `history list --cwd` errors (#278)
Diffstat (limited to '')
| -rw-r--r-- | src/command/history.rs | 4 | ||||
| -rw-r--r-- | src/command/search.rs | 13 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/command/history.rs b/src/command/history.rs index a74b210b..37b4b9dd 100644 --- a/src/command/history.rs +++ b/src/command/history.rs @@ -174,7 +174,7 @@ impl Cmd { let history = match (session, cwd) { (None, None) => db.list(None, false).await?, (None, Some(cwd)) => { - let query = format!("select * from history where cwd = {};", cwd); + let query = format!("select * from history where cwd = '{}';", cwd); db.query_history(&query).await? } (Some(session), None) => { @@ -183,7 +183,7 @@ impl Cmd { } (Some(session), Some(cwd)) => { let query = format!( - "select * from history where cwd = {} and session = {};", + "select * from history where cwd = '{}' and session = {};", cwd, session ); db.query_history(&query).await? diff --git a/src/command/search.rs b/src/command/search.rs index c9942143..6e7ec25b 100644 --- a/src/command/search.rs +++ b/src/command/search.rs @@ -1,7 +1,6 @@ use chrono::Utc; use eyre::Result; -use std::time::Duration; -use std::{io::stdout, ops::Sub}; +use std::{io::stdout, ops::Sub, time::Duration}; use termion::{event::Key, input::MouseTerminal, raw::IntoRawMode, screen::AlternateScreen}; use tui::{ @@ -14,9 +13,11 @@ use tui::{ }; use unicode_width::UnicodeWidthStr; -use atuin_client::database::Database; -use atuin_client::history::History; -use atuin_client::settings::{SearchMode, Settings}; +use atuin_client::{ + database::Database, + history::History, + settings::{SearchMode, Settings}, +}; use crate::command::event::{Event, Events}; @@ -96,7 +97,7 @@ impl State { .iter() .enumerate() .map(|(i, m)| { - let command = m.command.to_string().replace("\n", " ").replace("\t", " "); + let command = m.command.to_string().replace('\n', " ").replace('\t', " "); let mut command = Span::raw(command); |
