From f74855fc3c745ce1456c598ad3280b8254f2c050 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Mon, 24 Oct 2022 20:18:30 +0200 Subject: [PATCH] fix(path): fallback to env.Pwd() for .Location resolves #3010 --- src/segments/path.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/segments/path.go b/src/segments/path.go index 22c0e645..447bc38b 100644 --- a/src/segments/path.go +++ b/src/segments/path.go @@ -78,13 +78,14 @@ func (pt *Path) Enabled() bool { return false } pt.setStyle() + pwd := pt.env.Pwd() if pt.env.IsWsl() { - pt.Location, _ = pt.env.RunCommand("wslpath", "-m", pt.env.Pwd()) + pt.Location, _ = pt.env.RunCommand("wslpath", "-m", pwd) } else { - pt.Location = pt.pwd + pt.Location = pwd } pt.StackCount = pt.env.StackCount() - pt.Writable = pt.env.DirIsWritable(pt.env.Pwd()) + pt.Writable = pt.env.DirIsWritable(pwd) return true }