mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-21 12:16:54 +02:00
Merge pull request #1997 from shinhs0506/wsl-support
This commit is contained in:
commit
582b1991a4
@ -1,7 +1,26 @@
|
|||||||
package config
|
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
|
// GetPlatformDefaultConfig gets the defaults for the platform
|
||||||
func GetPlatformDefaultConfig() OSConfig {
|
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{
|
return OSConfig{
|
||||||
EditCommand: ``,
|
EditCommand: ``,
|
||||||
EditCommandTemplate: "",
|
EditCommandTemplate: "",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user