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 5312116f for ; Wed, 24 Jul 2019 06:29:58 +0000 (UTC) Received: (qmail 21403 invoked by alias); 24 Jul 2019 06:29:54 -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: 44571 Received: (qmail 22675 invoked by uid 1010); 24 Jul 2019 06:29:53 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua1-f46.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25517. spamassassin: 3.4.2. Clear:RC:0(209.85.222.46):SA:0(-2.0/5.0):. Processed in 0.814057 secs); 24 Jul 2019 06:29:53 -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.222.46 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 :content-transfer-encoding; bh=sUyfFL2ejQfVIuOvym0ZfQyhkyxQeSfXket8EPhSOLQ=; b=b2sVcWcv3dkBAg516hsgvptAjWgbiTT1MxVOyEk//+5b8T0Qy6egamCduGlDgeVB+S sRLh8sFbmnBOJx7pdUuNFqaWgi7TN0Dxh0l5o2wK1ZJnUU7EK4bekwYttEFelcIfLbNC H56XYzxsLivbMLX4fb8n3Ta5wdQGM5Ab/gf0Wb9Ptgawgvcru+FQfVIEjFp1LXr9sC+H HcsjWLAVhaFc+PxnUoZifbGhtKdb1qLZmQrbPdSUkNippCxz5hghrtqorf1ViVXHcqs1 +LFwqZS8Nt9ezvzXZUZLBmvgm92eMTfxe1Den4CKt21SLAuMUEpVXGtgu5KuI+D9ZtRY o90g== 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:content-transfer-encoding; bh=sUyfFL2ejQfVIuOvym0ZfQyhkyxQeSfXket8EPhSOLQ=; b=M4kfBjKUSa2GgOtl36miHNI09GJ0AgW+TIpOZq68Pv1x119lhC566HSYwh669yqNX2 61TNIIbXvmGFCBhd2vBPKnV4zrfGV7JZA4N7s+kk118aMj2RK6HPyhqhJvYL2BLcm8Yg HZJBITQZCJxqP+y0ZIcnJF0AfyW1MDodIt81THeqLOghn+439tYPKqmg/PrqqwtzzOD6 jMVbbrwxtPQYkAm/tpDc3eH5kzidOMq8ZCHs44SoIPoAdo60LVRt3+AsDFsc4zwA+KJ/ RJCNckNL65HyzW0PXm3z6rIHyliaJMimS1qB9etjeuMoyNA+Zi+phMGfxkrWtvUnVx7P snBA== X-Gm-Message-State: APjAAAXWF6rM8f1yd8LEy9BFSP+yxXSatRawDHCNbu4qjnWtm0svtj/l xX6qOApPezPmlJjBgGBepuRYDtTiBbwmwnLuyga6J8DZR40= X-Google-Smtp-Source: APXvYqy9XnrKhJUcIrHOJv7RF3BMlVuvHD8hDAdX9J1Ed8SGjdkH/gH5A+DO01W3SDXapw1yp1q30egN4aAkiGjHUfg= X-Received: by 2002:ab0:18a6:: with SMTP id t38mr17296421uag.83.1563949759885; Tue, 23 Jul 2019 23:29:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Wed, 24 Jul 2019 08:29:08 +0200 Message-ID: Subject: Re: How to restore $? AND $_ ? To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable False alarm =E2=80=93 Zsh pushes the $_ values onto some kind of stack: () { : test2 } test1; echo $_ test1 so appending $_ to the sched's argument is sufficient. On Wed, 24 Jul 2019 at 08:20, Sebastian Gniazdowski wrote: > > Hello, > consider the following: > > sched-fun() { > # UND=3D$_ > local ret=3D$? > > sched +1 "sched-fun \$_" > > # : $UND > return $ret > } > > The point is that the 2 commented lines must be run in the same place > as the next lines after them in order to work. No way out of this > problem? It is about not disrupting user session with background > tasks, I think that this is in general important. > -- > Sebastian Gniazdowski > News: https://twitter.com/ZdharmaI > IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin > Blog: http://zdharma.org --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org