diff --git a/agkozak-zsh-theme.plugin.zsh b/agkozak-zsh-theme.plugin.zsh index 818cad9..b513e44 100644 --- a/agkozak-zsh-theme.plugin.zsh +++ b/agkozak-zsh-theme.plugin.zsh @@ -95,12 +95,11 @@ _agkozak_prompt_dirtrim() { [[ $1 -ge 1 ]] || set 2 local abbreviated_path case $PWD in - $HOME) print -n '~' ;; # For TrueOS $HOME*) - abbreviated_path=$(print -Pn "%($(($1 + 2))~|~/.../%${1}~|%~)") + abbreviated_path=$(print -Pn "%($(($1 + ${#HOME//[^\/]/}-1))~|~/.../%$1~|%~)") ;; *) - abbreviated_path=$(print -Pn "%($(($1 + 1))~|.../%${1}~|%~)") + abbreviated_path=$(print -Pn "%($(($1 + 1))~|.../%$1~|%~)") ;; esac print -n "$abbreviated_path"