From 7e141fb5ecca1f01c2ba9cfd4d6aaa41f88e2aa4 Mon Sep 17 00:00:00 2001 From: "L. Yeung" Date: Mon, 29 Aug 2022 15:43:43 +0800 Subject: [PATCH] fix(environment): detect WSL shared path correctly --- src/environment/shell_unix.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/environment/shell_unix.go b/src/environment/shell_unix.go index 3060fbca..d715be52 100644 --- a/src/environment/shell_unix.go +++ b/src/environment/shell_unix.go @@ -98,7 +98,11 @@ func (env *ShellEnvironment) WindowsRegistryKeyValue(path string) (*WindowsRegis } func (env *ShellEnvironment) InWSLSharedDrive() bool { - return env.IsWsl() && strings.HasPrefix(env.Pwd(), "/mnt/c") + if !env.IsWsl() { + return false + } + windowsPath := env.ConvertToWindowsPath(env.Pwd()) + return !strings.HasPrefix(windowsPath, `\\wsl.localhost`) } func (env *ShellEnvironment) ConvertToWindowsPath(path string) string {