Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is there a way to complete arguments with brace characters without using backslashes or quotes?
On Mon, Mar 24, 2025 at 7:35 AM Trevor Avant <trevoravant@xxxxxxxxx> wrote:
>
> Ok that setting gets me closer. However it doesn't get me all the way there
A quick check with _complete_debug shows that regardless of compadd -Q
or the setting of ignorebraces the internals are assigning
_lastcomp[prefix]='a\{'
which won't match 'a{' on the command line when you arrive at the second TAB.
So what you need is something along the lines of
#compdef myfun
PREFIX=${PREFIX//\\\{/\{}
compadd -Q a{b
compadd -Q a{c
compadd -Q a{cd
compadd -Q a{ce
You might be able to use (Q) instead of the // replacement, but that
could unquote too much.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author