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 44328
- 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:51:40 +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=1IMTyU2NM5lcI9eM7UrQH5jYmTrmwiTQHi33VxwAz3M=; b=TWBQEQIgmt7SO6qlIZKybzsu9mLv061xdNuBoMnruFfq0715pP//PG2pK658PIRWh5 Kxk8tSVTJm7z8gOswujG6r5FjQvqKMeMOQLaoICRijWFbDNOSsI7xhUKA1WAcAi5vub/ k45HmWKz4G7dYj6vlUKu95IX2JWJbjRE+Tlxby1oMNPxOBdFwavP4+QS2aw2c7bFZ6Z/ Xjh2RncAjJVpjLfIbY1q44TjEfUZo3buEnthur+YooJWG/B2mGoDO7uJC1JA4JHCZ7XI l4Ns7eCWQFPvz0ga94tWRbmFKPfJUAGBLjPo0uXtoNiGzn3CF2H8oLGZp2DXCxBubJ6K BeJA==
- In-reply-to: <CAN=4vMpWA+2zeRjthq4aeXyb7AAc40BpfEz8O0Uaj23a1O_F6Q@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> <CAN=4vMpWA+2zeRjthq4aeXyb7AAc40BpfEz8O0Uaj23a1O_F6Q@mail.gmail.com>
I've tested my patch on two more terminals: Dumb Linux terminal
(TERM=linux) and Command Prompt with WSL. On both of them ZSH misbehaves
without my patch and works correctly with it.
Roman.
On Sun, May 19, 2019 at 8:09 PM Roman Perepelitsa <
roman.perepelitsa@xxxxxxxxx> wrote:
> 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