fixed title error visibility (#41118)
Shawn Yuan committed
Jul 25, 2026 at 07:36 UTC
1992326ff2dc8c9cb6f1c714cb919dc7931262ed
1 file changed
+8
-1
src/windows/common/WslClient.cpp
+8
-1
@@ -1525,7 +1525,14 @@ int WslMain(_In_ std::wstring_view commandLine)
1525
// Call the MSI package if we're in an MSIX context
1526
if (wsl::windows::common::wslutil::IsRunningInMsix())
1527
{
1528
- return wsl::windows::common::install::CallMsiPackage();
1528
+ const bool launchedViaAppActivation = winrt::Windows::ApplicationModel::AppInstance::GetActivatedEventArgs() != nullptr;
1529
+ const auto exitCode = wsl::windows::common::install::CallMsiPackage();
1530
+ if (launchedViaAppActivation && exitCode == -1)
1531
+ {
1532
+ g_promptBeforeExit = true;
1533
+ }
1534
+
1535
+ return exitCode;
1536
}
1537
1538
// Use exit code -1 so invokers of wsl.exe can distinguish between a Linux