A terminal client for Tangled.
0

Configure Feed

Select the types of activity you want to include in your feed.

cli: use powershell for browser opening under WSL to handle long urls

authored by

Sam Zanca and committed by
Tangled
(Jul 20, 2026, 8:51 PM +0300) cc7dabd7 d07d4f1e

+19 -2
+19 -2
internal/cli/auth_login.go
··· 141 141 cmd = "cmd" 142 142 args = []string{"/c", "start", url} 143 143 default: 144 - cmd = "xdg-open" 145 - args = []string{url} 144 + if isWSL() { 145 + cmd = "powershell.exe" 146 + args = []string{"-NoProfile", "-Command", fmt.Sprintf("Start-Process '%s'", url)} 147 + } else { 148 + cmd = "xdg-open" 149 + args = []string{url} 150 + } 146 151 } 147 152 148 153 return exec.Command(cmd, args...).Start() 154 + } 155 + 156 + func isWSL() bool { 157 + if os.Getenv("WSL_DISTRO_NAME") != "" { 158 + return true 159 + } 160 + data, err := os.ReadFile("/proc/sys/kernel/osrelease") 161 + if err != nil { 162 + return false 163 + } 164 + s := strings.ToLower(string(data)) 165 + return strings.Contains(s, "microsoft") || strings.Contains(s, "wsl") 149 166 }