fixed title error visibility#41118
Conversation
There was a problem hiding this comment.
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 = truewhen the forwarded process returns-1(WSL client failure), so the Start menu console doesn’t close immediately.
OneBlue
left a comment
There was a problem hiding this comment.
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
Summary of the Pull Request
The Start menu launches the MSIX
wsl.exe, which forwards the command to the installed MSIwsl.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.exeowns the Start menu console, while the forwarded MSIwsl.exeprints 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
wsl.exeand the signed glue MSIX.