mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
fix(environment): detect WSL shared path correctly
This commit is contained in:
parent
c93d637128
commit
7e141fb5ec
|
@ -98,7 +98,11 @@ func (env *ShellEnvironment) WindowsRegistryKeyValue(path string) (*WindowsRegis
|
||||||
}
|
}
|
||||||
|
|
||||||
func (env *ShellEnvironment) InWSLSharedDrive() bool {
|
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 {
|
func (env *ShellEnvironment) ConvertToWindowsPath(path string) string {
|
||||||
|
|
Loading…
Reference in a new issue