From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-return-43773-ml=inbox.vuxu.org@zsh.org 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 7b515591 for ; Tue, 6 Nov 2018 17:08:54 +0000 (UTC) Received: (qmail 14429 invoked by alias); 6 Nov 2018 17:08:40 -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: 43773 Received: (qmail 21595 invoked by uid 1010); 6 Nov 2018 17:08:40 -0000 X-Qmail-Scanner-Diagnostics: from mail-ot1-f44.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.210.44):SA:0(-2.0/5.0):. Processed in 1.789961 secs); 06 Nov 2018 17:08:40 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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; bh=J5h6zYjPztCYqFmuCjB5jH7Lgjdk6MoI4nViH9Tl1GI=; b=mi5wMO10hlFLNDlvDC83Vc9c8UC8jh8j3TDjq7WDxpCoM+cxa9c+O2kJtpgvLO6wB6 O9/pKfEB8cTQ9orHxMmnFAl7znhQ8HsmG1IHkpt/BNBuTcBr/p7hB4GelWRRXU+NU3vU 3+UrnYNVKLe++nzT6rzH0iFPtqgqrNOKZ56+u98CqM2i3YokhVelruWxhkWxBwG7R+Vo /hrE1gbkdKkb8zER/gVFuLh8FzsXhTKqJ3+Y2ElPSPalbsqaRWC5LmkwGZz4pYryluAN Ds/BanG6yDsSbMn5oAoGC27u559ACwBzB6Vrct+Go/FFqehrpcJldJlX7Lt9QJP1c785 AvfQ== 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; bh=J5h6zYjPztCYqFmuCjB5jH7Lgjdk6MoI4nViH9Tl1GI=; b=T7utVVGSDCg8KyIJYxHnWROjq0/P9Nxj0J9X/U3bigmnuWEfPedMguElhIld6gg9/s rKO2Wb63t5iNCWBMJ9sBWu769UC5bcp1ev1N5u9hsPneeMSViEGdkRcCvA4BRYXfN7ZV j+AKQBvmvS9UIqibCjblKVumz2aRZVGY18TvDEwMEIEscKkvKPyy+/tif2RzBeanrSeG 8vsCQ5B2QWpXKgMNgjrdjpOwQlL5Ot4IGuwbhAjavw5ZCuCvfRwZslTV9NuPlKwX8tPT 5e53nwkHLKLRQ/h6qsgaWsWgt9KXwjKZSpGFGrv7Acoc/g9bwDuIR24ErbLzUD5MUBrf ihCg== X-Gm-Message-State: AGRZ1gIVf9/mN47AHdVHOFaaMWG0rG0JnEBJye4NzfNh5BwkmO0fT7Bw o1CeeFEbCUsaLyg5NjqH+dYpnV2jo/NxJi+yr/bNZjjy X-Google-Smtp-Source: AJdET5cjnt9MKHteXbEu6QJhlTUXK7LOCl53720K5fspAMZ1ZD9L3d1Ms40F5lGDVIuAi5ULa/iMQPbxJc78t9MruxE= X-Received: by 2002:a9d:645:: with SMTP id 63mr4846533otn.125.1541524115176; Tue, 06 Nov 2018 09:08:35 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Tue, 6 Nov 2018 18:08:22 +0100 Message-ID: Subject: Re: Cannot invoke widget within zpty, with \C-a nor a To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" On Tue, 6 Nov 2018 at 16:19, Sebastian Gniazdowski wrote: > > Hello, > I've attached complete test file. The test body is: > > zpty_start > zpty_input 'stty 38400 columns 80 rows 24 tabs -icanon -iexten' nl > zpty_input 'rh_widget() { BUFFER="ls"; region_highlight+=( 0 4 > "fg=#12569a" ); echo yes; }' nl > zpty_input 'zle -N rh_widget' nl > zpty_input 'bindkey "\C-a" rh_widget' nl > zpty_input 'zle -la | grep rh_widget' nl > zpty_input 'bindkey | grep rh_widget' nl > zpty_input $'\C-a' > zpty_stop > 0:region_highlight > *>*ls* I now see that testing the running of zle widgets is in general difficult, even with zpty. X03zlebindkey.ztst does only `-s' bindkeys, which do not run a zle-widget, `zle && true || echo nozle' will display "nozle". I would believe that this is lost game, as even this didn't work as expected: rh_widget() { local FD="$1"; zle -F -w $FD; exec {FD}<&-; BUFFER="ls"; region_highlight+=( 0 4 "fg=#12569a" ); echo yes | tee -a /tmp/reply; }; zle -N rh_widget FD=1337; exec {FD}< <( LANG=C sleep 0.5; echo run | tee -a /tmp/reply ); command true; zle -F -w "$FD" rh_widget ... however, it turned out that the `+Z' option passed to zsh-binary (its meaning: disable Zle) was responsible for not interpreting any key sequences (and not activating zle -F, however removing +Z didn't help here actually). I now have the `rh_widget' called after zpty -w zsh $'\C-a'. The `region_highlight' tests (brought up because of wanting to test true/near-color, but also revealed that general `rh' use is untested and this rather should change) seem to be possible to write. -- Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org