Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Disabling prompt refresh
- X-seq: zsh-users 22466
- From: Jesper Nygårds <jesper.nygards@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Disabling prompt refresh
- Date: Tue, 14 Feb 2017 08:20:51 +0100
- 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==
- In-reply-to: <170213095400.ZM5106@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABZhJg86e3i6iPHbrW=rppiq2RUiW2nXLdZgAv=2GLsDnDV=GA@mail.gmail.com> <170213095400.ZM5106@torch.brasslantern.com>
This is perfect for my needs. Thank you, Bart.
On Mon, Feb 13, 2017 at 6:54 PM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
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.
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author