From 61cfb317f078a19ef8268dd9a76f9d468aacb34d Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Sun, 14 Jun 2026 21:08:58 +0000 Subject: [PATCH] fix: rofi cancellation --- --- a/crates/remowt-client/src/subprocess.rs +++ b/crates/remowt-client/src/subprocess.rs @@ -64,12 +64,12 @@ drop(stdin); let drain_out = async move { if let Some(s) = stdout { - drain_to_tracing(s, "".to_owned(), false).await; + let _ = drain_to_tracing(s, "".to_owned(), false).await; } }; let drain_err = async move { if let Some(s) = stderr { - drain_to_tracing(s, "".to_owned(), true).await; + let _ = drain_to_tracing(s, "".to_owned(), true).await; } }; let wait = async move { --- a/crates/remowt-ui-prompt/src/rofi.rs +++ b/crates/remowt-ui-prompt/src/rofi.rs @@ -46,7 +46,7 @@ "-mesg", &mesg, "-sync", - "-only-match", + "-no-custom", "-p", fixup_prompt(prompt), "-format", @@ -79,6 +79,15 @@ .wait_with_output() .await .map_err(|e| Error::InputError(format!("failed to wait for rofi: {e}")))?; + match out.status.code() { + Some(0) => {} + Some(1) => return Err(Error::Cancel), + other => { + return Err(Error::InputError(format!( + "rofi exited with status {other:?}" + ))); + } + } let stdout = out .stdout .strip_suffix(b"\n") @@ -133,6 +142,15 @@ .wait_with_output() .await .map_err(|e| Error::InputError(format!("failed to wait for rofi: {e}")))?; + match out.status.code() { + Some(0) => {} + Some(1) => return Err(Error::Cancel), + other => { + return Err(Error::InputError(format!( + "rofi exited with status {other:?}" + ))); + } + } let stdout = out .stdout .strip_suffix(b"\n") -- gitstuff