Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bug report: INTERACTIVECOMMENTS option interacts oddly with shell functions in an interactive context
- X-seq: zsh-workers 49362
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: bug report: INTERACTIVECOMMENTS option interacts oddly with shell functions in an interactive context
- Date: Wed, 1 Sep 2021 19:23:24 +0100
- Archived-at: <https://zsh.org/workers/49362>
- In-reply-to: <CAH+w=7Yow7Yaage4oE551W5LWCEE4PL-aTFPcv0zkTEGSowHHg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- References: <391FB007-1453-44CF-A990-280C59750F65@twistedmatrix.com> <CAH+w=7YptHhCC5__MK4LqGMYS1UEoU92jWheG+mp-UXRenVZgw@mail.gmail.com> <20210831060354.srascacw2zk35cnm@chazelas.org> <CAH+w=7Z8rhQA_N_Ui+YQezDSWAa4Ro_4fsrNdjz6ZCz+SE3cKQ@mail.gmail.com> <20210901075543.7v2vd4vk47qw4yrr@chazelas.org> <1399787045.1301253.1630509441777@mail2.virginmedia.com> <CAH+w=7Yow7Yaage4oE551W5LWCEE4PL-aTFPcv0zkTEGSowHHg@mail.gmail.com>
2021-09-01 11:09:33 -0700, Bart Schaefer:
> On Wed, Sep 1, 2021 at 8:18 AM Peter Stephenson
> <p.w.stephenson@xxxxxxxxxxxx> wrote:
> >
> > Yes, that does seem pretty clear. Looks easy to fix and test.
>
> I'm not sure it's actually all that clear. Consider the original case:
>
> % alias '#x'='echo The X Factor'
> % source =(<<<'echo $(
> #x is not a comment
> )')
> The X Factor is not a comment
[...]
That's sourcing a script, same as source =(sed '/end/,$d' script)
so the stripping of comments should take precendence here IMO.
Note that zsh still strips comments in
$ cat =(echo foo # comment)
foo
$ eval 'echo foo # comment'
foo
I wonder what the original intention was for not honouring
comments when run interactively. That doesn't sound useful to
me. Was that to mimic csh?
I find that much annoying when copy-pasting code at the prompt.
It feels wrong to break the shell syntax to accomodate weird use
cases.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author