mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-15 22:44:01 +00:00
Emit warning when running under an unsupported version of WSL
Closes #5661. Ping #5298.
This commit is contained in:
parent
9796a331bc
commit
552af31ab0
1 changed files with 11 additions and 1 deletions
|
@ -171,7 +171,17 @@ bool is_windows_subsystem_for_linux() {
|
||||||
uname(&info);
|
uname(&info);
|
||||||
|
|
||||||
// Sample utsname.release under WSL: 4.4.0-17763-Microsoft
|
// Sample utsname.release under WSL: 4.4.0-17763-Microsoft
|
||||||
return strstr(info.release, "Microsoft") != nullptr;
|
if (strstr(info.release, "Microsoft") != nullptr) {
|
||||||
|
const char *dash = strchr(info.release, '-');
|
||||||
|
if (dash == nullptr || strtod(dash + 1, nullptr) < 17763) {
|
||||||
|
debug(1, "This version of WSL is not supported and fish will probably not work correctly!\n"
|
||||||
|
"Please upgrade to Windows 10 1809 (17763) or higher to use fish!");
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}();
|
}();
|
||||||
|
|
||||||
// Subsequent calls to this function may take place after fork() and before exec() in
|
// Subsequent calls to this function may take place after fork() and before exec() in
|
||||||
|
|
Loading…
Reference in a new issue