diff --git a/config/fish/functions/prompt_pwd.fish b/config/fish/functions/prompt_pwd.fish index ea2a213..95034e0 100644 --- a/config/fish/functions/prompt_pwd.fish +++ b/config/fish/functions/prompt_pwd.fish @@ -11,6 +11,10 @@ function prompt_pwd --description 'Print the current working directory' # Replace $HOME with "~" set realhome ~ set -l tmp (string replace -r '^'"$realhome"'($|/)' '~$1' $PWD) + set tmp (basename $tmp) - basename $tmp + test $PWD = "/$tmp" + and set tmp $PWD + + echo $tmp end