Control: retitle -1 qpdf: qpdf zsh completion does not work on first [Tab] and 
issue with compdump

On 2025-08-18 21:07:56 +0200, Vincent Lefevre wrote:
> In zsh, for the first qpdf completion, I need to type [Tab] twice.
> 
> For instance:
> 
> $ zsh -f
> qaa% touch zzzz.pdf 
> qaa% autoload -U compinit
> qaa% compinit
> qaa% qpdf zz
> 
> Then if I type [Tab] after "zz", I get the bell. A second [Tab]
> completes to zzzz.pdf as expected. If I try again, this works as
> expected: only the first [Tab] fails.

This is because /usr/share/zsh/vendor-completions/_qpdf just contains:

#compdef qpdf
eval $(/usr/bin/qpdf --completion-zsh)

which sets up the completion command, but does not actually complete.

I've posted to the zsh-workers list:

  https://www.zsh.org/mla/workers/2025/msg00530.html

Bart Schaefer suggested to call _bash_complete. The following solves
the above issue.

#compdef qpdf
eval $(/usr/bin/qpdf --completion-zsh)
_bash_complete

However, whether _bash_complete is present or not, the eval evaluates

autoload -U +X bashcompinit && bashcompinit && complete -o bashdefault -o 
default -C "/usr/bin/qpdf" qpdf

so that compdump writes to the .zcompdump file:

'qpdf' '_bash_complete -o bashdefault -o default -C /usr/bin/qpdf'

while _bash_complete is not available by default.

-- 
Vincent Lefèvre <[email protected]> - 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)

Reply via email to