fix: release stdin after the hidden key prompt so connect can exit - #9
Open
mikeyb wants to merge 1 commit into
Open
fix: release stdin after the hidden key prompt so connect can exit#9mikeyb wants to merge 1 commit into
mikeyb wants to merge 1 commit into
Conversation
readHiddenLine restored stdin with `if (wasPaused) input.pause()`, but isPaused() is false for a stream that has never started flowing (the state of a fresh process.stdin), so the resume() for hidden entry was never undone. The still-referenced TTY handle kept the event loop alive, and `cribble connect` hung after a successful save until the user pressed Ctrl+C. Piped input masked the bug because EOF closes stdin either way; only real interactive terminals hang. Track whether stdin was actually flowing before the prompt and pause it again whenever it was not. Co-Authored-By: Claude Fable 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.
After a successful
cribble connect, the CLI hangs in interactive terminals until Ctrl+C. This affects all platforms and predates 1.4 — piped input masks it because EOF closes stdin either way.readHiddenLinerestores stdin withif (wasPaused) input.pause(), butisPaused()returnsflowing === false, and a freshprocess.stdinhasflowing === null— so theresume()used for hidden entry is never undone and the still-referenced TTY handle keeps the event loop alive.The prompt now records whether stdin was actually flowing beforehand (
readableFlowing === true) and pauses it again whenever it was not. A regression test uses aprocess.stdin-like fake that starts withreadableFlowing = null.