Subject: Re: bug: suffix alias and tabcompletion
From: Bart Schaefer <[email-masked]>
To: Zsh hackers list <[email-masked]>
Cc: Michael Gebhard <[email-masked]>
Date: Tue, 21 Jun 2016 13:18:21 -0700
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Tue, Jun 21, 2016 at 12:39 PM, Michael Gebhard
<[email-masked]> 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.