Skip to content

Commit d2384f8

Browse files
committed
Revert "Simplified _agkozak_prompt_dirtrim() logic"
This reverts commit 0b0245e.
1 parent 0b0245e commit d2384f8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

agkozak-zsh-theme.plugin.zsh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,12 @@ _agkozak_prompt_dirtrim() {
9595
[[ $1 -ge 1 ]] || set 2
9696
local abbreviated_path
9797
case $PWD in
98+
$HOME) print -n '~' ;; # For TrueOS
9899
$HOME*)
99-
abbreviated_path=$(print -Pn "%($(($1 + ${#HOME//[^\/]/}-1))~|~/.../%$1~|%~)")
100+
abbreviated_path=$(print -Pn "%($(($1 + 2))~|~/.../%${1}~|%~)")
100101
;;
101102
*)
102-
abbreviated_path=$(print -Pn "%($(($1 + 1))~|.../%$1~|%~)")
103+
abbreviated_path=$(print -Pn "%($(($1 + 1))~|.../%${1}~|%~)")
103104
;;
104105
esac
105106
print -n "$abbreviated_path"

0 commit comments

Comments
 (0)