diff options
author | 2006-01-25 04:09:44 +1000 | |
---|---|---|
committer | 2006-01-25 04:09:44 +1000 | |
commit | fef420d64822f0511a06610e967ace3fdf904720 (patch) | |
tree | 32ba793a819306f909389ad2a2242cbc49563814 /init | |
parent | f2c4becde72bd61e46255ec2af62c5bc71ba9b7d (diff) |
Make the prompt_pwd behave better with strange sed implementations (I'm looking at you, OS X)
darcs-hash:20060124180944-ac50b-63f45e0ef950fca45b1c5eaa48e960895d418631.gz
Diffstat (limited to 'init')
-rw-r--r-- | init/fish_function.fish | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/init/fish_function.fish b/init/fish_function.fish index f6c1a1ba..d3fa89fb 100644 --- a/init/fish_function.fish +++ b/init/fish_function.fish @@ -210,10 +210,11 @@ end function prompt_pwd -d "Print the current working directory, shortend to fit the prompt" set -l wd (pwd) - printf "%s" $wd|sed -e 's-/\([^/]\)\([^/]*\)-/\1-g' + set -l res (echo $wd|sed -e 's-/\([^/]\)\([^/]*\)-/\1-g') if test $wd != '~' - printf "%s\n" $wd|sed -e 's-.*/[^/]\([^/]*$\)-\1-' + set res $res(echo $wd|sed -e 's-.*/[^/]\([^/]*$\)-\1-') end + echo $res end # |