Skip to content

Commit 7a54334

Browse files
authored
Merge pull request #7082 from thaJeztah/prompt_cleans_step1
internal/prompt: Confirm: don't wrap stdIn
2 parents 617d772 + fd34976 commit 7a54334

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

internal/prompt/prompt.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,18 @@ func Confirm(ctx context.Context, in io.Reader, out io.Writer, message string) (
8888
_, _ = out.Write([]byte(message))
8989

9090
// On Windows, force the use of the regular OS stdin stream.
91+
//
92+
// StdStreams() may wrap stdin with windowsconsole.NewAnsiReader to
93+
// emulate VT input on consoles that do not support it natively, but
94+
// that wrapper has historically caused interactive prompts to hang
95+
// or behave incorrectly.
96+
//
97+
// See:
98+
// - https://github.com/moby/moby/issues/14336
99+
// - https://github.com/moby/moby/issues/14210
100+
// - https://github.com/moby/moby/pull/17738
91101
if runtime.GOOS == "windows" {
92-
in = streams.NewIn(os.Stdin)
102+
in = os.Stdin
93103
}
94104

95105
result := make(chan bool)

0 commit comments

Comments
 (0)