Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Incorrect cursor position when ZLE_RPROMPT_INDENT=0 (with a fix)
- X-seq: zsh-workers 44324
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Incorrect cursor position when ZLE_RPROMPT_INDENT=0 (with a fix)
- Date: Sun, 19 May 2019 20:09:19 +0200
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- 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=VDq3K932INBHKtycTylmjgK0Uqna0HN80+hLP5r7OOY=; b=UUbgm2XGGxKmC/PsgbsLN/gb46vGwQitbrg45iWt56uYp87514NYsPwsgTUX8iJzO5 tCJcRRdrLyuulnrMQkQklXnjhexWSiiq5Pi4ChtJy0P3MVZt6ZVsjZcgEtklj6p8tnTf 6MVSno2e10PRMJRAV8M3cWrKK54eaFg8VnPnIWUnjQxFF+gxJqzu4ZehcRqvo+u6q1h0 a0CJhzVvAYLsRouDX/sX3McHGLzcQy6kAWRIBseBUzvf+iSSSQSLgXoN4+nk0jS2012r pS+2BUvedxzVCwl+RmSB/m3eAVVistY6OR1EBaQDOasuRY2llB9hpES3Dn7/zsGC8g23 cD5w==
- In-reply-to: <CAN=4vMozz41wH3=ZOoe=tAx70bXnD1ieZFScY7Zauby-33UcXw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAN=4vMpx_B5TRNQzDAvBoTFszoKea2=uQr5xjd0vZVH6py+oVA@mail.gmail.com> <CAH+w=7bYdLornMBJmjE_RHgiRcywT05FXkOQdSapZHkdT30X0A@mail.gmail.com> <CAN=4vMozz41wH3=ZOoe=tAx70bXnD1ieZFScY7Zauby-33UcXw@mail.gmail.com>
On Sun, May 19, 2019 at 7:34 PM Roman Perepelitsa <
roman.perepelitsa@xxxxxxxxx> wrote:
>
> Do I understand you correctly that prior to my patch ZSH
> handled ZLE_RPROMPT_INDENT=0 correctly on terminals that do auto-wrap after
> RPROMPT is written, but my patch broke them? If so, could point me to such
> a terminal? It would be very helpful. I realize that you've had this
> discussion a million times and I appreciate your patience.
>
Answered my own question. My patch adds an extra space on Mac Terminal.
I've now changed it slightly so that it works correctly on GNOME Terminal
and Mac Terminal. Here's the additional change I've made:
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 1f293845f..85e55e0d4 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -1678,7 +1678,12 @@ zrefresh(void)
moveto(0, winw - rprompt_off - rpromptw);
zputs(rpromptbuf, shout);
- vcs = winw - rprompt_off;
+ if (rprompt_off) {
+ vcs = winw - rprompt_off;
+ } else {
+ zputc(&zr_cr);
+ vcs = 0;
+ }
/* reset character attributes to that set by the main prompt */
txtchange = pmpt_attr;
/*
You can see the whole diff here:
https://github.com/zsh-users/zsh/compare/master...romkatv:rprompt-indent2.
If anyone can point me to a terminal on which this doesn't work, I'll be
happy to debug and educate myself.
Roman.
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author