Added WSL2 check to unix browser launcher
This commit is contained in:
parent
8836ee1dda
commit
78203515fd
|
@ -3,9 +3,15 @@
|
||||||
package shell
|
package shell
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getBrowserCmd(url string) *exec.Cmd {
|
func getBrowserCmd(url string) *exec.Cmd {
|
||||||
|
// Check for Windows Subsystem for Linux (v2+).
|
||||||
|
if os.Getenv("WSL_DISTRO_NAME") != "" {
|
||||||
|
return exec.Command("rundll32.exe", "url.dll,FileProtocolHandler", url)
|
||||||
|
}
|
||||||
|
|
||||||
return exec.Command("xdg-open", url)
|
return exec.Command("xdg-open", url)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue