Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID
	autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=brasslantern-com.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :cc;
        bh=LRgmh2x3YIfyc/ifDEl6Lwo/A8W/9yKZEsaUGxsFuZQ=;
        b=ySLGhIXrg+b9UmAyTkyZpg2ZZbR8AK4WZJyP17++vsc+ADJAkqELcr8OhYkTJ2xsV/
         fWoUouriG6ppGeyD3g3r/QUkVlobL7oqOTrZkxC5Av3HkVoPe7ucQ/jXds70WSo26kDP
         9W4BdU6Wouv+fRi35iy57i4xJg8nxOcBYBeFS5zSu9iQ94YH51e53WuFzSLjpem/1Itx
         pPNwva0++xXFg8Kr8AduggKEEBCSy7OWnQKEF3//RXwiUu9FqAcDLWUiI7ieZIsJTtee
         gnYB4apOKMD9fG6KXJyh3uLGXPIwYdxAJDe7/tU8z8QOHG7CmDwh3PGQRmNi5ZTTFHhY
         y/8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:cc;
        bh=LRgmh2x3YIfyc/ifDEl6Lwo/A8W/9yKZEsaUGxsFuZQ=;
        b=MCkIOiYdarLwtVijn5uYt+GLcqvSOTPyN6qxZBmYa7mN/+Rk8wamIFmO03YVS2xsXb
         a9ZmBTKHnr73kuglgYi7ynu3QUxu03nbfStTW/O0doWj83kdjpH8uVCrzy+iJIFGhgpp
         hcAvnfIH6+3CbA52uYgEz3L/KvcPR8Zq2r6MAcpnHTk4jsWsxN7/CuI0uSXzL8cUHsIj
         aLbiU7HDw/fQP0bsQvgHXqT41kQEnoEBVEWBIxQnobHfygEpA8D96d9eogXweQKzY5qi
         CJAJM70+yYfDQaBPhreEji/bPAZbUnmB3pruupEut8ARnttGMGbVcp4JiQuCBW0IiEzB
         EXvg==
X-Gm-Message-State: ALyK8tKB4zn4NRVle4p5ZvP5T2ydBMmjiF3CmeqFADMt2xBcYwbtrURlItV+RxQhRaZ/9YM+ilkQdvIzKG67dg==
MIME-Version: 1.0
X-Received: by 10.25.159.8 with SMTP id i8mr7919447lfe.74.1466540301276; Tue,
 21 Jun 2016 13:18:21 -0700 (PDT)
In-Reply-To: <20160621193918.GA3768@fau.de>
References: <20160621193918.GA3768@fau.de>
Date: Tue, 21 Jun 2016 13:18:21 -0700
Message-ID: <CAH+w=7YdV_LFUghpueqbjRHWyhzEA8iDarE=FGG1BSk2Fr+s0w@mail.gmail.com>
Subject: Re: bug: suffix alias and tabcompletion
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Cc: Michael Gebhard <michael.gebhard@fau.de>
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 38739

On Tue, Jun 21, 2016 at 12:39 PM, Michael Gebhard
<michael.gebhard@fau.de> 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.

