Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit f858909

Browse files
Merge pull request #71 from microsoft/crloewen/promptOnError
Added prompt for input when wsl.exe fails to launch Linux process
2 parents 1f8551f + 75ad1b9 commit f858909

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

DistroLauncher/DistroLauncher.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ int wmain(int argc, wchar_t const *argv[])
119119
if (arguments.empty()) {
120120
hr = g_wslApi.WslLaunchInteractive(L"", false, &exitCode);
121121

122+
// Check exitCode to see if wsl.exe returned that it could not start the Linux process
123+
// then prompt users for input so they can view the error message.
124+
if (SUCCEEDED(hr) && exitCode == UINT_MAX) {
125+
Helpers::PromptForInput();
126+
}
127+
122128
} else if ((arguments[0] == ARG_RUN) ||
123129
(arguments[0] == ARG_RUN_C)) {
124130

@@ -163,4 +169,4 @@ int wmain(int argc, wchar_t const *argv[])
163169
}
164170

165171
return SUCCEEDED(hr) ? exitCode : 1;
166-
}
172+
}

0 commit comments

Comments
 (0)