diff --git a/agkozak-zsh-theme.plugin.zsh b/agkozak-zsh-theme.plugin.zsh index b513e44..818cad9 100644 --- a/agkozak-zsh-theme.plugin.zsh +++ b/agkozak-zsh-theme.plugin.zsh @@ -95,11 +95,12 @@ _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 + ${#HOME//[^\/]/}-1))~|~/.../%$1~|%~)") + abbreviated_path=$(print -Pn "%($(($1 + 2))~|~/.../%${1}~|%~)") ;; *) - abbreviated_path=$(print -Pn "%($(($1 + 1))~|.../%$1~|%~)") + abbreviated_path=$(print -Pn "%($(($1 + 1))~|.../%${1}~|%~)") ;; esac print -n "$abbreviated_path"