Skip to content

fixed title error visibility#41118

Open
shuaiyuanxx wants to merge 1 commit into
masterfrom
user/shawn/fix-41112-tile-error-visibility
Open

fixed title error visibility#41118
shuaiyuanxx wants to merge 1 commit into
masterfrom
user/shawn/fix-41112-tile-error-visibility

Conversation

@shuaiyuanxx

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

The Start menu launches the MSIX wsl.exe, which forwards the command to the installed MSI wsl.exe. The inner process prints the actual error, but only the outer MSIX process retains the App activation context and owns the console window. Previously, the outer process returned immediately when the inner process failed.

The outer process now detects an App-activated launch and prompts before exiting when the inner process returns WSL's client failure code (-1). Linux command exit codes are not affected.

PR Checklist

Detailed Description of the Pull Request / Additional comments

The MSIX wsl.exe owns the Start menu console, while the forwarded MSI wsl.exe prints the actual startup error. This change keeps the outer process open when the inner process returns WSL's client failure code (-1), without affecting Linux exit codes or terminal launches.

Validation Steps Performed

  • Clean-built wsl.exe and the signed glue MSIX.
  • Triggered a deterministic startup failure through the real Start menu entry.
  • Verified the official build closed immediately, while the patched build kept the error window open.
  • Verified normal terminal invocations and exit codes were unchanged.

Copilot AI review requested due to automatic review settings July 20, 2026 07:21
@shuaiyuanxx
shuaiyuanxx requested a review from a team as a code owner July 20, 2026 07:21

Copilot AI 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.

Pull request overview

This PR improves error visibility when launching WSL from the Start menu (MSIX wsl.exe forwarding to the installed MSI wsl.exe). When the inner MSI process fails with WSL’s client failure exit code (-1), the outer MSIX process now keeps the console window open (for App-activated launches) by enabling the existing “prompt before exit” behavior.

Changes:

  • Detect App-activated launches in the MSIX wrapper path (AppInstance::GetActivatedEventArgs() != nullptr).
  • After forwarding to the MSI package, set g_promptBeforeExit = true when the forwarded process returns -1 (WSL client failure), so the Start menu console doesn’t close immediately.

@OneBlue OneBlue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this is a good change, although if we happen to run a command line like wsl --install --prompt-before-exit in that context, we would follow that command line to the inner process, and therefore end up with two prompts.

I don't think that's a huge deal though, and probably not worth the additional complexity to try to parse the command line at that stage

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.

Freshly installed on a brand new Windows 11, just opens and closes, doesn't even let me see an error message

3 participants