git.delta.rocks / remowt / refs/commits / 61cfb317f078

difftreelog

fix rofi cancellation

xwvqqwwvYaroslav Bolyukin3 days agoparent: #023a07f.patch.diff
in: trunk

2 files changed

modifiedcrates/remowt-client/src/subprocess.rsdiffbeforeafterboth
64 drop(stdin);64 drop(stdin);
65 let drain_out = async move {65 let drain_out = async move {
66 if let Some(s) = stdout {66 if let Some(s) = stdout {
67 drain_to_tracing(s, "<child stdout>".to_owned(), false).await;67 let _ = drain_to_tracing(s, "<child stdout>".to_owned(), false).await;
68 }68 }
69 };69 };
70 let drain_err = async move {70 let drain_err = async move {
71 if let Some(s) = stderr {71 if let Some(s) = stderr {
72 drain_to_tracing(s, "<child stderr>".to_owned(), true).await;72 let _ = drain_to_tracing(s, "<child stderr>".to_owned(), true).await;
73 }73 }
74 };74 };
75 let wait = async move {75 let wait = async move {
modifiedcrates/remowt-ui-prompt/src/rofi.rsdiffbeforeafterboth
46 "-mesg",46 "-mesg",
47 &mesg,47 &mesg,
48 "-sync",48 "-sync",
49 "-only-match",49 "-no-custom",
50 "-p",50 "-p",
51 fixup_prompt(prompt),51 fixup_prompt(prompt),
52 "-format",52 "-format",
79 .wait_with_output()79 .wait_with_output()
80 .await80 .await
81 .map_err(|e| Error::InputError(format!("failed to wait for rofi: {e}")))?;81 .map_err(|e| Error::InputError(format!("failed to wait for rofi: {e}")))?;
82 match out.status.code() {
83 Some(0) => {}
84 Some(1) => return Err(Error::Cancel),
85 other => {
86 return Err(Error::InputError(format!(
87 "rofi exited with status {other:?}"
88 )));
89 }
90 }
82 let stdout = out91 let stdout = out
83 .stdout92 .stdout
84 .strip_suffix(b"\n")93 .strip_suffix(b"\n")
133 .wait_with_output()142 .wait_with_output()
134 .await143 .await
135 .map_err(|e| Error::InputError(format!("failed to wait for rofi: {e}")))?;144 .map_err(|e| Error::InputError(format!("failed to wait for rofi: {e}")))?;
145 match out.status.code() {
146 Some(0) => {}
147 Some(1) => return Err(Error::Cancel),
148 other => {
149 return Err(Error::InputError(format!(
150 "rofi exited with status {other:?}"
151 )));
152 }
153 }
136 let stdout = out154 let stdout = out
137 .stdout155 .stdout
138 .strip_suffix(b"\n")156 .strip_suffix(b"\n")