Add wslc system info command - #41408
Conversation
There was a problem hiding this comment.
Pull request overview
Adds wslc system info and the top-level wslc info alias, providing client, server, and session details in table or JSON formats.
Changes:
- Added system information command and session-manager version retrieval.
- Added localized output and terminal flushing.
- Added parser, unit, and end-to-end test coverage.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
test/windows/wslc/WSLCCLITerminalUnitTests.cpp |
Tests terminal output flushing. |
test/windows/wslc/WSLCCLICommandUnitTests.cpp |
Tests command structure and registration. |
test/windows/wslc/e2e/WSLCE2EGlobalTests.cpp |
Tests table, JSON, alias, and session behavior. |
test/windows/wslc/CommandLineTestCases.h |
Adds command-line parser cases. |
src/windows/wslc/tasks/SessionTasks.h |
Declares system information task support. |
src/windows/wslc/tasks/SessionTasks.cpp |
Implements system information output. |
src/windows/wslc/services/SessionService.h |
Declares session-manager version retrieval. |
src/windows/wslc/services/SessionService.cpp |
Retrieves the session-manager version. |
src/windows/wslc/core/Terminal.h |
Declares terminal output flushing. |
src/windows/wslc/core/Terminal.cpp |
Implements terminal output flushing. |
src/windows/wslc/commands/SystemCommand.h |
Defines the system information command interface. |
src/windows/wslc/commands/SystemCommand.cpp |
Implements the system information command. |
src/windows/wslc/commands/RootCommand.cpp |
Registers the top-level info alias. |
localization/strings/en-US/Resources.resw |
Adds localized system information strings. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
Suppressed comments (2)
src/windows/wslc/tasks/SessionTasks.cpp:177
- The new
sessions.empty()branch changes the table contract by suppressing the session-table header, but the E2E additions do not assert this zero-session case: the table test only checks section/version strings and the session state is environment-dependent. Add a deterministic zero-session test that verifiesSessions: 0is present while the session-table ID header is absent.
if (!sessions.empty())
{
WriteSessionTable(context.Terminal, sessions);
}
test/windows/wslc/WSLCCLICommandUnitTests.cpp:261
- This unit test searches only by
Name(), so it also passes if the root-level registration is removed becausesystemalready contains aninfochild. That means it does not pin the second registration as the comment claims; also check the command'sFullName()(for example,root:info) or count the registrations.
if (subcmd->Name() == SystemInfoCommand::CommandName)
| auto& client = root["Client"]; | ||
| client["Version"] = std::string{WSL_PACKAGE_VERSION}; | ||
| client["KernelVersion"] = std::string{KERNEL_VERSION}; | ||
| client["WslgVersion"] = std::string{WSLG_VERSION}; |
There was a problem hiding this comment.
We shouldn't display wslg and msrdc versions, since they're irrelevant to wslc
There was a problem hiding this comment.
(Same for the below bloc)
Summary of the Pull Request
Adds wslc system info (and wslc info as a root alias) that shows client version details and session manager state in both table and JSON formats. The command does not start a VM, it queries the session manager service the same way session list does.
PR Checklist
Detailed Description of the Pull Request / Additional comments
What it shows:
Design choices:
What this doesn't do:
Validation Steps Performed