mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-28 11:31:04 -08:00
fix(path): agnoster unc path on windows
This commit is contained in:
parent
3d0e108122
commit
39a272af76
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue