Skip to content

CLI: Add Terminate Session command#40058

Merged
dkbennett merged 6 commits intofeature/wsl-for-appsfrom
user/dkbennett/terminatesession
Apr 1, 2026
Merged

CLI: Add Terminate Session command#40058
dkbennett merged 6 commits intofeature/wsl-for-appsfrom
user/dkbennett/terminatesession

Conversation

@dkbennett
Copy link
Copy Markdown
Member

Summary of the Pull Request

Enables session termination via session terminate command. Adds tests for session termination validation.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

  • Added session terminate command and related task plumbing.
  • Added TerminateSession to the SessionService.
  • Added Tests for session termination, with both elevation types and mixed elevation.
  • Added a test for Session Create that verifies mixed elevation creation attempts fail.

Validation Steps Performed

Manual verification and all session tests run locally successfully.

Copilot AI review requested due to automatic review settings April 1, 2026 06:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 terminate command and hooked it into the session command tree.
  • Added TerminateSession task + service implementation calling IWSLCSession::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.

Copilot AI review requested due to automatic review settings April 1, 2026 07:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

@dkbennett dkbennett marked this pull request as ready for review April 1, 2026 08:50
@dkbennett dkbennett requested a review from a team as a code owner April 1, 2026 08:50
Copilot AI review requested due to automatic review settings April 1, 2026 08:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Copy link
Copy Markdown
Member

@benhillis benhillis left a comment

Choose a reason for hiding this comment

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

LGTM!

@dkbennett dkbennett merged commit a6746d1 into feature/wsl-for-apps Apr 1, 2026
11 checks passed
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.

5 participants