From 44b1e74bd6339f8d601d7a64afbe269859f33c31 Mon Sep 17 00:00:00 2001 From: Douwe Osinga Date: Thu, 14 May 2026 13:25:43 -0400 Subject: [PATCH] fix: handle non-interactive terminal in goose configure on Windows (#9214) Signed-off-by: Douwe Osinga Co-authored-by: Douwe Osinga --- crates/goose-cli/src/commands/configure.rs | 8 ++++++++ download_cli.sh | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/crates/goose-cli/src/commands/configure.rs b/crates/goose-cli/src/commands/configure.rs index c6827242..ff25e666 100644 --- a/crates/goose-cli/src/commands/configure.rs +++ b/crates/goose-cli/src/commands/configure.rs @@ -30,12 +30,20 @@ use goose::providers::{create, providers, retry_operation, RetryConfig}; use goose::session::SessionType; use serde_json::Value; use std::collections::HashMap; +use std::io::IsTerminal; // useful for light themes where there is no discernible colour contrast between // cursor-selected and cursor-unselected items. const MULTISELECT_VISIBILITY_HINT: &str = "<"; pub async fn handle_configure() -> anyhow::Result<()> { + if !std::io::stdin().is_terminal() { + anyhow::bail!( + "goose configure requires an interactive terminal.\n\ + If you installed via 'curl ... | bash', run 'goose configure' separately after installation." + ); + } + let config = Config::global(); if !config.exists() { diff --git a/download_cli.sh b/download_cli.sh index 2d7c0d41..ca08485c 100755 --- a/download_cli.sh +++ b/download_cli.sh @@ -310,7 +310,15 @@ if [ "$CONFIGURE" = true ]; then echo "" echo "Configuring goose" echo "" - "$GOOSE_BIN_DIR/$OUT_FILE" configure + if [ -t 0 ]; then + "$GOOSE_BIN_DIR/$OUT_FILE" configure + elif [ -r /dev/tty ]; then + "$GOOSE_BIN_DIR/$OUT_FILE" configure < /dev/tty + else + echo "Non-interactive shell detected (e.g. 'curl ... | bash')." + echo "Skipping 'goose configure' — please run it manually after installation:" + echo " $GOOSE_BIN_DIR/$OUT_FILE configure" + fi else echo "Skipping 'goose configure', you may need to run this manually later" fi