You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
./foo.py /e<TAB># completes to /etc as expected
python ./foo.py /e<TAB># completes to /etc as expected
python foo.py /e<TAB># deletes /e instead
Likely Cause
It looks like the root cause for this is in line 154, where [[ "$executable" == python* ]] checks if the executable is python or the script.
In this context, $executable was set earlier (line 148) as executable="${words[1]}". By this time zsh probably already did some preprocessing because words is ( foo.py /e), not (python foo.py /e). This then means that the test fails and no completions are generated there. The elif case in line 172 also fails because __python_argcomplete_which "$executable" executes whence -p "foo.py" which fails because the current working directory is not on the PATH. This also explains why python ./foo.py /e<TAB> works while python foo.py /e<TAB> doesn't.
The text was updated successfully, but these errors were encountered:
I ran into one more issue with the
FilesCompleter
, this one zsh-specific:To reproduce
Test environment:
I tested this with the following file
foo.py
Likely Cause
It looks like the root cause for this is in line 154, where
[[ "$executable" == python* ]]
checks if the executable is python or the script.In this context,
$executable
was set earlier (line 148) asexecutable="${words[1]}"
. By this time zsh probably already did some preprocessing becausewords
is( foo.py /e)
, not(python foo.py /e)
. This then means that the test fails and no completions are generated there. Theelif
case in line 172 also fails because__python_argcomplete_which "$executable"
executeswhence -p "foo.py"
which fails because the current working directory is not on the PATH. This also explains whypython ./foo.py /e<TAB>
works whilepython foo.py /e<TAB>
doesn't.The text was updated successfully, but these errors were encountered: