From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 529 invoked by alias); 11 Sep 2016 09:02:26 -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: X-Seq: 39274 Received: (qmail 22749 invoked from network); 11 Sep 2016 09:02:26 -0000 X-Qmail-Scanner-Diagnostics: from mail-qt0-f179.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.216.179):SA:0(0.0/5.0):. Processed in 0.156723 secs); 11 Sep 2016 09:02:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 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.216.179 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=iO0Bn4dXWEpQR2DMTDzpPTmSyOi3gqm0vPLh9Ynd6pA=; b=1H5xXPoH8i/RvwEeasXP8r67Eq+OlMDISdhmxHfotD3xE6g1fXi5ARLyIKF6ZJuDuu oY3TXTVn5ownx6udIXZ/JPqSYCC8YwC1ALyxiMzshxSJgQqUHV9A6vodRlUcPsx34QQ9 a49/mFVXnAa4sALwLNDQcVcWBYPh7kjuycwiCBY90NJjU+mkVwdxx35u8FPus289zFVh mCXnJEc0QcmqFDCdCIK5ScJvi4hDzS8wrO+acUEpoKkrhjAKfNsty09/RpgiBGci0wnl s1nS26quv754kjpMPcsBNqTg7B5lmxhIYMPsOFUqSwcAOJGJdQ+kDQdptIYARuGgbnJ+ MeHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=iO0Bn4dXWEpQR2DMTDzpPTmSyOi3gqm0vPLh9Ynd6pA=; b=lKSEHVgBSU1HzCgpomIqYzjNuPvd65EpuCSOD4xaYfh6hJYw3tATFzTjFNkF461JLO GWRF11+Nei2twE/Uch7C42dhLRe1bwBaSls9TqinPp9AwDHjOoir0h8nS6xjhZHc8seW G20ne8Z/jYOtQdOKatcsuV0UrRUw5zX/0cCY8e1o9JcRw+Fz2y8zCVzdWC3Kb42Z6pxI J1hpRMJaFS7gKv9EBOxCJk7kBK+tgiRLUk7taPkCZ8BFGqthEOor30kYqL1EUdEMz+IX j4z5p1mMusZomSDKNIRxLljqyrrJh3KZQ0Gsj8JQkKn6flh4UOTwGBwgBr323GfS+UuM 6t0g== X-Gm-Message-State: AE9vXwPybLlILR3EuuqXUQak554uoffA4C51qRRTuqkYWM6mW/QK1AtrIJmwV4JctehCPt3rSlOAYwsXnWKJow== X-Received: by 10.237.51.101 with SMTP id u92mr13627824qtd.2.1473584532020; Sun, 11 Sep 2016 02:02:12 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Sebastian Gniazdowski Date: Sun, 11 Sep 2016 11:01:51 +0200 Message-ID: Subject: Re: fc -ap -R stalls when called from sched To: Zsh hackers list Content-Type: text/plain; charset=UTF-8 PS. Thought that I could provide a minimum test case. However, following: myfunction() { local -a arr; fc -ap -R ~/.zshrc; arr=( ${history[@]} ); print -rl -- "Read:" "${(@)arr[1,3]}"; } sched +1 myfunction works fine... On 11 September 2016 at 10:58, Sebastian Gniazdowski wrote: > Hello, > I call function __convey_on_period_passed() from sched +1 mechanism. > There, I read an IO file (file used for data conveying). I use the > neat trick that worked for me in past, but not now: > > # Read input using history mechanism > local -a commands > () { fc -ap -R "$datafile"; commands=( ${history[@]} ) } > > Shell stalls for ~10 seconds, then continues with data correctly read. > Whole source with debug marks is here: > > https://github.com/psprint/zconvey/blob/001a5378177dcfdd0de388e19f5c7ca067c0a89c/zconvey.plugin.zsh#L174-L183 > > Asciinema showing the effect: > > https://asciinema.org/a/9mfxg2j1jcwvoo7tb5x6bagr4 > > Removing anonymous function doesn't help. Doing normal load via > commands=( "${(@f)"$(<$datafile)"}" ) does help. > > > The plugin is for: a) assigning IDs and names to Zsh sessions b) doing > "zconvey -n Devel vim ~/.zshrc" to fire up command on Zsh session > named "Devel" (not implemented yet, thus a manual print -rl -- is used > to fill IO file). > > Best regards, > Sebastian Gniazdowski