fish-shell/share/functions/__fish_pwd.fish
Fabian Homborg dc57ba01a2 __fish_pwd: Just always define the cygwin version
This called `uname` just to check if we *should* shorten "cygdrive"
directories.

That's more annoying than just doing it by default - on my system `pwd
| string replace` takes about 100 *micro*seconds, and this is done
once per prompt. Anyway, using $PWD further speeds it up to ~30
microseconds (compared to 10-20 for just `pwd`). This is hard to
measure because it's heavily impacted by system hitter.

The alternative is to ask cygwin to ship this feature as a patch.
2021-04-19 18:58:00 +02:00

9 lines
305 B
Fish

function __fish_pwd --description "Show current path"
if status test-feature regex-easyesc
string replace -r '^/cygdrive/(.)?' '\U$1:' -- $PWD
else
# TODO: Remove this once regex-easyesc becomes the default
string replace -r '^/cygdrive/(.)?' '\\\U$1:' -- $PWD
end
end