Skip to content

Commit 9f55994

Browse files
fix: Make the execute_bash interactive field an Option (#666)
1 parent 97da62f commit 9f55994

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/q_cli/src/cli/chat/tools/execute_bash.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use super::{
2525
#[derive(Debug, Deserialize)]
2626
pub struct ExecuteBash {
2727
pub command: String,
28-
pub interactive: bool,
28+
pub interactive: Option<bool>,
2929
}
3030

3131
impl ExecuteBash {
@@ -39,8 +39,8 @@ impl ExecuteBash {
3939
)?;
4040

4141
let (stdin, stdout, stderr) = match self.interactive {
42-
true => (Stdio::inherit(), Stdio::inherit(), Stdio::inherit()),
43-
false => (Stdio::piped(), Stdio::piped(), Stdio::piped()),
42+
Some(true) => (Stdio::inherit(), Stdio::inherit(), Stdio::inherit()),
43+
_ => (Stdio::piped(), Stdio::piped(), Stdio::piped()),
4444
};
4545

4646
let output = tokio::process::Command::new("bash")
@@ -58,7 +58,7 @@ impl ExecuteBash {
5858
let stdout = output.stdout.to_str_lossy();
5959
let stderr = output.stderr.to_str_lossy();
6060

61-
if !self.interactive {
61+
if let Some(false) = self.interactive {
6262
execute!(updates, style::Print(&stdout))?;
6363
}
6464

0 commit comments

Comments
 (0)