aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command/history.rs4
-rw-r--r--src/command/search.rs13
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);