argcomplete icon indicating copy to clipboard operation
argcomplete copied to clipboard

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

Open ryran opened this issue 3 years ago • 1 comments

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?

ryran avatar Feb 08 '22 03:02 ryran

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

evanunderscore avatar Feb 14 '22 12:02 evanunderscore

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 avatar Apr 28 '23 16:04 Dramelac

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)

Dramelac avatar Apr 28 '23 16:04 Dramelac

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

evanunderscore avatar Dec 09 '23 02:12 evanunderscore