complgen
complgen copied to clipboard
[FR] <PATH> behaviour inconsistent with non-complgen path completion
<PATH> completes paths in a basic way that isn't identical to path completion for commands where completion isn't made with complgen. I'm using zsh. It ignores zstyle settings related to e.g. ignoring case and adding a space after filename completion.
As a side note, I see that _path_files
is being called in the code so I tried redefining <PATH>, e.g. for ignoring case:
<PATH@zsh> ::= {{{ _path_files -M 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' }}}
The -M flag seems to be ignored. I'm able to have other flags work, e.g. -F for ignoring patterns. This might be an issue with my setup somehow and not related to complgen.
Thanks for the great project btw, I'm playing around with a (very heuristic) help text parser that goes well with this.
I appreciate reporting! Will definitely take a look as soon as I find some time
Could you please post the output of complgen version
and the minimal .usage
file that triggers the behavior? TIA
complgen version
0df6f4d9a1
And simply a file ~/.config/complgen/minimal.usage
with contents:
minimal <PATH>;
I just double checked to make sure, and without the file minimal <TAB>
completes file ignoring case etc. (default completion for unknown command is filepath, at least in my setup), while placing the file completes it in a case sensitive manner.
Hope this helps, I can provide Zsh configs if needed.
Hi, sorry for a late reply.
Are you using JIT or AOT mode?
Adding completions under zsh ultimately boils down to calling compadd -A
, so it should be respecting all zstyles.
Perhaps you would be willing to contribute a test case for this issue? Tests under e2e/zsh
are a starting point JIT/AOT, depending on your context.
Thanks for the great project btw, I'm playing around with a (very heuristic) help text parser that goes well with this.
Take a look at complgen scrape
-- I'd be very happy to accept PRs.