internal/prompt: Confirm: don't wrap stdIn#7082
Open
thaJeztah wants to merge 1 commit into
Open
Conversation
This was a remnant from when `PromptForConfirmation` accepted a `InStream`; it was added in [moby@30b8f08], which got left behind when [cli@37ccc00] updated its signature to accept a plain `io.Reader`. While updating, also update the comment to provide more context on the reason we're unconditionally using `os.Stdin` on Windows. [moby@30b8f08]: moby/moby@30b8f08 [cli@37ccc00]: docker@37ccc00 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
docker-agent
reviewed
Jul 7, 2026
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
The change safely removes the streams.NewIn(os.Stdin) wrapper on Windows, replacing it with a bare os.Stdin. The resulting value is fed into bufio.NewScanner(in), which accepts any io.Reader — exactly what *os.File satisfies. The streams.NewIn wrapper previously added windowsconsole.NewAnsiReader processing, which caused interactive prompt hangs on Windows (moby/moby#14336, #14210, #17738). No imports are orphaned (streams is still used for DisableInputEcho). The expanded comment is accurate and helpful.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
This was a remnant from when
PromptForConfirmationaccepted aInStream; it was added in moby@30b8f08, which got left behind when cli@37ccc00 updated its signature to accept a plainio.Reader.While updating, also update the comment to provide more context on the reason we're unconditionally using
os.Stdinon Windows.- What I did
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)