xontrib-argcomplete icon indicating copy to clipboard operation
xontrib-argcomplete copied to clipboard

No completion for pipx, which is using argcomplete

Open paugier opened this issue 1 year ago • 1 comments

pipx uses argcomplete.

On Linux (Debian 11), I install pipx, xonsh and xontrib-argcomplete with

python3 -m pip install pipx
python3 -m pipx ensurepath

In a new terminal, I can setup argcomplete for Bash and I get autocompletion for Bash. Then,

pipx install xonsh
xonsh
xpip install xontrib-argcomplete
echo 'xontrib load argcomplete' >> ~/.xonshrc

In a new terminal, I don't get autocompletion for pipx in xonsh.

paugier avatar May 22 '24 11:05 paugier

Hey @paugier ! Nice catch! As described in xontrib-argcomplete readme it's need to have PYTHON_ARGCOMPLETE_OK in the first lines of $(which pipx) file. After adding it I see the completion immediately:

image image

But how we can solve this. There is no way to understand that tool is using argcomplete.

I suggest to skip _python_argcomplete_scan_head in case tool name is in __xonsh__.env.get("XONTRIB_ARGCOMPLETE_TOOLS", []) and you can do $XONTRIB_ARGCOMPLETE_TOOLS=['pipx'] in your .xonshrc.

It will be cool if you can prepare PR for this. I can review and make release fast. Thanks!

anki-code avatar May 22 '24 19:05 anki-code