Merge pull request #2283 from treeman/prompt_pwd

Match the whole real home directory in prompt_pwd.
This commit is contained in:
faho 2015-08-14 21:40:21 +02:00
commit 81696c16d2

View file

@ -10,5 +10,5 @@ end
function prompt_pwd -V args_pre -V args_post --description "Print the current working directory, shortened to fit the prompt"
set -l realhome ~
echo $PWD | sed -e "s|^$realhome|~|" $args_pre -e 's-\([^/.]\)[^/]*/-\1/-g' $args_post
echo $PWD | sed -e "s|^$realhome\$|~|" -e "s|^$realhome/|~/|" $args_pre -e 's-\([^/.]\)[^/]*/-\1/-g' $args_post
end