feat: Add GOOSE_TERMINAL env variable to spawned terminals (#3911)

Signed-off-by: iamrajiv <rajivperfect007@gmail.com>
This commit is contained in:
Rajiv Singh
2025-08-11 11:38:45 +05:30
committed by GitHub
parent e130c3a7fd
commit ab0b078314
5 changed files with 7 additions and 0 deletions
+1
View File
@@ -26,6 +26,7 @@ pub fn update(canary: bool, reconfigure: bool) -> Result<()> {
.arg(shell_str)
.env("CANARY", canary.to_string())
.env("CONFIGURE", reconfigure.to_string())
.env("GOOSE_TERMINAL", "1")
.spawn()?;
update.wait_with_output()?;
@@ -749,6 +749,7 @@ impl ComputerControllerRouter {
.arg("-NonInteractive")
.arg("-File")
.arg(&command)
.env("GOOSE_TERMINAL", "1")
.output()
.await
.map_err(|e| {
@@ -758,6 +759,7 @@ impl ComputerControllerRouter {
_ => Command::new(shell)
.arg(shell_arg)
.arg(&command)
.env("GOOSE_TERMINAL", "1")
.output()
.await
.map_err(|e| ToolError::ExecutionError(format!("Failed to run script: {}", e)))?,
@@ -11,6 +11,7 @@ impl SystemAutomation for WindowsAutomation {
.arg("-NonInteractive")
.arg("-Command")
.arg(script)
.env("GOOSE_TERMINAL", "1")
.output()?;
Ok(String::from_utf8_lossy(&output.stdout).into_owned())
+1
View File
@@ -637,6 +637,7 @@ impl DeveloperRouter {
.stderr(Stdio::piped())
.stdin(Stdio::null())
.kill_on_drop(true)
.env("GOOSE_TERMINAL", "1")
.args(&shell_config.args)
.arg(command)
.spawn()
+2
View File
@@ -231,10 +231,12 @@ pub async fn execute_shell_command(
let mut cmd = if cfg!(target_os = "windows") {
let mut cmd = Command::new("cmd");
cmd.args(["/C", command]);
cmd.env("GOOSE_TERMINAL", "1");
cmd
} else {
let mut cmd = Command::new("sh");
cmd.args(["-c", command]);
cmd.env("GOOSE_TERMINAL", "1");
cmd
};