fix: wait for print output flush in bootstrap branch (stdin inherit + -p) - #251
Merged
Conversation
… -p) Fixes silent exit 0 with 0-byte stdout/stderr when piping a prompt via stdin with CLAUDE_TERMUX_STDIN=inherit. The bootstrap branch lacked the output-flush wait that the helper branch already has, and the wait was missing from the synchronous process.exit() (RequestedExit) path in both branches. - Export CLAUDE_TERMUX_PRINT_MODE in shell before invoking bootstrap - Define waitForPrintFlush in helper branch outside try block for catch access - Define waitForPrintFlushIfNeeded in bootstrap branch outside try block - Call these functions after main execution and in RequestedExit handlers - Add static containment tests to verify presence of fix - Add runtime regression tests for normal/sync-exit/async-exit scenarios Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Private issue #18 (bash0816/CluadeCode-Termux-private) の修正。G1(11回)・G2(6回)ともにGPT-5.6-terraからGo判定取得済み。詳細はコミットメッセージ参照。
Summary
Verification
env CLAUDE_TERMUX_STDIN=inherit claude -pでの exit code/output を確認