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 892bc886 for ; Sat, 22 Jun 2019 21:18:34 +0000 (UTC) Received: (qmail 2663 invoked by alias); 22 Jun 2019 21:18:27 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23983 Received: (qmail 28882 invoked by uid 1010); 22 Jun 2019 21:18:27 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f51.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25482. spamassassin: 3.4.2. Clear:RC:0(209.85.166.51):SA:0(-2.0/5.0):. Processed in 0.719789 secs); 22 Jun 2019 21:18:27 -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.51 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=lIWUrcH4mNfeE+D+AkQm5GBKV62PHziejJpvl/hHU6Q=; b=fJKiFqDTaB8lJLgovF+1sAormfwgr0yFUZ+EIE1+ao/vEpZVeEDcM1qC/z0EBo7QQh /Aq0yfMb94KlT/4mwonS5tWKKgOoLtpoj/dYOAClEjqdbOi/mjkCeRUnzngLFfmv1Ei0 hUTptSGig1zNRfKjxbCgKsZdyFfe8nFT1beXLXs8plgoLc1DgkExxsptUkoGT5gR2fqP qyI9rYUafB/p0KtDpYJr7cLxskkeT+gf1lodgFSvYi2C8u//PSdfC4oWtGQrO4m1Xh2e KzAs4jget211IvOAOQolxlI5bRZlEb0nzWTXfBGIRA0Zpy9IXmwllGCqCIBhcvm0GvHR 8zcA== 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=lIWUrcH4mNfeE+D+AkQm5GBKV62PHziejJpvl/hHU6Q=; b=I1xmU11yFH5uzT2mvjY7TkCnjmPF4wI8D6061HT/znTUPtlZdXZnLWd4b4BWH3RdhC IBnHqhIx1VyDHWzVfNQlj334vm5UKshsz+GZYxTMdAGROXgkewjxnPskc58eU8F56Had Eiw+Z89tdzn3VVklDYrUfzy0wUcDdTBS45pczBLFRGLQ+JbPTgS+3szxFKRjctY0xjnX l9kXJFgtXfJbEGefHcKKnExE+bUNvw6tFuScwRULQycrANKYi93t9wHWa71MzmwCQI2F oJ4ieicrMYKJ+PSLs/CX8WC2zFEC/xS5RHTRj4FmV0eLrrWVLwoalS9SHspyIj1E+f1+ PfKg== X-Gm-Message-State: APjAAAUM4oLjwwmcoBc5HTx0tKYGlVR7SwSXYhjM0EpLvtfExa19Qhxb 2EAMm5i2JwXnAkJp1BgeoSm0xxzSAEXpq8P1lj4= X-Google-Smtp-Source: APXvYqxPcV7Dl/cmvSm9RpxV/qLtOY75iXyE4oRuOcabfr3ha1KyZUvujj6trniI5zz1nQJD8uez9lGjTJgVqW2MDWI= X-Received: by 2002:a02:b914:: with SMTP id v20mr97047883jan.83.1561238274323; Sat, 22 Jun 2019 14:17:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Sat, 22 Jun 2019 23:17:43 +0200 Message-ID: Subject: Re: A function to display message under the prompt without zle active To: Sebastian Gniazdowski Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" On Sat, Jun 22, 2019 at 10:49 PM Sebastian Gniazdowski wrote: > > The command line seems to be blcoked after first using the descriptor. Silly bugs. This isn't production code, I just typed it into GMail to give an idea. Removing `while` should fix it. There is also a missing `local` and quotes. With these fixes in place: function _zle_msg_process() { emulate -L zsh local line IFS='' read -r -u $zle_msg_fd line && zle -M $line } The rest of the code stays the same. The nice thing about this implementation is that it's fork-free. Depending on your needs you might also want to open the file descriptor with `sysopen -rw -o cloexec`. Note that zle will hang if you write something to the file descriptor without a terminating \n. Roman.