Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] Another alias-related crash
- X-seq: zsh-workers 43513
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [BUG] Another alias-related crash
- Date: Fri, 21 Sep 2018 15:39:16 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=SrM1b2 vpfbALdiYmWXkI1BfJsS4AtbKNCN9OrxY7rr8=; b=OlTrYj+h9gL4pSE87Jxw+p tRiOVfheGBaZ99T6l8SPaIBnsHXWNU81Lct59OPAo2Ixx8kQIsKl1tMFvn61X97s dwK5UwrkRnN2QZvBCgUJRLCMVr2IAKb1H6ajt6Qq1s/fihE3yZjY/XlIBFka7OYi 31CTQ/lZUWv35CdE1QrTScdq9CnZ29CEEgFb08z1WerHvulb0v11azbEjt6YFcsV N/p0wUYZiPnf9/uIGp+afmc9pcDb6bXzKaDPEaSy131WQ3BvuY8OC3beQII9+QoF MF8qEVheI4lmxIqzUTI5ddzd+87WRcw6g1KvO2JoD8exBYRrx8j8e/O4t7H8f0Ug ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=SrM1b2 vpfbALdiYmWXkI1BfJsS4AtbKNCN9OrxY7rr8=; b=CiUImOPb3mW+8Stfo8BHPQ 6KcZxAfRQ+NG2dK0vZNhocCYtp0MLYpp82DUq1cs8LpBsx4JjAjAKt9p1fyG6NTH SdVQoxw+Lg5T5u1Q3Wa04vRWleTpSlyHCuIRV76aec4k/3jQSEaq9/AbNtuu4ruc eJDQvqzgsnTpNOwUlAuUiiUFCD285dGkr5VkiUQyYQfMPBtYiozbcte1Eb2hPjds ocolChwuSZYNbn7gCWvIsqspDWkgNsdp2sOefXYJA62D5X9bXYzuP5foNqNMxnxj HaqETwpTxpqO8nDqSZjlXdXXBym/qIJmVTnyVIWbPkIrvnSZM2xNcG0jrm5XU1JQ ==
- In-reply-to: <20180921161448.13b5b94a@pws-HP.localdomain>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <FF85A7CD-EA83-4B5A-A74C-310F2ED80DBB@dana.is> <20180921161448.13b5b94a@pws-HP.localdomain>
Peter Stephenson wrote on Fri, 21 Sep 2018 16:14 +0100:
> This code is particularly complicated owing to having to decide between
>
> $(( $(echo stuff) ))
>
> --- mathematical evaluation --- and
>
> $(( $(echo stuff)); more stuff)
>
> --- command substitution with a subshell inside, which as far as I can
> see is valid syntax. Although the alias bug isn't directly related, I
> think it shows up here because of the particularly active use of the
> input stack while the shell is deciding what's going on.
>
> Would strongly advise NOT doing completion in that sort of code.
Can we *prevent* completion from being used in such code? I.e., detect
that we're in a Schrödinger's «$((» and simply error out without
attempting to figure out what syntactical position we're generating
completions at?
I suspect that would be non-trivial (since IIRC completion and the
parser don't talk much to each other), but if it's possible it sounds
like it'd be an improvement.
> The resulting bus smash of hard to understand bits of the shell could
> make the quantum vacuum unstable. (Sort of "off mass shell".
> Physicists' joke, sort of.)
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author