fix: handle non-interactive terminal in goose configure on Windows - #9214
Conversation
When installing via 'curl ... | bash', stdin is a pipe rather than a TTY. On Windows/Git Bash, cliclack fails with 'Incorrect function (os error 1)' when trying to set terminal raw mode on the piped stdin. Two fixes: - install script: detect non-TTY stdin and redirect from /dev/tty when available, or skip configure with a helpful message - goose configure: check stdin.is_terminal() upfront and bail with a clear message instead of crashing Fixes #5910 Signed-off-by: Douwe Osinga <douwe@squareup.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56b3fb7f4c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| elif [ -r /dev/tty ]; then | ||
| "$GOOSE_BIN_DIR/$OUT_FILE" configure < /dev/tty |
There was a problem hiding this comment.
Verify /dev/tty is openable before using it for configure
The new non-interactive branch assumes [ -r /dev/tty ] means stdin can be redirected from /dev/tty, but in many CI/container contexts /dev/tty is readable yet not attached to a controlling terminal; < /dev/tty then fails with No such device or address. Because the script runs with set -e, this aborts installation instead of falling back to the intended “skip configure” path, so curl ... | bash automation can still fail unexpectedly.
Useful? React with 👍 / 👎.
* main: (102 commits) Dynamically refresh skill instructions each turn (#9217) Build non-vulkan linux variants using ubuntu 22.04 (#9211) fix(ui): show tool name in approval prompt (#9216) feat: add Atomic Chat as declarative OpenAI-compatible provider (#9210) chore: bump package.json versions from 0.19.1 to 0.20.0 (#9218) feat: support GOOSE_OAUTH_CALLBACK_PORT for stable OAuth redirect_uri (#9209) [RFC] feat(oauth): proactive token refresh to avoid re-auth on every session (#8386) fix: resolve Azure CLI on Windows by using az.cmd (#9215) fix: handle non-interactive terminal in goose configure on Windows (#9214) Better parsing of pasted html as markdown so agents understand (#9190) fix: persist accumulated cost in session DB to survive reload (#9191) fix(publish-npm): build binary from current SHA + add compat check (#9212) feat(desktop): add goose://new-session deep link to open fresh chat (#9196) Add PR previews using cloudflare pages (#9208) fix: prevent tool-use marker leakage in toolshim output (#8310) Prompt injection mitigation: update pattern-based detection (#9198) remove goose2 related skills (#9189) Switch GH pages deploy to actions/artifact workflow (#9025) fix(summon): re-apply canonical limits when delegate overrides model (#9183) Split code signing from build (#8587) ...
…aif-goose#9214) Signed-off-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Douwe Osinga <douwe@squareup.com>
Summary
Fixes #5910
When installing goose on Windows via
curl ... | bashin Git Bash, stdin is a pipe rather than a TTY. Thecliclacklibrary (used bygoose configurefor interactive prompts) tries to set terminal raw mode on stdin, which fails with "Incorrect function (os error 1)" on a non-TTY file descriptor on Windows.Changes
Install script (
download_cli.sh):[ -t 0 ])/dev/ttyis available (typical in Git Bash/MSYS), redirect stdin from itgoose configurewith a message telling the user to run it manuallyRust CLI (
crates/goose-cli/src/commands/configure.rs):std::io::stdin().is_terminal()at the top ofhandle_configure()Testing
curl | bash), and fully non-interactive (Docker/CI)