zsh-workers
 help / color / mirror / code / Atom feed
From: Warepire - <warepire.ml@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [PATCH 1/1] prompt: Fix an off-by-one in the overf check in countpromt.
Date: Tue, 16 Jan 2018 18:04:52 +0100	[thread overview]
Message-ID: <CAON8QzmD9Av9R+KcY9EeE3WZa0dWyPJu8F1d3q-i7iVb0ehVsQ@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7ZnLkZ86JOdXKEtjbi6g+PCj8FoyMG6xGnhcJN_2HvpBg@mail.gmail.com>

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

This is what I was worried about, hence why I included the cover letter.

I just tried setting ZLE_RPROMPT_INDENT=0 in my .zshrc and my terminal
freaked out, it had no idea what to do with the cursor after I reached the
bottom corner. Length or wraps of my LPROMPT didn't matter much since I
have a multi-line config. The LPROMPT will not touch that character
position, but the RPROMPT does. However, this would most likely indeed
freak out on single-line LPROMPTS, although I could not come up with a
config that'd do it.

I don't think doing this based on ZLE_RPROMT_INDENT is the way to go,
libvte based terminals require the number of TCUPs to match the number of
lines the final prompt will have when drawn. I am open for fixing this
patch, if we can reach an agreement on what the proper handling should be.
I am sadly not clever enough about shells to come up with something on my
own here. I am available in the IRC channel for discussion if that would
help the decision making, since I can test configs quite quickly that way.


On Tue, Jan 16, 2018 at 4:28 PM, Bart Schaefer <schaefer@brasslantern.com>
wrote:

> On Mon, Jan 15, 2018 at 2:35 AM,  <warepire.ml@gmail.com> wrote:
> > From: Warepire <Warepire@users.noreply.github.com>
> >
> > This triggers overf when the prompt is exactly as wide as the
> > term, causes countprompt to count a 2-line prompt as 3 lines.
> > Which transmits an errorneus TCUP to the PTY. In some terminals
> > this causes the last line of the previous command to be erased.
>
> I see this has already been pushed to the zsh git, but I'm not sure
> it's entirely correct.
>
> This may cause problems on some terminals where auto-margin causes an
> additional linefeed when the rightmost (or in some cases only the
> bottom rightmost) character position is written.  I would be willing
> to bet that the original code was intended to account for this, and
> other code has changed around it.
>
> The correct thing may be to make this conditional upon
> ZLE_RPROMPT_INDENT, or introduce a similar setting to override the
> terminfo assertions of auto-wrap/auto-margin so that the user can
> assert whether the additional TCUP is needed.
>

  reply	other threads:[~2018-01-16 17:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15 10:35 [PATCH 0/1] " warepire.ml
2018-01-15 10:35 ` [PATCH 1/1] " warepire.ml
2018-01-16 15:28   ` Bart Schaefer
2018-01-16 17:04     ` Warepire - [this message]
2018-01-16 19:32       ` Bart Schaefer
2018-01-16 20:23         ` Warepire -
2018-01-15 11:07 ` [PATCH 0/1] " dana

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=CAON8QzmD9Av9R+KcY9EeE3WZa0dWyPJu8F1d3q-i7iVb0ehVsQ@mail.gmail.com \
    --to=warepire.ml@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).