Added WSL2 check to unix browser launcher
This commit is contained in:
parent
8836ee1dda
commit
78203515fd
|
@ -3,9 +3,15 @@
|
|||
package shell
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue