fish-shell/share/functions/prompt_pwd.fish
Fabian Homborg 86471ac21f Remove OSX/Cygwin special cases from prompt_pwd
For cygwin, you can't `cd C:`, so a prompt of "C:/Something" is
misleading.

For OSX, we dereference symlinks elsewhere

This also simplifies prompt_pwd quite a bit.
2015-10-09 17:45:45 +02:00

4 lines
216 B
Fish

function prompt_pwd --description "Print the current working directory, shortened to fit the prompt"
set realhome ~
string replace -r '^'"$realhome"'($|/)' '~$1' $PWD | string replace -ar '([^/.])[^/]*/' '$1/'
end