Skip to content

fix(tui-v2): detach tool subprocess stdin#678

Merged
lsdefine merged 1 commit into
lsdefine:mainfrom
nianyucatfish:fix/tui-v2-stdin-devnull
Jul 10, 2026
Merged

fix(tui-v2): detach tool subprocess stdin#678
lsdefine merged 1 commit into
lsdefine:mainfrom
nianyucatfish:fix/tui-v2-stdin-devnull

Conversation

@nianyucatfish

Copy link
Copy Markdown
Collaborator

Summary

  • Stop code_run tool subprocesses from inheriting the TUI terminal stdin.
  • Do the same for tuiapp_v2 !shell commands.
  • Keep clipboard copy helpers from inheriting stdin when they are not fed input.

Why

On POSIX terminals, child processes that inherit fd 0 can race Textual for keyboard input while tools are running. This shows up most often on macOS/Linux with multiple active tui2 sessions as randomly swallowed letters, spaces, or Enter.

Notes

Verification

  • PYTHONIOENCODING=utf-8 py -3.12 -m py_compile ga.py frontends/tuiapp_v2.py
  • code_run smoke test: Python child sees stdin EOF (sys.stdin.read() == '') while stdout capture still works.

@lsdefine lsdefine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changes and targeted behavior. Approving for merge.

@lsdefine lsdefine merged commit 8e30ae1 into lsdefine:main Jul 10, 2026
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.

2 participants