Zsh Mailing List Archive
Messages sorted by:
Re: Help Request/Bug Report: comparguments causes _arguments to fail in certain cases
- X-seq: zsh-users 24852
- From: Dan Arad <dan1994@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Help Request/Bug Report: comparguments causes _arguments to fail in certain cases
- Date: Mon, 18 May 2020 09:20:49 +0300
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAH+w=7YBwZRQjg3J=PYdzwwSN8RPGfm-DGO-cERJOa8rad2hiA@mail.gmail.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- List-unsubscribe: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAPPzoJDB3jB7pHUfE7UjY09OHk+r_pgLeYxuaoXhMFGHf-3UCQ@mail.gmail.com> <email@example.com> <CAPPzoJDyK35bSMTyYKovEbRZNhDpKs1aeY2ZRjzBTxgdgCuGww@mail.gmail.com> <firstname.lastname@example.org> <CAPPzoJC6MYg8CEqsmLRPvPRYPLYP+dJxA4BCR0Cue6xTdZ9Q9g@mail.gmail.com> <email@example.com> <CAPPzoJDeGo_gzn9DFCv1Zd=m6bDO34AK1K-KSmxwu-9mQHcKtg@mail.gmail.com> <firstname.lastname@example.org> <CAPPzoJD-DqObF630EAF63Ptn-=ftiEmnywSb-w6KmfhBQ7DCkw@mail.gmail.com> <email@example.com> <CAPPzoJDL_vpLHe5iNgiNP6desAt_SmwEHLurY0W-JN4YrwqvbA@mail.gmail.com> <CAPPzoJBWJ8-yf1f-3ibP2BrJLOgy5k0=YiUf-B=763EKLHFViw@mail.gmail.com> <CAH+w=7bOUOqR3jcsfR4ajxb1COE=mngR3WhSo0iUF9xXMJpidw@mail.gmail.com> <CAH+w=7YBwZRQjg3J=PYdzwwSN8RPGfm-DGO-cERJOa8rad2hiA@mail.gmail.com>
Thanks for the great clarifications! I'll try to stick to the correct
This isn't happening because of an unknown command, it's because the
> historic behavior of _normal is to return all files when none match
> the specific completer.
However, nothing will have been "compadd"ed by _python at the point at
> which it calls _normal. Anything that gets added is being added as
> consequence of calling _normal, not as a consequence of calling
I suspected as much, but I'm new to zsh and completion, so I had some hard
time following the debug logs and figuring this out.
> _python "$@" && _compskip=all
> compdef _python_or_script python
This works like a charm!
The only thing I did different is to use the `#compdef -p` form at the
beginning of the file so I could give the same pattern as that of the
> and not before. I also use `_compskip=all`
> That doesn't actually do very much once you are beyond -first-. It
> aborts the current level of _dispatch but doesn't prevent the outer
> _default that called _python from continuing on into -default-, which
> I think you'll find to be the place your extra matches are coming
This `_compskip` prevents the inner `_dispatch` from calling the
`_python_script` function more than once.
An example I've seen, is with the command line `python .vscode/ps.py` (I
use the .vscode directory as a place for temporary files as it is git
In this case, without `_compskip=all`, the inner `_dispatch` calls
`_python_script` once with `service=.vscode/ps.py` and once with
In my case this doubles the time to produce completions which may be
critical depending on the way the user has written his script.
To conclude, I would really like to thank everybody who took part in this
This is my first open source project, and I was really hoping to provide a
good user experience.
It was a great experience for me to have such a productive conversation,
and I really appreciate the time you've put into providing detailed answers
in a welcoming manner.
Have a great day!
On Mon, May 18, 2020 at 1:14 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
> On Sun, May 17, 2020 at 3:12 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
> > aborts the current level of _dispatch but doesn't prevent the outer
> > _default that called _python from continuing on into -default-, which
> Typo, that should say "... the outer _dispatch that ..."
Messages sorted by: