Index: config/fish/functions/prompt_pwd.fish ================================================================== --- config/fish/functions/prompt_pwd.fish +++ config/fish/functions/prompt_pwd.fish @@ -9,8 +9,12 @@ end # Replace $HOME with "~" set realhome ~ set -l tmp (string replace -r '^'"$realhome"'($|/)' '~$1' $PWD) + set tmp (basename $tmp) + + test $PWD = "/$tmp" + and set tmp $PWD - basename $tmp + echo $tmp end