zsh-workers
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Incorrect cursor position when ZLE_RPROMPT_INDENT=0 (with a fix)
Date: Sun, 19 May 2019 19:34:44 +0200	[thread overview]
Message-ID: <CAN=4vMozz41wH3=ZOoe=tAx70bXnD1ieZFScY7Zauby-33UcXw@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7bYdLornMBJmjE_RHgiRcywT05FXkOQdSapZHkdT30X0A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1931 bytes --]

On Sun, May 19, 2019 at 7:05 PM Bart Schaefer <schaefer@brasslantern.com>
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.

  reply	other threads:[~2019-05-19 17:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-19 15:38 Roman Perepelitsa
2019-05-19 15:41 ` Roman Perepelitsa
2019-05-19 17:04 ` Bart Schaefer
2019-05-19 17:34   ` Roman Perepelitsa [this message]
2019-05-19 18:09     ` Roman Perepelitsa
2019-05-19 18:51       ` Roman Perepelitsa
2019-05-19 20:12         ` Bart Schaefer
2019-05-19 21:07           ` Roman Perepelitsa
2019-05-20  8:21             ` Yannic Schröder
2019-05-20  8:36               ` Roman Perepelitsa
2019-05-20 10:21                 ` Charles Blake
2019-05-20 10:46                   ` Roman Perepelitsa
2019-05-20 11:06                     ` Daniel Shahaf
2019-05-20 11:07                     ` Charles Blake
2019-05-20 11:11                       ` Peter Stephenson
2019-05-20 11:32                       ` Roman Perepelitsa
2019-05-20 12:41                     ` Charles Blake
2019-05-20 13:16                       ` Roman Perepelitsa
     [not found]                         ` <CAKiz1a-nOkAe42JoxFRgMJ+LXZ3fgMxqgwNZOW+2Y45oqzu8hA@mail.gmail.com>
2019-05-20 13:55                           ` Roman Perepelitsa
2019-05-23  5:48                             ` Roman Perepelitsa
2019-05-23 21:36                               ` Daniel Shahaf
2019-05-23 22:52                                 ` Roman Perepelitsa
2019-05-24 12:18                                   ` Daniel Shahaf
2019-05-27 15:36                                     ` Roman Perepelitsa
2019-05-27 21:51                                       ` Peter Stephenson
2019-05-28  8:44                                         ` Peter Stephenson
2019-05-28  8:46                                           ` Roman Perepelitsa
2019-05-28 14:26                                         ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN=4vMozz41wH3=ZOoe=tAx70bXnD1ieZFScY7Zauby-33UcXw@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).