mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
dc57ba01a2
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.
9 lines
305 B
Fish
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
|