From b86856b454ee55cc25eba05cd3a4817eec46ef8d Mon Sep 17 00:00:00 2001 From: liljencrantz Date: Thu, 17 Jan 2008 08:36:21 +1000 Subject: [PATCH] =?UTF-8?q?In=20prompt=5Fpwd,=20if=20a=20directory=20name?= =?UTF-8?q?=20starts=20with=20a=20dot,=20include=20first=20two=20character?= =?UTF-8?q?s.=20This=20patch=20was=20written=20by=20Denilson=20F.=20de=20S?= =?UTF-8?q?=C3=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit darcs-hash:20080116223621-75c98-46f96c9f25d5e32cd10148d35713622e6eac50d7.gz --- share/functions/prompt_pwd.fish | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish index 3d9f12d36..b13807075 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