Repository navigation
Resume stdin in the password prompt - #16
Merged
Merged
Conversation
When login asks for the URL or username first, readline leaves stdin paused, and the password prompt's data listener never received input. Node then exited at the prompt with an unsettled top-level await warning.
dennisdornon
force-pushed
the
fix-password-prompt-resume
branch
from
November 25, 2026 17:49
c6b6866 to
c9e990a
Compare
Member
Author
|
@coderabbitai full review |
Action performed
|
Merged
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.
Fixes #12.
When
mainwpcontrol loginprompts for the Dashboard URL or username, readline closes and leaves stdin paused.promptForPasswordthen adds adatalistener, which doesn't restart a paused stream, so nothing keeps the event loop alive and Node exits at the password prompt with "Detected unsettled top-level await". This happens on any supported Node version, not only Node 26.promptForPasswordnow callsstdin.resume()after attaching its listener. It still pauses stdin again when the password is entered.New tests in
src/utils/prompt.test.tscover the paused-stdin case and check that stdin is paused and raw mode restored afterwards. The first test times out without the fix.Typecheck, lint,
npm test(1079),npm run test:process(109) and build pass locally. A URL prompt followed by the password prompt also works under a pseudo-terminal on Node 24.Summary by CodeRabbit