Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion within a function
- X-seq: zsh-users 26306
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: completion within a function
- Date: Sat, 2 Jan 2021 18:07:38 -0600
- Archived-at: <https://zsh.org/users/26306>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-01/CAMP44s3NufsNkdC5qkcGuGz5D5oQhvAfnT2jS-5gCRtgtjG1%2Bg%40mail.gmail.com>
- In-reply-to: <CAH+w=7bZXGvVqeftVn4FnPd+G9Y5tm+YU6yV9wkgE1vXTEVLKw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <c9416d92-29b1-68e5-e51e-d7152f1fbc4b@eastlink.ca> <CAH+w=7bT5GaGvWih=A8KCyUe4N6k25VxDLcpPA5C1yGn38Zimg@mail.gmail.com> <819ec6fe-5af2-2e97-c5bb-f434b1de86d7@eastlink.ca> <CAH+w=7bSbhdHGC89daK+8o0psLhdw969=GviC4s554t37_zrDw@mail.gmail.com> <520ce98a-4394-726d-3d12-8ef414e881c9@eastlink.ca> <CAN=4vMquijkmnETv2xUdnpGcJoQPaimXT1+i+daHoivLmpK+TA@mail.gmail.com> <f490bbd8-dc96-341d-e11b-a5d957c9268e@eastlink.ca> <CAMP44s13tqgmNgUcuAxUJyJ_LGjDSEE1FJ64k2r12UogbW0r0w@mail.gmail.com> <CAH+w=7a+9_jX8xkvKjCVhQWXQMqQkWvahHyzTj=Lm_DgC=o5kw@mail.gmail.com> <CAMP44s1KT0B-wGmEndZUW2xkh8t-mawKA3y5yaqAH3GjiEXuCA@mail.gmail.com> <CAH+w=7ZqpLfuoqdJ1yRRDR37DHLK5oOQP+878yaWA+M119QdhA@mail.gmail.com> <CAMP44s3qy8OToPuV9DH2fnU=eDYuZYFGmvoDUdmexdCYC_FpSg@mail.gmail.com> <CAH+w=7ZYcLH0DhnDMTGGKE1VFCVT15K0RFpDbQvZH_EvD1ywHg@mail.gmail.com> <CAH+w=7bL1RodoTiNQykLESwK5v3ppGYs_AG-bGcgPqnf-kC_Cw@mail.gmail.com> <CAMP44s3LE2ccjgB9mxjZNifUX0evDhgUSh9oWpNM3GDgM0DwVQ@mail.gmail.com> <CAH+w=7bnFjxfriMt-BVau66A3OZGUdKcbCDXX8G3pD_i=_+kTQ@mail.gmail.com> <CAH+w=7bZXGvVqeftVn4FnPd+G9Y5tm+YU6yV9wkgE1vXTEVLKw@mail.gmail.com>
On Fri, Jan 1, 2021 at 6:27 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Thu, Dec 31, 2020 at 1:25 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> >
> > On Wed, Dec 30, 2020 at 5:04 PM Felipe Contreras
> > <felipe.contreras@xxxxxxxxx> wrote:
> > >
> > > With that I do see the output. There's some garbage in it, but it works.
> >
> > I'm curious what the garbage is? Maybe something needs redirection.
>
> Ahh ... because it's zpty, the cursor movements get captured along
> with everything else.
Yes, that's what happens.
> That's a bit of a monkey wrench unless all you want to do is display
> the result. Hmm.
In my particular use-case I just need the list of completions in some
format. I use one per line because it's easier on my tests:
test_completion "git checkout " <<-\EOF
HEAD Z
branch-in-other Z
main Z
main-in-other Z
matching-branch Z
matching-tag Z
other/branch-in-other Z
other/main-in-other Z
EOF
That way I can test the zsh completion system of git-completion the
same way the git project tests the bash completion (I initially wrote
the tests for that too):
https://travis-ci.org/github/felipec/git-completion
--
Felipe Contreras
Messages sorted by:
Reverse Date,
Date,
Thread,
Author