Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No completion for pipx, which is using argcomplete #9

Open
paugier opened this issue May 22, 2024 · 1 comment
Open

No completion for pipx, which is using argcomplete #9

paugier opened this issue May 22, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@paugier
Copy link

paugier commented May 22, 2024

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.

@anki-code
Copy link
Owner

anki-code commented May 22, 2024

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 anki-code added the enhancement New feature or request label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants