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 44323
- 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 19:34:44 +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=XVAfH8k0ZJoJkB6vS/mXX2FjHTrXBg/jrM7SABlPr0c=; b=MNoWJq5yzW2Ak+tyT1XZBt1oM1ldtcuQxLGkQE+K/m9KZpBpy+ibcyWom+Qq782vrr lM6dTjw4rwE+dIjFDtLa3XQ0Bzw1Mk872wQCC84JZOf+fnb0twL18L4C39UR+NFAJnfw I0SunRvWrOJLd6Xb8o4Vesym4SGAHtluHd213I6Xjxf/AqaJpfnKbL8B09SfjvmZM/06 7hoONuQgQTzmxtLLQj7UmP4p2O9C9WmwyCGzdMEqfjP4K/O4Tsq69WhINpCEIytSqggC 6EAVhnXEuKtP/m0jdtLJ9eJaRUBObpNwiFXHjQHFKMI4vujMn1qeSR5q3ZS9B/qUqD3t Cwog==
- In-reply-to: <CAH+w=7bYdLornMBJmjE_RHgiRcywT05FXkOQdSapZHkdT30X0A@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>
On Sun, May 19, 2019 at 7:05 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
wrote:
> We constantly go around on this. If we un-break it for one terminal
> type it breaks for another. It's an acknowledged problem that in some
> cases you can't set ZLE_RPROMPT_INDENT=0, that's why the variable
> exists in the first place; if it always worked to set it to zero we'd
> remove it.
>
> All your patch does is remove a test for the value of that variable.
> A more correct change would be to add to the test condition a check
> for whether placing a character in the rightmost column (or the
> rightmost/bottom-most position) causes the terminal to auto-wrap (or
> not) the cursor onto the next line.
At first I thought that on my terminal (GNOME Terminal) there is
auto-wrapping when RPROMPT is written at the very right edge. It can be
seen when I set RPROMPT='%K{red}X' and ZLE_RPROMPT_INDENT=0, which results
in an extra line below the prompt with a red cell on the left. Then, after
some debugging, I realized that it's not my terminal that causes
auto-wrapping but ZSH. zputs(rpromptbuf, shout) at zle_refresh.c:1680
doesn't create that new line even when ZLE_RPROMPT_INDENT=0. The following
ZSH code does. That's why my patch doesn't just disable a condition but
also adjusts vcs after zputs(rpromptbuf, shout).
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.
What $ZSH_PATCHLEVEL were you testing against? There was a related
> change committed only a month ago, and there has not been a release in
> the meantime.
>
echo $ZSH_PATCHLEVEL
zsh-5.7.1-77-gfae7c85
My fork is currently 1 commit ahead of zsh-users/zsh on github.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author