From 5238ed309f27aa2a5baf5f96aca38aa0ba8b06fc Mon Sep 17 00:00:00 2001 From: Jonas Hietala Date: Sat, 8 Aug 2015 21:59:05 +0200 Subject: [PATCH] Match the whole real home directory in prompt_pwd. --- share/functions/prompt_pwd.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish index 921ee4299..e44b96490 100644 --- a/share/functions/prompt_pwd.fish +++ b/share/functions/prompt_pwd.fish @@ -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