CLI: Add Terminate Session command#40058
Merged
dkbennett merged 6 commits intofeature/wsl-for-appsfrom Apr 1, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new wslc session terminate CLI subcommand that terminates an active WSLC session, wires it through the task/service layers, and extends the Windows E2E test suite to validate termination behavior across elevated/non-elevated sessions.
Changes:
- Introduced
session terminatecommand and hooked it into the session command tree. - Added
TerminateSessiontask + service implementation callingIWSLCSession::Terminate(). - Added/updated WSLC E2E tests and command-line parsing test cases; added a localized error string for termination failures.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/windows/wslc/e2e/WSLCE2EHelpers.h | Adds helper declaration for ensuring a session is terminated in E2E tests. |
| test/windows/wslc/e2e/WSLCE2EHelpers.cpp | Implements session termination helper via wslc session list/terminate. |
| test/windows/wslc/e2e/WSLCE2EGlobalTests.cpp | Adds E2E coverage for implicit/explicit/mixed-elevation termination and mixed-elevation create validation. |
| test/windows/wslc/CommandLineTestCases.h | Adds parser coverage for session terminate forms. |
| src/windows/wslc/tasks/SessionTasks.h | Exposes TerminateSession task entry point. |
| src/windows/wslc/tasks/SessionTasks.cpp | Implements terminate task (defaults to session default name when omitted). |
| src/windows/wslc/services/SessionService.h | Adds SessionService::TerminateSession API. |
| src/windows/wslc/services/SessionService.cpp | Implements termination via COM session manager + IWSLCSession::Terminate(). |
| src/windows/wslc/commands/SessionTerminateCommand.cpp | New command implementation for session terminate. |
| src/windows/wslc/commands/SessionCommand.h | Declares SessionTerminateCommand in the session command tree. |
| src/windows/wslc/commands/SessionCommand.cpp | Registers the new terminate subcommand. |
| localization/strings/en-US/Resources.resw | Adds localized string for terminate failure message. |
AmelBawa-msft
approved these changes
Apr 1, 2026
OneBlue
approved these changes
Apr 1, 2026
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
Enables session termination via session terminate command. Adds tests for session termination validation.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
Manual verification and all session tests run locally successfully.