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

Re: completion for aliased commands does not work



On Tue, Nov 1, 2016 at 12:33 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Oct 31, 11:12pm, Daniel Shahaf wrote:
> } Subject: Re: completion for aliased commands does not work
> }
> } Fourhundred Thecat wrote on Mon, Oct 31, 2016 at 23:47:21 +0100:
> } >   alias diff='colordiff'
> } >   diff --<TAB>
> } >   /usr/bin/diff --<TAB>
> }
> } Completion "sees through" aliases.  You'll find that with the above
> } alias, "diff <TAB>" and "colordiff <TAB>" behave the same way.
>
> That's actually not true.  You have to "setopt complete_aliases" for
> completion to "see through".  If for some reason you do not want to
> set that, THEN:
>
> } Therefore, define a completion for colordiff:
> }
> }     compdef colordiff=diff
>

That's actually not true, setting complete_aliases makes completion
treat aliases as separate commands. :)

-- 
Mikael Magnusson



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