mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 17:43:44 +08:00
e395a0eb69
Prior to this fix, when completing a command that doesn't have a /, we would prepend each component of PATH and then expand the whole thing. So any special characters in the PATH would be interpreted when performing tab completion. With this fix, we pull the PATH resolution out of complete.cpp and migrate it to expand.cpp. This unifies nicely with the CDPATH resolution already in that file. This requires introducing a new expand flag EXPAND_SPECIAL_FOR_COMMAND, which is analogous to EXPAND_SPECIAL_CD (which is renamed to EXPAND_SPECIAL_FOR_CD). This flag tells expand to resolve paths against PATH instead of the working directory. Fixes #952
38 lines
375 B
Plaintext
38 lines
375 B
Plaintext
AAAA:
|
|
--abcd
|
|
AAAA:
|
|
--abcd
|
|
--efgh
|
|
BBBB:
|
|
--abcd
|
|
BBBB:
|
|
|
|
CCCC:
|
|
--bar
|
|
--baz
|
|
-a
|
|
-b
|
|
-bar
|
|
-foo
|
|
CCCC:
|
|
--baz
|
|
-a
|
|
-b
|
|
-bar
|
|
-foo
|
|
CCCC:
|
|
--baz
|
|
-a
|
|
-b
|
|
-bar
|
|
CCCC:
|
|
--baz
|
|
-b
|
|
-bar
|
|
CCCC:
|
|
implicit cd complete works
|
|
no implicit cd complete after 'command'
|
|
PATH does not cause incorrect implicit cd
|
|
Command completion with parened PATHs test passed
|
|
Command completion with intermediate slashes passed
|