aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/prompt_pwd.fish
diff options
context:
space:
mode:
authorGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2014-10-26 14:20:49 +0800
committerGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2014-10-26 14:20:49 +0800
commit5638764badb2fb589861a24e87ba4b974dc20ad5 (patch)
tree500dd8f4cbb70efe6ab089173cca9d4d4e306f4d /share/functions/prompt_pwd.fish
parentab7af98dede422fbaf3b691e4c44e1e76e2fb18c (diff)
prompt_pwd: Use tilde expansion to get real full home path
Closes #1133.
Diffstat (limited to 'share/functions/prompt_pwd.fish')
-rw-r--r--share/functions/prompt_pwd.fish3
1 files changed, 2 insertions, 1 deletions
diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish
index ce98f6d4..921ee429 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