Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: sudo autocompletion
- X-seq: zsh-workers 45411
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-workers@xxxxxxx>
- Subject: Re: sudo autocompletion
- Date: Mon, 10 Feb 2020 17:40:58 +0000
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200210174100euoutp026cd8c2d532ca11d375f5624d3bd9c54b~yG1KLzozi2980029800euoutp02H
- In-reply-to: <D0BDD1BB-192E-4D50-A0D2-0BB54388B9B9@dana.is>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <912d22db-8a8f-90f2-6738-f9f395994dcb@gmail.com> <CAN=4vMqvzUTZ7bBLcbTzi-pKAVEP1xDbq=f5pLAxmffxUjTszQ@mail.gmail.com> <1770be62-54d8-70a6-8b05-cfc98faa9b9f@gmail.com> <20200210030219.527a3ccf@tarpaulin.shahaf.local2> <ADE72275-1311-44BE-9B1D-5E617E3D9F94@gmail.com> <CGME20200210171445eucas1p17c3b4786bbca6f7486ce82416d5d3a15@eucas1p1.samsung.com> <D0BDD1BB-192E-4D50-A0D2-0BB54388B9B9@dana.is>
On Mon, 2020-02-10 at 11:13 -0600, dana wrote:
> On 10 Feb 2020, at 01:52, Andrey <butirsky@xxxxxxxxx> wrote:
> >
> > Thanks, will try it. How about to include it in distribution by default?
> Would this be too cheeky?
>
> There's not much precedent for this sort of thing (just cache-policy), but i
> don't think it'd cause any issues, aside from showing too many commands in
> some uncommon cases...?
>
> + zstyle -t ":completion:${curcontext}:" command-path ||
> + zstyle -e ":completion:${curcontext%:}:*" command-path \
> + 'reply=( $path ${path/%\/bin//sbin} )'
I think it ought at least to check if the /sbin directories exist.
Possibly they should also go in front of the path --- that's one of the
points about "secure".
On the issue of setting the style at this point --- the usual behaviour
is only to change the default locally rather than also set the style, but
that's probably difficult here, so I don't think it's a particularly big
deal.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author