Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Disabling prompt refresh
- X-seq: zsh-users 22463
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Disabling prompt refresh
- Date: Mon, 13 Feb 2017 09:54:00 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=1S/2QgqbG5ZTRhehJ6lqQb3Pcq/sZM1NEeCY95Fr25s=; b=x4FoARN8CbI08cDaMMjfGDknh6kgSkWhFLgoD0j05UpopJn6HrKMa1zyRYxNC0PX8k bkt1QWbWv2fTtzFxgBGPVq73mOPlh4z8gSdKcQ0sh97Ohqe1p8Dhextl7dU6Umz4KmVN H2pntSmXN61M6TmRbS/VnVZS14Bdvb5IoHn7w4LB8Gq0D196YB94DMi/CfMqxFS6ERqk OsZ9bI2oxDFmb9ANddb8tLuvEi+7rgGlnIw7fAVzArrAvSB6vOZflCR+cMkAaxQjmmwM hBLPtTosxWta1G06Ze1Fza0s6rGtu/7PXW2pyVXo5Sx5dIn4suaKz+p0Mx1MgUvjCe6J C/YQ==
- In-reply-to: <CABZhJg86e3i6iPHbrW=rppiq2RUiW2nXLdZgAv=2GLsDnDV=GA@mail.gmail.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>
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