Zsh Mailing List Archive
Messages sorted by:
Re: [PATCH 1/1] prompt: Fix an off-by-one in the overf check in countpromt.
- X-seq: zsh-workers 42291
- From: Warepire - <warepire.ml@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- 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
- 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:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VX44RWO6hsBqt+fz4eUD5TZ19IKSdsUCUxIawYuNtdM=; b=JAwsxlNlHkGMcq+0tH3VMfSx7SKtGW2CNipvoLOsDJq7KFo0zOU89Ii4/Mde5MqnEk aXY+SdcesZdC8L3zEU1VkXy5XYN/vpdR/pbnbOInxqj4qXFn5RoZESnhvUdF0JSgLJpM xXnF5WrfcrJcf4j7KKOTKbFbnGpsS1FGikFsbAxtKnx9+lHSVMqGT2B5GiqFPa72g74k arCnr6bCGuOsCRPLD6mPcp+Lf9Mj/5wXFQWSglNV5ZQledbeshMKggy4lngZKEUJ3LZ6 ZZ3SKmWd7Wizwzy69lyPVLuFrnxbLj2YAwDjMrRKLw8YRoym+l8D6JkMIcqB0cZhEr/9 15hQ==
- In-reply-to: <CAH+w=7bNi=kigjxp_dZ8zCDasXcni+3u4JnpLTun2wfirstname.lastname@example.org>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- List-unsubscribe: <mailto:email@example.com>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <firstname.lastname@example.org> <email@example.com> <CAH+w=7ZnLkZ86JOdXKEtjbi6g+PCj8FoyMG6xGnhcJN_2HvpBg@mail.gmail.com> <CAON8QzmD9Av9R+KcY9EeE3WZa0dWyPJu8F1d3q-i7iVb0ehVsQ@mail.gmail.com> <CAH+w=7bNi=kigjxp_dZ8zCDasXcni+3u4JnpLTun2wfirstname.lastname@example.org>
On Tue, Jan 16, 2018 at 8:32 PM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
> On Tue, Jan 16, 2018 at 9:04 AM, Warepire - <warepire.ml@xxxxxxxxx> wrote:
> > I don't think doing this based on ZLE_RPROMT_INDENT is the way to go,
> > based terminals require the number of TCUPs to match the number of lines
> > 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.
Messages sorted by: