From bde47eb85dd0651f32f2370cef5607da6b87a0f8 Mon Sep 17 00:00:00 2001 From: Robert Mcgregor <38837341+exitcode0@users.noreply.github.com> Date: Thu, 25 Sep 2025 07:17:12 +1000 Subject: [PATCH] feat(shell): throw errors on interactive commands (#4788) --- crates/goose-mcp/src/developer/shell.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/goose-mcp/src/developer/shell.rs b/crates/goose-mcp/src/developer/shell.rs index 3350091b..e149013a 100644 --- a/crates/goose-mcp/src/developer/shell.rs +++ b/crates/goose-mcp/src/developer/shell.rs @@ -122,6 +122,12 @@ pub fn configure_shell_command( .stdin(Stdio::null()) .kill_on_drop(true) .env("GOOSE_TERMINAL", "1") + .env("GIT_EDITOR", "sh -c 'echo \"Interactive Git commands are not supported in this environment.\" >&2; exit 1'") + .env("GIT_SEQUENCE_EDITOR", "sh -c 'echo \"Interactive Git commands are not supported in this environment.\" >&2; exit 1'") + .env("VISUAL", "sh -c 'echo \"Interactive editor not available in this environment.\" >&2; exit 1'") + .env("EDITOR", "sh -c 'echo \"Interactive editor not available in this environment.\" >&2; exit 1'") + .env("GIT_TERMINAL_PROMPT", "0") + .env("GIT_PAGER", "cat") .args(&shell_config.args) .arg(command);