oh-my-posh/src/environment_unix.go
lnu 6add3bf2a0 fix: avoid error when duplicating wsl tab
use same osc escape code everywhere

detect wsl using env variable
2021-02-15 09:14:17 +01:00

29 lines
580 B
Go

// +build !windows
package main
import (
"errors"
"os"
)
func (env *environment) isRunningAsRoot() bool {
return os.Geteuid() == 0
}
func (env *environment) homeDir() string {
return os.Getenv("HOME")
}
func (env *environment) getWindowTitle(imageName, windowTitleRegex string) (string, error) {
return "", errors.New("not implemented")
}
func (env *environment) isWsl() bool {
// one way to check
// version := env.getFileContent("/proc/version")
// return strings.Contains(version, "microsoft")
// using env variable
return env.getenv("WSL_DISTRO_NAME") != ""
}