diff options
author | liljencrantz <liljencrantz@gmail.com> | 2008-01-17 08:36:21 +1000 |
---|---|---|
committer | liljencrantz <liljencrantz@gmail.com> | 2008-01-17 08:36:21 +1000 |
commit | b86856b454ee55cc25eba05cd3a4817eec46ef8d (patch) | |
tree | c5d4e6a94cb9cc4295b0e6234e65f15d3ab72553 /share/functions/prompt_pwd.fish | |
parent | 659832053424518a94e55ae3681f9a5a16906b94 (diff) |
In prompt_pwd, if a directory name starts with a dot, include first two characters. This patch was written by Denilson F. de Sá
darcs-hash:20080116223621-75c98-46f96c9f25d5e32cd10148d35713622e6eac50d7.gz
Diffstat (limited to 'share/functions/prompt_pwd.fish')
-rw-r--r-- | share/functions/prompt_pwd.fish | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish index 3d9f12d3..b1380707 100644 --- a/share/functions/prompt_pwd.fish +++ b/share/functions/prompt_pwd.fish @@ -2,8 +2,8 @@ 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-/\([^/]\)\([^/]*\)-/\1-g') - echo $PWD|sed -e 's-.*/[^/]\([^/]*$\)-\1-' + printf "%s" (echo $PWD|sed -e 's|/private||' -e "s|^$HOME|~|" -e 's-/\(\.\?[^/]\)\([^/]*\)-/\1-g') + echo $PWD|sed -e 's-.*/\.\?[^/]\([^/]*$\)-\1-' else echo '~' end @@ -15,8 +15,8 @@ else echo '~' case '*' - printf "%s" (echo $PWD|sed -e "s|^$HOME|~|" -e 's-/\([^/]\)\([^/]*\)-/\1-g') - echo $PWD|sed -n -e 's-.*/.\([^/]*\)-\1-p' + printf "%s" (echo $PWD|sed -e "s|^$HOME|~|" -e 's-/\(\.\?[^/]\)\([^/]*\)-/\1-g') + echo $PWD|sed -n -e 's-.*/\.\?.\([^/]*\)-\1-p' end end end |