diff options
author | Kevin Ballard <kevin@sb.org> | 2012-06-21 20:32:07 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-06-24 14:04:43 -0700 |
commit | 529d410bec1f2d3c455840db7d52663d52b34469 (patch) | |
tree | 471165235af61d43caf1587c06b9598c15175982 /share/functions/prompt_pwd.fish | |
parent | 4d1c0eaa5244905c72ef29496af42e2dbd5111e6 (diff) |
Fix prompt_cwd on darwin systems when $PWD is "/private"
When $PWD is "/private", the prompt was printing "rivate". Skip the
"/private" stripping if there's nothing after it.
Prevent "/private" from being stripped anywhere but the beginning of the
PWD.
Fixes #173
Diffstat (limited to 'share/functions/prompt_pwd.fish')
-rw-r--r-- | share/functions/prompt_pwd.fish | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish index 7f892c70..0396fd04 100644 --- a/share/functions/prompt_pwd.fish +++ b/share/functions/prompt_pwd.fish @@ -2,7 +2,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||' -e "s|^$HOME|~|" -e 's-/\(\.\{0,1\}[^/]\)\([^/]*\)-/\1-g') + 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-' else echo '~' |