mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-12 07:57:22 +00:00
feb36e7342
/c/c looks awful, and C:/ is simply better.
13 lines
656 B
Fish
13 lines
656 B
Fish
if test (uname) = Darwin
|
|
function prompt_pwd --description "Print the current working directory, shortend to fit the prompt"
|
|
echo $PWD | sed -e "s|^$HOME|~|" -e 's|^/private||' -e 's-\([^/.]\)[^/]*/-\1/-g'
|
|
end
|
|
else if test (uname -o) = Cygwin
|
|
function prompt_pwd --description "Print the current working directory, shortend to fit the prompt"
|
|
echo $PWD | sed -e "s|^$HOME|~|" -e 's|^/cygdrive/\(.\)|\1/:|' -e 's-\([^/.]\)[^/]*/-\1/-g' -e 's-^\([^/]\)/:/\?-\u\1:/-'
|
|
end
|
|
else
|
|
function prompt_pwd --description "Print the current working directory, shortend to fit the prompt"
|
|
echo $PWD | sed -e "s|^$HOME|~|" -e 's-\([^/.]\)[^/]*/-\1/-g'
|
|
end
|
|
end
|