From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18921 invoked by alias); 11 Sep 2016 09:22:09 -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: 39276 Received: (qmail 11722 invoked from network); 11 Sep 2016 09:22:09 -0000 X-Qmail-Scanner-Diagnostics: from mail-qt0-f181.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.181):SA:0(0.0/5.0):. Processed in 1.168666 secs); 11 Sep 2016 09:22:09 -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.181 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=c2Mlt6icrTlJlEk/UxY0cisJuaoGn/m6w5dcglk0s7Q=; b=OCE12tri2aapwWzZ7Eo+N50KnFGKtCjkxZsznlRNiGJqItVtNUZDad8kNNPc1Rb2FD ZL+yxlt4Fny2DKUsaBJX4GKdMkNnhpwqn099V9ZaO0TyGDV8N+j5Q4G+ohDZS5922DfN MnwQABYYTI3OpqYlg64aomz0RpbMQYRn/JBKpyizHBBvdFQaBV9B6m3K+8Xz3UdwUxJW JuAnJsis0l/fM9qGIzsxTS7xAAof4nR0VpK0/weuvYymTPpXjtz6wEIC8Qx3kqlJVWFA O+oIlRL7NWk2A9UXqhMn5hSnOxHj3nPMtZJZJKqbH0+PKbqm5EmLZrJSX3Oji9x5hN4m Myjg== 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=c2Mlt6icrTlJlEk/UxY0cisJuaoGn/m6w5dcglk0s7Q=; b=SHBBFrItKVDGGRHKi3kdc8qIsG7QPwQ7OM0+wLJ4omp0764a8jF7L75DbJmGgJGkCb ep9XzdU0z2tsErHjyBFux7rJuTYnG0cRwdX1wCjDKFW0Se7jkYmSg0lz8Zrwtc6x14Ka IHB2i5l4E+Dh1zwXuehYvr32Z1MxEu113cRyNi+iGg70OF+VDPavBuHp0Xu0lFDo/urJ Mg0n0DA2fH9qmqfZNsRAjM6Xh+j9YQkLL/8QnY5whsEW87Uwh0zyQSFSwSLs0TrVB8bj KYuILKgsZ0R5CGmz+OTaV3Ksz6EqtoOh9tFnosRN8mYPCLXBWiVKSJrxBvTT7UnTvCyM 88wg== X-Gm-Message-State: AE9vXwP8n3NuKYUwJ0/aKe2Z+ACHw6Btdcl5PQd2/u6AIEryQcRSRX6QslPZ/fvtlslmmEjql+fiBcX+cKooRA== X-Received: by 10.237.56.170 with SMTP id k39mr13245308qte.138.1473585302789; Sun, 11 Sep 2016 02:15:02 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Sebastian Gniazdowski Date: Sun, 11 Sep 2016 11:14:42 +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. The commit with debug marks etc. is: 001a537 Best regards, Sebastian Gniazdowski On 11 September 2016 at 11:01, Sebastian Gniazdowski wrote: > 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