Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: qpdf or bashcompinit completion bug



On 8/18/25 11:06 PM, Vincent Lefevre wrote:
On 2025-08-19 04:53:20 +0200, Vincent Lefevre wrote:
If the functions cannot be changed, I suppose that completions based
on bash completers (I only know the qpdf one) should not be enabled
by default.

Or couldn't the function be renamed (e.g. compgen → _bash_compgen)
and when a completion is used, an alias compgen would be locally
defined to _bash_compgen?

aliases, like functions all share one namespace. so your concern would just move the `problem'
to stomping on a user alias.

If you as a user decides to use bashcompinit _and_ decide to create functions named compgen
or complete, problems will most likely occur, yes. once the problem occurs you can decide
if keeping those function names or using bashcompinit is more important to you and act accordingly.

If you as a user decides to use compinit, you most likely don't want to create a function named
compdef since that will also create problems for you, there is no safeguard from you shooting
yourself in the foot.
there are variables, functions and more stuff used internally that a user could inadvertently
change and break stuff, like the looping of directories with a variable named `path'.



But this still doesn't resolve the case where other functions
defined by bash completers could clash with zsh or user-defined
functions.

This is nothing new nor unique to bash completers though.






Messages sorted by: Reverse Date, Date, Thread, Author