Skip to content

fix: keep tool child stdin closed and run tool commands non-interactively - #42778

Closed
utk-code wants to merge 2 commits into
anomalyco:devfrom
utk-code:fix-tool-interactive-stdin
Closed

fix: keep tool child stdin closed and run tool commands non-interactively#42778
utk-code wants to merge 2 commits into
anomalyco:devfrom
utk-code:fix-tool-interactive-stdin

Conversation

@utk-code

@utk-code utk-code commented Aug 15, 2026

Copy link
Copy Markdown

Issue for this PR
Closes #42773

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement

What does this PR do?
On Windows, tool commands that prompt for input on stdin (e.g. npm exec asking "Ok to proceed? (y)") hang — the prompt shows up but nothing typed reaches the process, because the child's stdin is an open pipe nothing closes, and the TUI owns the console input.

Changes:

  • Spawner default for child stdin changed from open pipe to closed ("ignore"). Callers passing explicit stdin are unaffected.
  • Shell/bash tool commands now get CI=1, npm_config_yes=true, GIT_TERMINAL_PROMPT=0, NONINTERACTIVE=1, so tools like npm skip interactive prompts.

How did you verify your code works?
Reproduced on Windows: npm exec with an open stdin pipe hangs; with CI=1 or npm_config_yes=true it completes. Checked no tests rely on the old default.

Screenshots / recordings
N/A (not a UI change)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

PR #41968: fix(cli): survive broken stdio pipes
#41968

This PR may be related as it also deals with stdio/pipe handling in child processes, though it focuses on surviving broken pipes rather than closing stdin and preventing interactive prompts.

However, the current PR #42778 appears to be a unique fix addressing the specific issue (#42773) where tool commands hang on Windows due to open stdin pipes and interactive prompts. No exact duplicates were found.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 15, 2026
@github-actions github-actions Bot closed this Aug 15, 2026
@utk-code
utk-code deleted the fix-tool-interactive-stdin branch August 15, 2026 17:52
@utk-code
utk-code restored the fix-tool-interactive-stdin branch August 16, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant