I have CLI scripts that complete themselves (complete -C SCRIPTNAME SCRIPTNAME) written in Perl. When doing completion, bash-completion.el seems to call a script multiple times and without COMP_LINE and COMP_POINT set, making completion fail.
In the example below, I am using the remove-pdf-password script, available from CPAN (https://metacpan.org/pod/remove-pdf-password).
I have enabled logging in my script to see environment varible. When in bash:
I have CLI scripts that complete themselves (complete -C SCRIPTNAME SCRIPTNAME) written in Perl. When doing completion, bash-completion.el seems to call a script multiple times and without COMP_LINE and COMP_POINT set, making completion fail. In the example below, I am using the
remove-pdf-password
script, available from CPAN (https://metacpan.org/pod/remove-pdf-password).I have enabled logging in my script to see environment varible. When in bash:
will log this line:
When in M-x shell, doing the same causes this to be logged instead:
Relevant lines from output of M-x bash-completion-debug: