From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26022 invoked from network); 1 Sep 2021 15:17:59 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Sep 2021 15:17:59 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1630509479; b=JRtyTBzPYR9DwGsNTDqQ4Is/rEitV/eP8rwsx6qhQiUSaEIOUqgqx3WYo0zIvcgDMudLKVYhPd f3pkkKKrrlJlXtohAt005ObJ1iXYcHzJkJ8EQU5Hcdu+1qL4bgqeiO7He9Bb8sZ4yLiHawd0UV 9OyfOY77L77MSVKg+WRHdDOgcAy8M+weZT8b+Zj3u8Byb1M8HYtIeDay2DSWVJ76Ivyu39xM1Y Q9LjQwf3uwA6BLItsAXyTCHvKHfkQxdAvI2eGzn0XLNJvur5cwE68Jh3o+T6Ocp7tRY++bjTl1 jxek5F3INIZtFzzuHzZIAhweM2lVjw8vCSeEAqJI52WajA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq5.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.100; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1630509479; bh=8GcdVUytW2bsxVDpgRzAnWyGSxl1SkJP8uPzuCBUGs8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature: DKIM-Signature; b=pIhwhaNHQTq5vV/V69UP5iy7/pAncc4srqFILK871mVW0SuQxgk260Ki3oSVGH5yzqEeim1bj7 /8zykKDHYctVDUVoNcY6uSW2cVsrLXL/pP5qfd5IUS7AuFN7LSeQCt27TnymCH3pJPEfX5Hb0I 1m4oDBgy6T0V0WvMdq/PArBAnhmtlH2QOxV52ADIxrS9NElXc04mRTPlBZUHSJc7eEkHwLIcvv GG3f8+r0H3tZN5FBwKy7MtNvN2Sskgjo7ejpFjZFUCZPWqB9pZN4XMndyaVMmR/HyaPj7ZDy4t wAxy3cc6P7Rfo2+2u+NjGeqOMH29fM/GcAyOX/vGahnuIQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=GIQDw3B04Oq2JvE3+aBQtQdKeKdkW+fHyVS/dohPNgY=; b=mB9+gHdNB6JBOWKPDrsmAJV5Fd ubK2ogNwMsv4bXxNyYUHONpienEmRw7D7BMWA8D0xvTf4DG1RhkRz0tsp7hmM42iZQ7IU7xZWfZ0d OshHqgxi1/B2u4KzTMPFHy5qnz1hwWPtCtJ29P/yKecTULF1WY57CuTVARR4SpS4nLKFYXediQVpC fioJ+2U1bNN5E+54Jp61rC0gXlbelhHSn/XWl5JNDqGix+pvi5GRiZxLYnMQVs46oRu7kGfuRUq9j Kl9GPsc3HywEYW/CIqjqVh+jlkz+IIgRk0S7HonjoG9H0q47SPSVoBN73fwnjjnPccUk360ZZynmX aMFRXLoA==; Received: from authenticated user by zero.zsh.org with local id 1mLRzy-000Pc6-46; Wed, 01 Sep 2021 15:17:58 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq5.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.100; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq5.tb.ukmail.iss.as9143.net ([212.54.57.100]:54814) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1mLRzO-000PLH-7M; Wed, 01 Sep 2021 15:17:23 +0000 Received: from [212.54.57.80] (helo=smtp1.tb.ukmail.iss.as9143.net) by smtpq5.tb.ukmail.iss.as9143.net with esmtp (Exim 4.86_2) (envelope-from ) id 1mLRzN-0005IV-S5 for zsh-workers@zsh.org; Wed, 01 Sep 2021 17:17:21 +0200 Received: from oxbe8.tb.ukmail.iss.as9143.net ([172.25.160.139]) by smtp1.tb.ukmail.iss.as9143.net with ESMTP id LRzNm9SCAhdxkLRzNmxR0k; Wed, 01 Sep 2021 17:17:21 +0200 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 172.25.160.139 X-CNFS-Analysis: v=2.4 cv=Ru2mkAqK c=1 sm=1 tr=0 ts=612f9981 cx=a_exe a=pgSR3NrKiwmx/6vnWRL19w==:117 a=sfM75MaK4YAA:10 a=IkcTkHD0fZMA:10 a=2y5beTJ5bSgA:10 a=N898d1J4AAAA:8 a=rEcfGBTc-Xguoxg4Qu4A:9 a=QEXdDO2ut3YA:10 a=4OhKILdWXy8MGewZJRtY:22 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1630509441; bh=8GcdVUytW2bsxVDpgRzAnWyGSxl1SkJP8uPzuCBUGs8=; h=Date:From:To:In-Reply-To:References:Subject; b=daZ2mMGegBOS1z01nPBmN/DW/aSY3mYE4qRuZG2oev1h9gGEhA5U7EeHDWGRumYxU vOFZRb+EwcJ81HiqletZ19InB7R7A+piApgPQqLD74T8irck57ygC1gZsqCVhHtAKF S3i1MwW/5+Y1dTG7p4wYIc2EOHN90XWtL9DB1HjT78NHawvqcUfyW7tok7XhMJ8kKH fb6hdjT/zlm26zf1FDxGb1O+b13XRfc5uRZCcFRmbzcc/Lr5lU37TQHC0/FNlOu5oU Me6BMn55exmPFdVRGI8qa0uAecuMOXO+qNmBufytG1b9FMmlZHiHL03ISIFCUb5Vqy S1YVOmQU3uayw== Date: Wed, 1 Sep 2021 16:17:21 +0100 (BST) From: Peter Stephenson To: Zsh hackers list Message-ID: <1399787045.1301253.1630509441777@mail2.virginmedia.com> In-Reply-To: <20210901075543.7v2vd4vk47qw4yrr@chazelas.org> References: <391FB007-1453-44CF-A990-280C59750F65@twistedmatrix.com> <20210831060354.srascacw2zk35cnm@chazelas.org> <20210901075543.7v2vd4vk47qw4yrr@chazelas.org> Subject: Re: bug report: INTERACTIVECOMMENTS option interacts oddly with shell functions in an interactive context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev72 X-Originating-IP: 165.225.81.118 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfJcOUgGhFWs99wKBd1m6YWAsXV4zqfJHOtiTcAXIMvv15fy/xNpNFwEtFtQwfsQPeLmg4Ywkl1wJ5eNmybu3NjWEh3dtAlkbNHR9okPxawbwDZ4Lm995 5xZAUlSQNWJ416kFt7kvSE/FjWCODyej7B1BTcgyxMfK11xgMUoi306RPJ8lm8hjhjU3aq7puOHkns6aYeR3jU3Y6pWuormxo8SNkWE1NScAoJOLG9o/1PfM X-Seq: 49353 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: > On 01 September 2021 at 08:55 Stephane Chazelas wrote: > So here, I'd say: > > ~$ cat a > echo foo # comment > echo $( > echo bar # comment > ) > ~$ . ./a > foo > ./a:3: bad pattern: # > > is clearly a bug (regression). Yes, that does seem pretty clear. Looks easy to fix and test. Is there anything similar to source that might require attention? I couldn't think of anything --- source looks like the only case where we deflect the input from another file without starting a new shell. pws diff --git a/Src/exec.c b/Src/exec.c index 79d8064b6..1f23a862d 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -4622,7 +4622,7 @@ getoutput(char *cmd, int qt) char *s; int onc = nocomments; - nocomments = (interact && unset(INTERACTIVECOMMENTS)); + nocomments = (interact && !sourcelevel && unset(INTERACTIVECOMMENTS)); prog = parse_string(cmd, 0); nocomments = onc; diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst index 88fc8606e..c114ff103 100644 --- a/Test/A01grammar.ztst +++ b/Test/A01grammar.ztst @@ -944,3 +944,12 @@ F:Note that the behaviour of 'exit' inside try-list inside a function is unspeci if : ${(e)a}; then echo x; fi 1:Status on bad substitution in if without else ?(eval):2: bad substitution + + echo 'echo foo # comment + echo $( + echo bar # comment + )' >source_comments.zsh + $ZTST_testdir/../Src/zsh -f -o extendedglob -is -c '. ./source_comments.zsh' +0:Comments should be handled in command subst in interactively sourced files +>foo +>bar