mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-31 13:57:26 -08:00
parent
b95aec7ffa
commit
6bc0f888c2
|
@ -364,8 +364,9 @@ func (pt *Path) getAgnosterShortPath() string {
|
|||
|
||||
func (pt *Path) getFullPath() string {
|
||||
rel := pt.relative
|
||||
if pt.root != pt.env.PathSeparator() {
|
||||
rel = pt.env.PathSeparator() + rel
|
||||
pathSeparator := pt.env.PathSeparator()
|
||||
if pt.root != pathSeparator && !strings.HasSuffix(pt.root, pathSeparator) {
|
||||
rel = pathSeparator + rel
|
||||
}
|
||||
path := pt.replaceFolderSeparators(rel)
|
||||
return pt.root + path
|
||||
|
|
|
@ -747,6 +747,7 @@ func TestFullAndFolderPath(t *testing.T) {
|
|||
{Style: Folder, FolderSeparatorIcon: "\\", Pwd: homeDirWindows, Expected: "~", PathSeparator: "\\", GOOS: environment.WINDOWS},
|
||||
{Style: Full, FolderSeparatorIcon: "\\", Pwd: homeDirWindows, Expected: "~", PathSeparator: "\\", GOOS: environment.WINDOWS},
|
||||
{Style: Full, FolderSeparatorIcon: "\\", Pwd: homeDirWindows + "\\abc", Expected: "~\\abc", PathSeparator: "\\", GOOS: environment.WINDOWS},
|
||||
{Style: Full, FolderSeparatorIcon: "\\", Pwd: "C:\\Users\\posh", Expected: "C:\\Users\\posh", PathSeparator: "\\", GOOS: environment.WINDOWS},
|
||||
|
||||
// StackCountEnabled=true and StackCount=2
|
||||
{Style: Full, FolderSeparatorIcon: "|", Pwd: "/", StackCount: 2, Expected: "2 /"},
|
||||
|
|
Loading…
Reference in a new issue