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

Re: bug: suffix alias and tabcompletion



On Tue, Jun 21, 2016 at 12:39 PM, Michael Gebhard
<michael.gebhard@xxxxxx> wrote:
>
> running the following commands and trying to complete the last line
> by pressing tab produces a zsh taking up 100% cpu.
>
> zsh -f
> touch foo.bar
> alias -s bar='echo a &'

It's not (just) completion; attempting to run the command "foo.bar"
produces a similar infinite loop.  The alias has expanded to "echo a &
foo.bar" which then recursively expands "foo.bar" (because after the
"&" it is in command position again) and off we go.  The "touch
foo.bar" isn't required.

Normal aliases have a safeguard against the alias calling itself
recursively, but that must have been overlooked with suffix aliases.



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