From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 80e88fff for ; Mon, 25 Nov 2019 16:43:00 +0000 (UTC) Received: (qmail 18745 invoked by alias); 25 Nov 2019 16:42:52 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44935 Received: (qmail 23937 invoked by uid 1010); 25 Nov 2019 16:42:52 -0000 X-Qmail-Scanner-Diagnostics: from mail-vs1-f49.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25642. spamassassin: 3.4.2. Clear:RC:0(209.85.217.49):SA:0(-2.0/5.0):. Processed in 2.53332 secs); 25 Nov 2019 16:42:52 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.49 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=mOcmG8lSnRwJVJEiguupPxafgZf5nJt8+rXSZ+11DHE=; b=UeMF7cNAnBVqfai9DFkznBk+Jedg3j215zzfUdbRK9jrmWlWnYlAbTNHtYxvIu12yY C8ZhHzfFSZfl7CoG8Xd0rKfhATzwGSLFPAgKRwB5JqPsXdhosx/vSCJxigWkF+QdkptJ KGMI+O55OP6DpxGxTKlDSyPhPevpA+3QEdtDseTp7lKr44CWeUosVJZ88+p95CjW8uz2 uBg8itp94uO0hjBLGHjGTnxeTfwAy4xh4idPxKDLLhs61m4yWwciNH6UNHu9O/TtVdpD Kyz6GHJzRDZ6hy4ErkhyZttUPnuCjGyriW7qQW/aeG4Oia0USOQqpbVRGDggyqVdKh++ ctSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=mOcmG8lSnRwJVJEiguupPxafgZf5nJt8+rXSZ+11DHE=; b=rJVIK7/d7N+gORRvNhKtExN6BKVkoH6KcB2WOSTK82kxoOfLVSeP6oCxrG4/Ruy1qH e9cCF9/74m0IptDtc/BwLK6g5X2ywbLHf68vCYSjUTkZM0x+aKTydzWvsTd21CyOkYWt 1JFlecHniwN/mAu3P57NdU79V6oGEM0D+oMIT7OMGz7NFp86DMKEIx8Dc+Gnt9bgJD59 cwmwIvTRO4U8XAa1nvzDrBNsR1kaHfjQCbeJkS4f9hblIUpmGAqrtBEUlmej3QXR5WAH ZTmV1PPN0POLPWPofdEXFske8O1KFrrWFW7PcuBqn2HGHisRhG3Z+MPqZKC2fJIIBnjR W1+g== X-Gm-Message-State: APjAAAVuGAyGlssb2FiXi1kBquiOQO1wBKRI7VcXoyekshcoZwghVOWV kaYyYW+1liWjywo6D4rwlWAq0MEifHNgb6C5TOg= X-Google-Smtp-Source: APXvYqxSGflhzmArbxTDpIw/eCVSlGWR7jwf9TNrzsi6R4rE+Ar4UcmS2hgKz+DQVdhObxa/dRybYWUDQ/fGweGWNPE= X-Received: by 2002:a67:ce12:: with SMTP id s18mr18576472vsl.77.1574700136222; Mon, 25 Nov 2019 08:42:16 -0800 (PST) MIME-Version: 1.0 References: <3859b4bf-08ba-62d5-f00a-3ec4e67caf95@inlv.org> In-Reply-To: From: Sebastian Gniazdowski Date: Mon, 25 Nov 2019 17:42:09 +0100 Message-ID: Subject: Re: Bug with traps and exit To: Martijn Dekker Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 24 Nov 2019 at 23:52, Martijn Dekker wrote: > A related issue (possibly the same?) with a much simpler test case: > > trap 'echo SIGINT; trap - INT; kill -s INT $$; echo woops' INT > kill -s INT $$ > > zsh prints 'woops', but shouldn't. One thing =E2=80=93 this one doesn't reproduce in the exact sense =E2=80=93= either from the command line or from a script. Second =E2=80=93 however, this prin= ts the "test": trap 'echo SIGINT; trap - INT; kill -s INT $$; echo woops' INT kill -s INT $$ print test when run as a script or from command line. But I guess that the default INT trap is a 'return' which doesn't cause the shell to exit? This isn't stated exactly in the manual. --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org