2006-02-12 21:14:21 +08:00
|
|
|
if test (uname) = Darwin
|
2007-01-16 09:29:18 +08:00
|
|
|
function prompt_pwd --description "Print the current working directory, shortend to fit the prompt"
|
2013-06-02 14:02:13 +08:00
|
|
|
echo $PWD | sed -e "s|^$HOME|~|" -e 's|^/private||' -e 's-\([^/.]\)[^/]*/-\1/-g'
|
2006-02-12 21:14:21 +08:00
|
|
|
end
|
2013-08-14 17:11:09 +08:00
|
|
|
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
|
2006-02-12 21:14:21 +08:00
|
|
|
else
|
2007-01-16 09:29:18 +08:00
|
|
|
function prompt_pwd --description "Print the current working directory, shortend to fit the prompt"
|
2013-06-02 14:02:13 +08:00
|
|
|
echo $PWD | sed -e "s|^$HOME|~|" -e 's-\([^/.]\)[^/]*/-\1/-g'
|
2006-02-12 21:14:21 +08:00
|
|
|
end
|
|
|
|
end
|