aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/prompt_pwd.fish
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-07-11 08:38:48 +1000
committerGravatar axel <axel@liljencrantz.se>2006-07-11 08:38:48 +1000
commit746a602515360c2119a445d352d20ebf300efd7c (patch)
tree57ca7fd31d42a611a02120e426a6b6bb697076bb /share/functions/prompt_pwd.fish
parenta41fd8f759a2ef1584a084e9f9692259c836b320 (diff)
Make sure that the / is only printed once in prompt_pwd function when cwd is root
darcs-hash:20060710223848-ac50b-ddb52c414fd8b08bd7c515c99cc4e05a3c479c7d.gz
Diffstat (limited to 'share/functions/prompt_pwd.fish')
-rw-r--r--share/functions/prompt_pwd.fish2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish
index 039148ff..49a03708 100644
--- a/share/functions/prompt_pwd.fish
+++ b/share/functions/prompt_pwd.fish
@@ -12,7 +12,7 @@ else
function prompt_pwd -d (N_ "Print the current working directory, shortend to fit the prompt")
if test "$PWD" != "$HOME"
printf "%s" (echo $PWD|sed -e "s|^$HOME|~|" -e 's-/\([^/]\)\([^/]*\)-/\1-g')
- echo $PWD|sed -e 's-.*/[^/]\([^/]*$\)-\1-'
+ echo $PWD|sed -n -e 's-.*/[^/]\([^/]*$\)-\1-p'
else
echo '~'
end