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 540ab910 for ; Tue, 30 Jul 2019 21:46:04 +0000 (UTC) Received: (qmail 17939 invoked by alias); 30 Jul 2019 21:45:59 -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: 44611 Received: (qmail 4372 invoked by uid 1010); 30 Jul 2019 21:45:59 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f54.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25524. spamassassin: 3.4.2. Clear:RC:0(209.85.166.54):SA:0(-2.0/5.0):. Processed in 3.980258 secs); 30 Jul 2019 21:45:59 -0000 X-Envelope-From: roman.perepelitsa@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.166.54 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; bh=xcm2vBB3gEsxhrB8PtsxqEjzjcUrY7NN+Q5jXK0f0Wo=; b=ZT1db1VSx3gYYIvw7XmC71MjOYEsjjdKPpR5JrgjrwJKEIMcZHtByKx0Q+E6tsLaIO 26gEXxRrsnY+FM9nsqRYQHmkvUPS3/TEZxCX1SBVy+IvwZDTVSe82sGAser/A71XiiPt fwGATmSwmlpZ3KNzisIttLGDzNccJAaJ3qHmER+qHBrVvbDpSXkWd1TEg/qOxDCob0b1 p9vDCA6wl0mrpvZWsnBEKLXoernGmVgxAke3AMZxyOsXh1hDR1O/QTmjVfP2QFYrl7kS wQrZSj1YCZpCxT+ZFLINBaNHG5LwU/heL/l3+76leA5mwDwNxm+y0aCw9OdrkHFhtdX5 V8ZA== 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; bh=xcm2vBB3gEsxhrB8PtsxqEjzjcUrY7NN+Q5jXK0f0Wo=; b=j4iJWU4tYet/AXYL/y58dmASjJoeH3wUFfJdqRMCGAbsH3Xot0BkpaR7cIoGLR4Zm0 xcokFYDt7cslFIAdprjJ7T8/maA/N2UqezodNWzxHHr1WoRysHy6ChySkjE0AUrOmvv/ HYr62oS9uug0xqCxpVU/t7ftl0D/QRkeX4zCsI+ZYBa4nkk+1JtCiMC9TUJ4E3xBQoz5 1fNX0ZmVH6lJ4jRJ76WHsFsQ94/KUGdrK2sjxf4aJJ3SUW8ePoEzZhab3Nf7QgwmRafT EW1x7z+P22v5kbTJDPcw9a+eWGh1PeQSrdjBPimYBcwRBg+ZwpCMiv1NgTysb5kO13ld dKcg== X-Gm-Message-State: APjAAAVTqfIsJFhoxgWK8wm7WFOsdsQL86sB0hTTbweum4jrZQPi8052 tNTAOzdngPzJLGN3Pl8+0LHJyYDp4/oWJLWbvGI= X-Google-Smtp-Source: APXvYqwYaKdK/aEhU6aL3B8ECZM6/5ODJfNLtJJLtv4E5hKnLvZB429x7mE86SD3ubNgiDcNt8qnzaRnG3e9QHSPFdg= X-Received: by 2002:a05:6638:627:: with SMTP id h7mr92320871jar.33.1564523122920; Tue, 30 Jul 2019 14:45:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Tue, 30 Jul 2019 23:45:10 +0200 Message-ID: Subject: =?UTF-8?Q?Re=3A_A_serious_bug_in_execution_=E2=80=93_where_to_debug=3F?= To: Sebastian Gniazdowski Cc: Bart Schaefer , Zsh hackers list Content-Type: text/plain; charset="UTF-8" On Tue, Jul 30, 2019 at 11:38 PM Sebastian Gniazdowski wrote: > > On Tue, 30 Jul 2019 at 23:02, Roman Perepelitsa > wrote: > >> On Tue, 30 Jul 2019 at 20:28, Bart Schaefer wrote: > >> > If you change the [[ ... ]] && ... to an if/then, does the behavior change? > >> > If you add a "return" or "return $?" at the end of the function, does it change? > >> > >> a) yes, the problem cancels with if-then > >> b) no, adding one of the return's doesn't change the behavior > > > > I think Bart solved it. Do you have `emulate -L zsh` in your `zle` function? > > No, but adding it helps. Any emulation (sh, ksh) does. Aah, so this is > the errreturn option set within your plugin! and the if-then was > setting the return code to 0. A very interesting situation, having > your code called in foreign context, to know what options to defend > from. You should call `emulate -L zsh` from every functions that can be called by any code other than yours. It's almost impossible to write code that works the same way with all combinations of options. In my public code I also unset aliases. These defensive measures reduce the number of bug reports by *a lot*. People really seem to like creating global aliases with single-letter names. I'll probably start calling `disable -f` for all builtins I use. Roman.