mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-15 14:34:05 +00:00
Make the prompt_pwd behave better with strange sed implementations (I'm looking at you, OS X)
darcs-hash:20060124180944-ac50b-63f45e0ef950fca45b1c5eaa48e960895d418631.gz
This commit is contained in:
parent
f2c4becde7
commit
fef420d648
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue