-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wsl support #29
Comments
A workaround until WSL is supported: var is_wsl bool = isWSL()
func isWSL() bool {
if runtime.GOOS != "linux" {
return false
}
cmd := exec.Command("uname", "-a")
if output, err := cmd.Output(); err == nil {
if strings.Contains(strings.ToLower(string(output)), "microsoft") {
return true
}
}
return false
}
func openFile(filename string) error {
if is_wsl {
return exec.Command("wslview", filename).Start()
} else {
return open.Start(filename)
}
} |
How does that work with WSL paths?
|
I ran into this issue when working with fly.io's flyctl command line app in Ubuntu on WSL for Windows. I ended up creating a small shell script and putting it in my path to override the default xdg-open behavior to invoke powershell instead:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that WSL environments should invoke
powershell.exe Start <pth>
. I've updated my little karp utility to account for this.https://github.com/mcandre/karp
The text was updated successfully, but these errors were encountered: