diff --git a/cmd/cloudflared/shell/launch_browser_unix.go b/cmd/cloudflared/shell/launch_browser_unix.go index 519c0999..2ebe9590 100644 --- a/cmd/cloudflared/shell/launch_browser_unix.go +++ b/cmd/cloudflared/shell/launch_browser_unix.go @@ -9,8 +9,8 @@ import ( 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) + if _, err := os.Stat("/usr/bin/wslview"); err == nil { + return exec.Command("wslview", url) } return exec.Command("xdg-open", url)