mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-18 10:12:45 +08:00
__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.
This commit is contained in:
parent
c95a223f5e
commit
dc57ba01a2
|
@ -1,15 +1,8 @@
|
||||||
switch (uname)
|
function __fish_pwd --description "Show current path"
|
||||||
case 'CYGWIN_*'
|
if status test-feature regex-easyesc
|
||||||
function __fish_pwd --description "Show current path"
|
string replace -r '^/cygdrive/(.)?' '\U$1:' -- $PWD
|
||||||
if status test-feature regex-easyesc
|
else
|
||||||
pwd | string replace -r '^/cygdrive/(.)?' '\U$1:'
|
# TODO: Remove this once regex-easyesc becomes the default
|
||||||
else
|
string replace -r '^/cygdrive/(.)?' '\\\U$1:' -- $PWD
|
||||||
# TODO: Remove this once regex-easyesc becomes the default
|
end
|
||||||
pwd | string replace -r '^/cygdrive/(.)?' '\\\U$1:'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
case '*'
|
|
||||||
function __fish_pwd --description "Show current path"
|
|
||||||
pwd
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user