Skip to content

fix(tui): isolate tool stdin - #41613

Open
mathew-cf wants to merge 1 commit into
anomalyco:devfrom
mathew-cf:isolate-tool-stdin
Open

fix(tui): isolate tool stdin#41613
mathew-cf wants to merge 1 commit into
anomalyco:devfrom
mathew-cf:isolate-tool-stdin

Conversation

@mathew-cf

Copy link
Copy Markdown

Issue for this PR

Closes #41612

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The TUI now reads from a dedicated controlling-terminal stream while fd 0 is redirected to the platform null device. Tool implementations and their subprocesses therefore receive EOF instead of competing with the TUI for keystrokes. The dedicated stream is also used by external editors and Windows console-mode handling.

This builds on the dedicated TUI input-stream work in #34242 by @LordMikkel and extends it to isolate tool subprocess stdin.

How did you verify your code works?

  • Typechecked packages/opencode and packages/tui
  • Ran the packages/opencode/test/cli/run suite
  • Ran the full packages/tui suite
  • Verified under a pseudo-terminal that a subprocess inheriting fd 0 receives EOF
  • Ran the internal AI reviewer twice; the final review found no blocking issues

Screenshots / recordings

Not applicable; this fixes terminal input ownership without changing the rendered UI.

Checklist

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

@github-actions

Copy link
Copy Markdown
Contributor

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

No duplicate PRs found

The search found PR #34242 which is a related prior work that this PR explicitly builds upon (as mentioned in the description), but no duplicate or conflicting PRs addressing the same issue.

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.

TUI input can be consumed by tool subprocesses

1 participant