diff options
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/prompt/pwd.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/prompt/pwd.go b/internal/prompt/pwd.go index 947606c..27fe84b 100644 --- a/internal/prompt/pwd.go +++ b/internal/prompt/pwd.go @@ -114,8 +114,11 @@ func (dir *Directory) stripHomeDirFromDisplay() { if dir.InBuildTree || dir.InRepoTree { return } - rel = "" + dir.DisplayPath = "" + dir.TitlePath = "~" + return } + if !strings.HasPrefix(rel, "..") { dir.DisplayPath = rel dir.TitlePath = "~/" + rel @@ -131,6 +134,7 @@ func findNearestAccessiblePath(path string) string { } func getDirectoryField(dir Directory, tt *TerminalTitle) string { + tt.Path = dir.TitlePath if dir.DisplayPath == "" { return "" } @@ -151,8 +155,6 @@ func getDirectoryField(dir Directory, tt *TerminalTitle) string { txt = withColor("1;36", dir.NearestAccessiblePath+"/") + withColor("1;31", rel) } - tt.Path = dir.TitlePath - //apply tags if dir.InRepoTree { txt = withType("repo", txt) |
