Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: how to update RPROMPT each time a key is pressed
- X-seq: zsh-users 30269
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Trevor Avant <trevoravant@xxxxxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: how to update RPROMPT each time a key is pressed
- Date: Sat, 7 Jun 2025 21:04:13 -0700
- Archived-at: <https://zsh.org/users/30269>
- In-reply-to: <CADpHffGDx_sczwp9BH7-exv6KgAigOi1HXbTPuSk=-6F=PrkFQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CADpHffGDx_sczwp9BH7-exv6KgAigOi1HXbTPuSk=-6F=PrkFQ@mail.gmail.com>
On Sat, Jun 7, 2025 at 7:08 PM Trevor Avant <trevoravant@xxxxxxxxx> wrote:
>
> The effect of this command is that my RPROMPT gets set to ABC, but only after I have executed the command
I suppose this should be considered a bug, but reset-prompt only
redraws the prompt if there was one before it was called. I imagine
this is meant as an optimization so it doesn't have to re-fetch the
value of the variable if it was never set. So all you need to do is
add
RPROMPT=''
to your .zshrc, probably right after the "zle -N self-insert" in your sample.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author