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

how to prevent a completer from falling back to bash filename completion? #366

Closed
ryran opened this issue Feb 8, 2022 · 4 comments
Closed

Comments

@ryran
Copy link

ryran commented Feb 8, 2022

Every script I work on has some arg that is so dynamic that it can't be completed, i.e., where no choices can be set, nor any custom completer. It's annoying when such args trigger bash filename completion. How can I prevent that?

The weird thing is, I feel like this was solved at some point... or at least, I feel like this hasn't always been a problem. Anyone have any ideas?

@evanunderscore
Copy link
Collaborator

Is --no-defaults what you're looking for?

@Dramelac
Copy link

I have the same problem...
I tried to create a completer that return an empty list but argcomplete always using bash completer as fallback when the complter return no options...

Is there something i am missing ?

What do you mean @evanunderscore by --no-defaults ?

@Dramelac
Copy link

Okay i found it, after some digging the default bash fallback can be disabled in the register-python-argcomplete step:
eval $(register-python-argcomplete --no-defaults my-script)

@evanunderscore
Copy link
Collaborator

Closing this as resolved, thanks for following up. The regression in global completion should be handled in #445.

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

3 participants