Skip to content

cmd/docker: Support wrapped Windows consoles in cloud resolution - #7355

Closed
nico1510 wants to merge 3 commits into
docker:masterfrom
nico1510:cloud-resolver-windows-console
Closed

nico1510 wants to merge 3 commits into
docker:masterfrom
nico1510:cloud-resolver-windows-console

Conversation

@nico1510

@nico1510 nico1510 commented Oct 5, 2026

Copy link
Copy Markdown
Member

Related to #7354 and its Windows console review.

Summary

Allow interactive --cloud context resolution when Windows console streams are wrapped for terminal emulation. Those streams can report IsTerminal() == true without exposing an underlying file, preventing the resolver from receiving stdin.

Use the corresponding standard handle on Windows only when the stream has no file. Preserve explicitly supplied file streams and require both stdin and stderr to be terminals. Piped or redirected input remains available to the requested command, and stdout remains reserved for the resolver's JSON response.

This draft includes the changes from #7354 and keeps the Windows fix on a separate branch for validation.

Validation: go test ./cmd/docker and lint pass. The CLI and focused stream tests cross-compile for Windows amd64 and arm64; regression coverage includes wrapped streams, explicit files, and nonterminal streams. The full unit suite has the previously reproduced TestNodeAddrOptionSetHostOnlyIPv6 failure with Go 1.26.0. Existing syscall.Kill tests prevent compiling the complete command test package for Windows, so the focused tests were compiled separately. Windows runtime and console verification are pending.

Forward terminal input to the cloud context provider when stdin and stderr
are terminals so it can prompt during resolution. Pass the terminal files
directly to preserve terminal detection and avoid intermediary buffering;
piped or redirected input stays available to the requested command.

Cover interactive resolution and input preservation with subprocess tests.

Signed-off-by: Nicolas Beck <nicolas.beck@docker.com>
Simplify the shell fixture conditional to avoid a duplicate-word lint warning while preserving the input-consumption checks.

Signed-off-by: Nicolas Beck <nicolas.beck@docker.com>
Use standard console handles when terminal emulation hides the underlying files. Preserve explicit file streams and leave noninteractive input for the requested command.

Signed-off-by: Nicolas Beck <nicolas.beck@docker.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/docker/cloud_io.go 64.28% 4 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

@nico1510 nico1510 closed this Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants