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 21:23:39 +0100	[thread overview]
Message-ID: <CAON8QzmK=6kj-g=RTCONoG=QbV9=rvR14ScSvDq2=cU3Qgj5cg@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7bNi=kigjxp_dZ8zCDasXcni+3u4JnpLTun2w+fy=uhyw@mail.gmail.com>

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

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

> On Tue, Jan 16, 2018 at 9:04 AM, Warepire - <warepire.ml@gmail.com> wrote:
> >
> > 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.
>
> The situation is and pretty much always has been intolerable.  Some
> terminals linefeed as soon as the rightmost column is filled, and most
> but not all of those swallow a newline if it is the next character
> sent.  Some feed when anything, even a zero-width character or control
> sequence, is sent when there is something in the rightmost column;
> others do so only when the next character sent is printable.  Others
> behave in one of these ways only for the bottomost-rightmost position.
> Some have a "bug compatibility mode" which means you don't know
> whether they're going to do this lunacy or not.  And the available
> terminfo bits don't adequately describe all the combinations,
> especially in the "bug compatibility" case.
>
> One of the reasons zsh introduced the "prompt truncation" escapes is
> so that the user can control whether his prompt ever reaches the
> rightmost column, because there's no way for the C code to get this
> right in all cases.
>
> So whether we keep this change or one like it depends in part on which
> behavior we think is now most common, because somebody is going to
> have to do a workaround in their prompt settings no matter what we do.
>

I might have worded myself badly, if so, I apologize. What I meant with
proper handling was how to properly introduce a configuration setting for
this and determine it's default numerical value (or boolean?), since my
patch in it's current state may trigger the problems zsh wants to avoid (at
least in theory).
Checking through the terminfo and termcap manuals, with my poor
understanding there doesn't seem to be a (combination of) termcap(s) to
detect this safely enough to attempt it.

I have no idea what it should be called, but I am leaning on a default as
1, turning the check into "> zterm_columns - offset", and just like
ZLE_RPROMPT_INDENT users can set it to 0 if their terminal supports it (and
fixes the erased-output problem without freak-out). As the freak-outs are
much worse than the dropped line of output when comparing the possible
problems users may see by default.

  reply	other threads:[~2018-01-16 20:23 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 -
2018-01-16 19:32       ` Bart Schaefer
2018-01-16 20:23         ` Warepire - [this message]
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='CAON8QzmK=6kj-g=RTCONoG=QbV9=rvR14ScSvDq2=cU3Qgj5cg@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).