Make the DetachKeys configurable and add test coverage for interactive detach#14348
Open
OneBlue wants to merge 6 commits intofeature/wsl-for-appsfrom
Open
Make the DetachKeys configurable and add test coverage for interactive detach#14348OneBlue wants to merge 6 commits intofeature/wsl-for-appsfrom
OneBlue wants to merge 6 commits intofeature/wsl-for-appsfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for customizing Docker “detach keys” when starting/attaching to containers and when creating exec processes, and introduces a Windows test to validate interactive detach behavior.
Changes:
- Extends container Start/Attach and Exec flows to accept optional detach keys and forwards them to the Docker API (start/attach/exec).
- Updates client wrappers/callers to pass the new parameter (typically
nullptrfor default behavior). - Adds a new
InteractiveDetachWSLA test covering default/custom detach sequences and invalid detach key handling.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/windows/WSLATests.cpp | Updates existing start/attach calls for new signatures; adds InteractiveDetach test. |
| src/windows/wslc/services/ContainerService.cpp | Updates container Start call to pass nullptr for detach keys. |
| src/windows/wslasession/WSLAContainer.h | Updates WSLA container implementation method signatures to include detach keys. |
| src/windows/wslasession/WSLAContainer.cpp | Plumbs detach keys through Start/Attach/Exec to Docker client calls and exec request payload. |
| src/windows/wslasession/DockerHTTPClient.h | Adds HTTP status→HRESULT mapping helper; adds per-transaction tracing. |
| src/windows/wslasession/DockerHTTPClient.cpp | Adds detachKeys query param support for start/attach endpoints. |
| src/windows/wslaservice/inc/wslaservice.idl | Modifies COM interface method signatures to add detach keys parameters. |
| src/windows/wsladiag/wsladiag.cpp | Updates attach/start calls for new signatures. |
| src/windows/inc/docker_schema.h | Adds DetachKeys field to exec create schema. |
| src/windows/common/WSLAProcessLauncher.h / .cpp | Adds SetDetachKeys and forwards detach keys to container Exec. |
| src/windows/common/WSLAContainerLauncher.cpp | Updates Start call for new signature. |
| src/windows/WslcSDK/wslcsdk.cpp | Updates container Start call for new signature. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
OneBlue
commented
Mar 4, 2026
|
|
||
| auto [response, body] = SendRequestAndReadResponse(Method, Url, requestString); | ||
|
|
||
| WSL_LOG( |
Collaborator
Author
There was a problem hiding this comment.
This was useful during debugging. I'd like to keep it
benhillis
reviewed
Mar 4, 2026
|
|
||
| if (DetachKeys != nullptr) | ||
| { | ||
|
|
benhillis
approved these changes
Mar 4, 2026
…soft/WSL into user/oneblue/detach-custom
…oneblue/detach-custom
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.
Summary of the Pull Request
This change adds support for passing custom detach keys when starting a container, attaching to it, or starting an exec
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed