mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-13 20:27:28 -08:00
fix(path): display root path icon when using agnoster
This commit is contained in:
parent
44b970fc02
commit
f67ee8e609
|
@ -169,7 +169,7 @@ func (pt *path) getLetterPath() string {
|
|||
|
||||
func (pt *path) getAgnosterFullPath() string {
|
||||
pwd := pt.getPwd()
|
||||
if string(pwd[0]) == pt.env.getPathSeperator() {
|
||||
if len(pwd) > 1 && string(pwd[0]) == pt.env.getPathSeperator() {
|
||||
pwd = pwd[1:]
|
||||
}
|
||||
return pt.replaceFolderSeparators(pwd)
|
||||
|
|
|
@ -305,7 +305,7 @@ func TestAgnosterPathStyles(t *testing.T) {
|
|||
{Style: AgnosterShort, Expected: "~ > .. > man", HomePath: "/usr/home", Pwd: "/usr/home/whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
|
||||
{Style: AgnosterShort, Expected: "~ > projects", HomePath: "/usr/home", Pwd: "/usr/home/projects", PathSeperator: "/", FolderSeparatorIcon: " > "},
|
||||
{Style: AgnosterShort, Expected: "C:", HomePath: homeBillWindows, Pwd: "C:", PathSeperator: "\\", FolderSeparatorIcon: " > "},
|
||||
{Style: AgnosterShort, Expected: "", HomePath: homeBillWindows, Pwd: "/", PathSeperator: "/", FolderSeparatorIcon: " > "},
|
||||
{Style: AgnosterShort, Expected: "/", HomePath: homeBillWindows, Pwd: "/", PathSeperator: "/", FolderSeparatorIcon: " > "},
|
||||
{Style: AgnosterShort, Expected: "foo", HomePath: homeBillWindows, Pwd: "/foo", PathSeperator: "/", FolderSeparatorIcon: " > "},
|
||||
|
||||
{Style: AgnosterShort, Expected: "usr > .. > bar > man", HomePath: "/usr/home", Pwd: "/usr/foo/bar/man", PathSeperator: "/", FolderSeparatorIcon: " > ", MaxDepth: 2},
|
||||
|
|
Loading…
Reference in a new issue