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

Consider PYTHON_ARGCOMPLETE_OK with local activation #495

Open
FlorianPommerening opened this issue Jul 30, 2024 · 0 comments
Open

Consider PYTHON_ARGCOMPLETE_OK with local activation #495

FlorianPommerening opened this issue Jul 30, 2024 · 0 comments

Comments

@FlorianPommerening
Copy link

We ran into a potential issue when deciding whether we want to recommend local (register-python-argcomplete) or global (activate-global-python-argcomplete) activation to users of our software. We thought local activation would be less intrusive but then ran into a case where this is not the case: we want to enable completion for our build tool called build.py. Obviously this is a common name, so chances are that there are other scripts like this around, for example older branches of our software that don't yet have the argcomplete code, or build scripts of other tools.

With global activation this is no problem: only scripts that have the magic string are called when a users presses TAB. With local activation, pressing TAB on a different script would start a build. This is not showing output, so from a user perspective, the call just blocks, but there are side effects happening in the background.

Would it be an option to consider PYTHON_ARGCOMPLETE_OK with the local activation as well, so only run the program if the magic string is found in it? Maybe with a flag of register-python-argcomplete if this should not be the default behavior.

This may be a separate issue but we also saw some differences between the two activation methods: with global activation zsh would suggest filenames in addition to the suggestions returned by the completers. As far as I know this was an issue that has already been fixed and I only saw it because I'm stuck on an old version from apt. The reason I'm mentioning this here is that I think in general it would be great if the behavior of the two activation methods could be unified, so they share more code and behavior. I don't know the internal details of this, of course, there could be reasons why this is not possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant