Repository: jesseduffield/lazygit (language: go)

Issue:
open file and open link returns error in WSL
**Describe the bug**
opening file and opening PR returns error since xdg-open does not exist in WSL

**To Reproduce**
Steps to reproduce the behavior:
1. Select any branch
2. Click 'o' to open a PR
3. See error

**Expected behavior**
Opens a file / a browser with PR link


**Desktop (please complete the following information):**
 - OS: Debian WSL
 - commit: 8fd9dea6414a9b35af5b173854f90275229a460a

**Additional context**
i have a working fix at https://github.com/shinhs0506/lazygit/tree/wsl-support, would be happy to open a PR


Discussion / hints:

Fix patch:
diff --git a/pkg/config/config_linux.go b/pkg/config/config_linux.go
index b9e195f9f97..8fdc0c47341 100644
--- a/pkg/config/config_linux.go
+++ b/pkg/config/config_linux.go
@@ -1,7 +1,26 @@
 package config
 
+import (
+	"io/ioutil"
+	"strings"
+)
+
+func isWSL() bool {
+	data, err := ioutil.ReadFile("/proc/sys/kernel/osrelease")
+	return err == nil && strings.Contains(string(data), "microsoft")
+}
+
 // GetPlatformDefaultConfig gets the defaults for the platform
 func GetPlatformDefaultConfig() OSConfig {
+	if isWSL() {
+		return OSConfig{
+			EditCommand:         ``,
+			EditCommandTemplate: "",
+			OpenCommand:         `powershell.exe start explorer.exe {{filename}} >/dev/null`,
+			OpenLinkCommand:     `powershell.exe start {{link}} >/dev/null`,
+		}
+	}
+
 	return OSConfig{
 		EditCommand:         ``,
 		EditCommandTemplate: "",


Test patch: