Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: qpdf or bashcompinit completion bug
On 2025-08-18 23:27:39 +0200, Vincent Lefevre wrote:
> Actually, this isn't correct either. With or without _bash_complete,
> there is an issue if compdump is used once one has invoked a qpdf
> completion; the following line appears in the .zcompdump file:
>
> 'qpdf' '_bash_complete -o bashdefault -o default -C /usr/bin/qpdf'
>
> This is due to the
>
> complete -o bashdefault -o default -C "/usr/bin/qpdf" qpdf
>
> from the eval line.
>
> Thus, in a new shell session, the completion command for qpdf is
>
> _bash_complete -o bashdefault -o default -C /usr/bin/qpdf
>
> But _bash_complete has not been loaded yet! So a [Tab] gives:
>
> qaa:~> qpdf (eval):1: command not found: _bash_complete
> (eval):1: command not found: _bash_complete
> (eval):1: command not found: _bash_complete
>
> What is the cleanest solution?
_bash_complete is currently defined in bashcompinit, which is
called by the "eval" line, but this line is not available via
the .zcompdump file. I suppose that _bash_complete should be
defined in its own _bash_complete file (together with the
compgen function currently also defined in bashcompinit) like
all the other completion functions; then it will be found.
Moreover, independently of the above issue, bashcompinit defines
2 additional functions: compgen (mentioned above) and complete.
Their names are likely to clash with user-defined functions.
Shouldn't their names start with an underscore, and even some
prefix like "_bash_"?
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author