mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +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)
|
||||
case 'CYGWIN_*'
|
||||
function __fish_pwd --description "Show current path"
|
||||
if status test-feature regex-easyesc
|
||||
pwd | string replace -r '^/cygdrive/(.)?' '\U$1:'
|
||||
else
|
||||
# TODO: Remove this once regex-easyesc becomes the default
|
||||
pwd | string replace -r '^/cygdrive/(.)?' '\\\U$1:'
|
||||
end
|
||||
end
|
||||
case '*'
|
||||
function __fish_pwd --description "Show current path"
|
||||
pwd
|
||||
end
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user