mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Disk (Linux): support hyperlink in WSL
This commit is contained in:
@@ -18,7 +18,19 @@ static void printDisk(FFDiskOptions* options, const FFDisk* disk)
|
||||
if(instance.config.pipe)
|
||||
ffStrbufAppendF(&key, "%s (%s)", FF_DISK_MODULE_NAME, disk->mountpoint.chars);
|
||||
else
|
||||
{
|
||||
#ifdef __linux__
|
||||
if (getenv("WSL_DISTRO_NAME") != NULL && getenv("WT_SESSION") != NULL)
|
||||
{
|
||||
if (ffStrbufEqualS(&disk->filesystem, "9p") && ffStrbufStartsWithS(&disk->mountpoint, "/mnt/"))
|
||||
ffStrbufAppendF(&key, "%s (\e]8;;file:///%c:/\e\\%s\e]8;;\e\\)", FF_DISK_MODULE_NAME, disk->mountpoint.chars[5], disk->mountpoint.chars);
|
||||
else
|
||||
ffStrbufAppendF(&key, "%s (\e]8;;file:////wsl.localhost/%s%s\e\\%s\e]8;;\e\\)", FF_DISK_MODULE_NAME, getenv("WSL_DISTRO_NAME"), disk->mountpoint.chars, disk->mountpoint.chars);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
ffStrbufAppendF(&key, "%s (\e]8;;file://%s\e\\%s\e]8;;\e\\)", FF_DISK_MODULE_NAME, disk->mountpoint.chars, disk->mountpoint.chars);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user