anomalyco / anomalyco/opencode

Bash tool hangs when a command asks for input (npm/npx "Ok to proceed") on Windows

Open
#42,773 1 comment 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Aug 15, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Whenever the agent runs a command that waits for stdin (e.g. npm exec prints "Ok to proceed? (y)" and asks for confirmation), the prompt shows up in the session but typing does nothing, and the command hangs until the timeout.

  • The tool spawns children with stdin ignored or as a pipe that's never fed or closed (tool/shell.ts, bash.ts, and the default in cross-spawn-spawner.ts:118-120). Some callers (e.g. git.ts) even omit stdin entirely, leaving an open pipe, so a child that reads stdin blocks forever.
  • On Windows the TUI takes the console input exclusively (tui/terminal-win32.ts), so keystrokes can never reach a tool child.
  • npm's confirm prompt (read package) prints the question and then only ever finishes on a newline; with NUL/EOF or a dangling pipe it never gets one, so it sits forever.

Suggestion: default child stdin to closed instead of an open pipe, and inject non-interactive env vars (CI=1, npm_config_yes=true, GIT_TERMINAL_PROMPT=0) into tool commands so they don't prompt.

Plugins

No response

OpenCode version

1.18.18

Steps to reproduce

spawn npm exec cowsay@1.5.0 hello with stdin as an open pipe -> hangs. Same with CI=1, npm_config_yes=true, or closed stdin -> finishes.

Screenshot and/or share link
Image
Operating System

Windows 10

Terminal

Windows Terminal, Windows Powershell, VS Code Terminal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.