mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
3e115b7a85
I break compatibility with Mac OS X again, that I don't have access to. Result: Stuff break, and I have to fix it, so it will perhaps work. At least, I hope it will work.
14 lines
645 B
Fish
14 lines
645 B
Fish
switch (uname)
|
|
case 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
|
|
case '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
|
|
case '*'
|
|
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
|