fish-shell/share/functions/prompt_pwd.fish
Emily Eisenberg d07e78c59a Make prompt_pwd make a lot more sense
Remove the case statements, which were handled by the sed blocks anyway
Move around the '/' character in the regex, so only one regex is needed
Fix a bug where '/' is output as '//'
2012-07-06 14:46:50 -07:00

11 lines
392 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
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