mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-01 14:31:43 +08: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.
5 lines
216 B
Fish
5 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
|