Skip to content

Commit da77a79

Browse files
Detect WSL as host
1 parent eac875b commit da77a79

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/modules/host.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ void ffPrintHost(FFinstance* instance)
7979

8080
if(!hostValueSet(&product_name))
8181
ffStrbufClear(&product_name);
82+
83+
//On WSL, the real host can't be detected. Instead use WSL as host.
84+
if(product_name.length == 0 && product_family.length == 0 && (
85+
getenv("WSLENV") != NULL ||
86+
getenv("WSL_DISTRO") != NULL ||
87+
getenv("WSL_INTEROP") != NULL
88+
)) ffStrbufAppendS(&product_family, "Windows Subsystem for Linux");
8289
#else
8390
ffSettingsGetAndroidProperty("ro.product.brand", &product_name);
8491
if(product_name.length > 0){

0 commit comments

Comments
 (0)