mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-08 19:18:47 +00:00
a2cd8c8a8d
darcs-hash:20060212131421-ac50b-861f8941af76cf9a1e6fb7da2ac7f33795fab272.gz
21 lines
610 B
Fish
21 lines
610 B
Fish
|
|
if test (uname) = Darwin
|
|
function prompt_pwd -d (_ "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-'
|
|
else
|
|
echo '~'
|
|
end
|
|
end
|
|
else
|
|
function prompt_pwd -d (_ "Print the current working directory, shortend to fit the prompt")
|
|
if test "$PWD" != "$HOME"
|
|
printf "%s" (echo $PWD|sed -e "s|^$HOME|~|" -e 's-/\([^/]\)\([^/]*\)-/\1-g')
|
|
echo $PWD|sed -e 's-.*/[^/]\([^/]*$\)-\1-'
|
|
else
|
|
echo '~'
|
|
end
|
|
end
|
|
end
|
|
|