From 500cc5834d1a1d7471dc72e11ab864eaf284176d Mon Sep 17 00:00:00 2001 From: evilz Date: Wed, 10 Mar 2021 18:42:24 +0100 Subject: [PATCH] fix: slow git status on wsl2 --- src/segment_git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/segment_git.go b/src/segment_git.go index b18491ea..68cc3277 100644 --- a/src/segment_git.go +++ b/src/segment_git.go @@ -272,7 +272,7 @@ func (g *git) getStatusColor(defaultValue string) string { func (g *git) getGitCommandOutput(args ...string) string { gitCommand := "git" - if g.env.getRuntimeGOOS() == windowsPlatform { + if g.env.getRuntimeGOOS() == windowsPlatform || (g.env.isWsl() && strings.HasPrefix(g.env.getcwd(), "/mnt/")) { gitCommand = "git.exe" } args = append([]string{"--no-optional-locks", "-c", "core.quotepath=false", "-c", "color.status=false"}, args...)