Skip to content

Commit

Permalink
fix: slow git status on wsl2
Browse files Browse the repository at this point in the history
  • Loading branch information
evilz authored and JanDeDobbeleer committed Mar 10, 2021
1 parent 6ed5402 commit 500cc58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/segment_git.go
Expand Up @@ -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...)
Expand Down

0 comments on commit 500cc58

Please sign in to comment.