diff --git a/src/segments/path.go b/src/segments/path.go index b418f52a..d8146803 100644 --- a/src/segments/path.go +++ b/src/segments/path.go @@ -238,7 +238,7 @@ func (pt *Path) getUniqueLettersPath() string { func (pt *Path) getAgnosterFullPath() string { pwd := pt.getPwd() - if len(pwd) > 1 && string(pwd[0]) == pt.env.PathSeparator() { + for len(pwd) > 1 && string(pwd[0]) == pt.env.PathSeparator() { pwd = pwd[1:] } return pt.replaceFolderSeparators(pwd) diff --git a/src/segments/path_test.go b/src/segments/path_test.go index cab42b7b..75128f54 100644 --- a/src/segments/path_test.go +++ b/src/segments/path_test.go @@ -267,6 +267,9 @@ func TestAgnosterPathStyles(t *testing.T) { {Style: Unique, Expected: "~ > a > ab > abcd", HomePath: "/usr/home", Pwd: "/usr/home/ab/abc/abcd", PathSeparator: "/", FolderSeparatorIcon: " > "}, {Style: Unique, Expected: "~ > a > .a > abcd", HomePath: "/usr/home", Pwd: "/usr/home/ab/.abc/abcd", PathSeparator: "/", FolderSeparatorIcon: " > "}, {Style: Unique, Expected: "~ > a > ab > abcd", HomePath: "/usr/home", Pwd: "/usr/home/ab/ab/abcd", PathSeparator: "/", FolderSeparatorIcon: " > "}, + + {Style: AgnosterShort, Expected: "localhost > c$", HomePath: homeBillWindows, Pwd: "\\\\localhost\\c$", PathSeparator: "\\", FolderSeparatorIcon: " > "}, + {Style: AgnosterShort, Expected: "localhost\\c$", HomePath: homeBillWindows, Pwd: "\\\\localhost\\c$", PathSeparator: "\\", FolderSeparatorIcon: "\\"}, } for _, tc := range cases { env := new(mock.MockedEnvironment)