From 5638764badb2fb589861a24e87ba4b974dc20ad5 Mon Sep 17 00:00:00 2001 From: David Adam Date: Sun, 26 Oct 2014 14:20:49 +0800 Subject: [PATCH] prompt_pwd: Use tilde expansion to get real full home path Closes #1133. --- share/functions/prompt_pwd.fish | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish index ce98f6d44..921ee4299 100644 --- a/share/functions/prompt_pwd.fish +++ b/share/functions/prompt_pwd.fish @@ -9,5 +9,6 @@ case 'CYGWIN_*' end function prompt_pwd -V args_pre -V args_post --description "Print the current working directory, shortened to fit the prompt" - echo $PWD | sed -e "s|^$HOME|~|" $args_pre -e 's-\([^/.]\)[^/]*/-\1/-g' $args_post + set -l realhome ~ + echo $PWD | sed -e "s|^$realhome|~|" $args_pre -e 's-\([^/.]\)[^/]*/-\1/-g' $args_post end