Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: completion functions not loaded



On Sun, Feb 12, 2023 at 1:08 PM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> On Sun, Feb 12, 2023 at 9:58 PM Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
> >
> > alias systemctl='sudo SYSTEMD_PAGER= systemctl'
>
> If you replace the alias with a function, it'll complete nicely.

sudo completion is supposed to know how to look ahead.  As written
above, the completion context is

tags in context :completion::complete:SYSTEMD_PAGER=::
    use-compctl    (_default)
    globbed-files  (_files _default)
tags in context :completion::complete:sudo::
    argument-rest  (_arguments _sudo)

The alias would work if it were instead

alias systemctl='SYSTEMD_PAGER= sudo systemctl'

Maybe this indicates need for a fix to _sudo




Messages sorted by: Reverse Date, Date, Thread, Author