Skip to content

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

Closed as not planned

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 [email protected] 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

Activity

  1. utk-code commented on Aug 15, 2026

    @utk-code
    Author

    well, my suggestion isn't working for me rn

  2. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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