mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
86471ac21f
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.
4 lines
216 B
Fish
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
|