aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/client/search/interactive.rs
diff options
context:
space:
mode:
authorYummyOreo <bobgim20@gmail.com>2023-03-05 13:00:59 -0600
committerGitHub <noreply@github.com>2023-03-05 19:00:59 +0000
commite9c5e1d85c5c1d3310fb7994c474f9462c0bca97 (patch)
tree22ca21bc9f8a6b6fb860acc89ae69008df90e262 /src/command/client/search/interactive.rs
parentBump debian from bullseye-20230208-slim to bullseye-20230227-slim (#744) (diff)
downloadatuin-e9c5e1d85c5c1d3310fb7994c474f9462c0bca97.zip
Windows support (#754)
* adds support for getting home dir in windows * fixes bug * adds windows server support + build for linux ^| todo: test server on linux * improvements to redability * removes comment * returns if windows when importing auto * this should be here, to prevent double inputs * adds explanation to why we have to throw away 1 event in the tui * better message when running atuin import on windows + spell fix
Diffstat (limited to '')
-rw-r--r--src/command/client/search/interactive.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/command/client/search/interactive.rs b/src/command/client/search/interactive.rs
index c5c983ac..05ab03e4 100644
--- a/src/command/client/search/interactive.rs
+++ b/src/command/client/search/interactive.rs
@@ -475,6 +475,13 @@ pub async fn history(
let initial_input = app.input.as_str().to_owned();
let initial_filter_mode = app.filter_mode;
+ {
+ // We do this because windows does double inputs and captures the `Enter` when running a
+ // command
+ #[cfg(target_os = "windows")]
+ let _ = event::read();
+ };
+
let event_ready = tokio::task::spawn_blocking(|| event::poll(Duration::from_millis(250)));
tokio::select! {
@@ -499,7 +506,6 @@ pub async fn history(
results = app.query_results(settings.search_mode, db).await?;
}
};
-
if index < results.len() {
// index is in bounds so we return that entry
Ok(results.swap_remove(index).command)