mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Host (Linux): display WSL distro name
This commit is contained in:
@@ -50,10 +50,13 @@ const char* ffDetectHost(FFHostResult* host)
|
||||
|
||||
if(host->productFamily.length == 0 && host->productName.length == 0)
|
||||
{
|
||||
const char* wslDistroName = getenv("WSL_DISTRO_NAME");
|
||||
//On WSL, the real host can't be detected. Instead use WSL as host.
|
||||
if(getenv("WSL_DISTRO") != NULL || getenv("WSL_INTEROP") != NULL)
|
||||
if(wslDistroName != NULL || getenv("WSL_DISTRO") != NULL || getenv("WSL_INTEROP") != NULL)
|
||||
{
|
||||
ffStrbufAppendS(&host->productName, "Windows Subsystem for Linux");
|
||||
if (wslDistroName)
|
||||
ffStrbufAppendF(&host->productName, " - %s", wslDistroName);
|
||||
ffStrbufAppendS(&host->productFamily, "WSL");
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY wslVer = ffStrbufCreate(); //Wide charactors
|
||||
|
||||
Reference in New Issue
Block a user