From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26827 invoked by alias); 14 Feb 2017 07:21:00 -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: X-Seq: 22466 Received: (qmail 28212 invoked from network); 14 Feb 2017 07:21:00 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf0-f49.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.215.49):SA:0(-0.7/5.0):. Processed in 1.135731 secs); 14 Feb 2017 07:21:00 -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.7 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: jesper.nygards@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.215.49 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=l8Jv3m0F/bmJ+wRMwoqo2X9RtB84VXThwFfx8hxbbbI=; b=KdXjppoje7jMb//DFnx17ltAA83qEQbQ6pYc4Pr+kpnx1N1r7a3OASZXAOouBonovS GZGELhWIMyy88N4ZnYllt44hQB0krkwqc0QHHx7HuM0gy3hwNhDLQzRLfuQXiBdD1FeJ +PGSse0Y5E/C/qiGRfZR3rtGqyXiI0Kz/yRdBgvUU5jJTgYddiuYLb36WaVZcE5SPdkW Mi+zDa86g7rS9OB8EHViGvWRtPM75F0q5IxsDV7PtciYJFyBJrZia02kj17lvWvdOJ+d 1IkD5Vh78t6hsgamYIeHExjxnE3T4EU64Gh/2NW++H0LpA1lEllHYxbjD7dANMkHDxSM 2kdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=l8Jv3m0F/bmJ+wRMwoqo2X9RtB84VXThwFfx8hxbbbI=; b=omQq2A6ajJQE2UoqbIs+Lyjn8hoqVEHe6X+Nyg31QUwLgJSJbiG3nxGL328xna5dPH cxHtpeNVq75QcykxA7NQGn7teoGvrlppncmhmxuB4SW0xPWIOHd/JckyrHKl3xhbQyo1 zH8DnuzJDKfhgvOKHeCSwsRuEdj30rNWr8st7eJdYOnWPfIco9oYIJjGj9scTZmaS7fO Z4YPhdl9qm1yMvt11jLsnewkXH8Buw4MZeisTYE2gLwA9PsbstFpQkFa/mjLbyiX9lQT tORyTH1Q8Pu+UAEPY1vIXBPAHx43OfmeC1M2uHJ0KEe0cOmjh1k1geEsi99uvGziLEAV 1YlQ== X-Gm-Message-State: AMke39k9dyoKzwn+zNF5Z5xfiivQhTmL3fbGRNaZVEkCOWIz2/w1QL8Bn2xpQBi5Nyivkl58juhw1bdJwPeNRA== X-Received: by 10.25.125.132 with SMTP id y126mr8441345lfc.102.1487056852274; Mon, 13 Feb 2017 23:20:52 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <170213095400.ZM5106@torch.brasslantern.com> References: <170213095400.ZM5106@torch.brasslantern.com> From: =?UTF-8?Q?Jesper_Nyg=C3=A5rds?= Date: Tue, 14 Feb 2017 08:20:51 +0100 Message-ID: Subject: Re: Disabling prompt refresh To: Zsh Users Content-Type: multipart/alternative; boundary=001a114afaf270d3e00548786714 --001a114afaf270d3e00548786714 Content-Type: text/plain; charset=UTF-8 This is perfect for my needs. Thank you, Bart. On Mon, Feb 13, 2017 at 6:54 PM, Bart Schaefer wrote: > On Feb 13, 3:31pm, Jesper Nygards wrote: > } > } Is there a way to either disable the prompt refresh while the message is > } displayed, or, alternatively, to redisplay the message after a prompt > } refresh? > > The simplest approach might be to not use "zle -M" at all: > > _show_dirs() { > POSTDISPLAY=$'\n'"${$(dirs -vl)//$'\t'/ }" > } > > To answer your question, though -- you would need to have the functions > coordinate somehow, e.g.: > > typeset -gH _prompt_message > _show_dirs() { > _prompt_message="${$(dirs -vl)//$'\t'/ }" > zle -M "_prompt_message" > } > schedprompt() { > emulate -L zsh > zmodload -i zsh/sched > > integer i=${"${(@)zsh_scheduled_events#*:*:}"[(I)schedprompt]} > (( i )) && sched -$i > > zle && zle reset-prompt && > [[ -n $_prompt_message ]] && zle -M "$_prompt_message" > > sched +30 schedprompt > } > clear-prompt-message() { > _prompt_message= > } > autoload add-zsh-hook > add-zsh-hook precmd clear-prompt-message > > (I'm guessing schedprompt is also a precmd hook but didn't want to assume.) > > You could instead in schedprompt do > > [[ -z $_prompt_message ]] && zle && zle reset-prompt > > to disable the redraw. > --001a114afaf270d3e00548786714--