Skip to content

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

Description

@utk-code

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions