aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/prompt_pwd.fish
diff options
context:
space:
mode:
authorGravatar Kevin Ballard <kevin@sb.org>2012-06-22 18:35:44 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-06-24 14:04:43 -0700
commit1a93cbba1e6ff0c1c5767b529a42f444b985b7dc (patch)
tree8c5baeae5a20fcba144fd648d5096518b2adb73a /share/functions/prompt_pwd.fish
parent529d410bec1f2d3c455840db7d52663d52b34469 (diff)
Bring prompt_pwd under Darwin to parity with non-Darwin
The echo command to print the last path segment got a couplel of fixes, but these fixes were only applied to the non-Darwin version. Copy these fixes over to the Darwin version. Notably, this makes `/` stop displaying as `//`.
Diffstat (limited to 'share/functions/prompt_pwd.fish')
-rw-r--r--share/functions/prompt_pwd.fish3
1 files changed, 1 insertions, 2 deletions
diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish
index 0396fd04..34b2e8ee 100644
--- a/share/functions/prompt_pwd.fish
+++ b/share/functions/prompt_pwd.fish
@@ -3,7 +3,7 @@ if test (uname) = Darwin
function prompt_pwd --description "Print the current working directory, shortend to fit the prompt"
if test "$PWD" != "$HOME"
printf "%s" (echo $PWD|sed -e 's|^/private\(/.\{1,\}\)|\1|' -e "s|^$HOME|~|" -e 's-/\(\.\{0,1\}[^/]\)\([^/]*\)-/\1-g')
- echo $PWD|sed -e 's-.*/\.\{0,1\}[^/]\([^/]*$\)-\1-'
+ echo $PWD|sed -n -e 's-.*/\.\{0,1\}.\([^/]*\)-\1-p'
else
echo '~'
end
@@ -20,4 +20,3 @@ else
end
end
end
-