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 42289
- 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 18:04:52 +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=Jo+fpx9bCWmPviABY/Mv0TYDg+9JED9b4QK23lJlBP4=; b=nFyhUXtqVWWmvbvvoNMooristxCBwW9oEWlgi872K4TZaCf8pS138BOK3l1TqwUs+V I7Qyam37BG9NZCpEqyWlbH1k2KeaxsiVEx9z9KOkLrDevIomLWXzmjO8MHOQr37vt8dC knePWi2MZQkJt62nRp3T9aBGBf7jZvg+L0kc71ugTD3AOkwuDokjDoa6U9afYQp5aoQi FlMPbkIPLohffVjb/zmfNsS/BGGaQx2ZBJ6wsoruvw1stL7DXQkQHmzKjbxIp6PKcRLz gy1EnURdDZx44IVyY1bwZ+S0Hxy1/6PaqPzQ1jRy+LoQIT+gAuWARZ145/2h0KnNhD28 7HrA==
- In-reply-to: <CAH+w=7ZnLkZ86JOdXKEtjbi6g+PCj8FoyMG6xGnhcJN_2HvpBg@mail.gmail.com>
- 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>
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@xxxxxxxxxxxxxxxx>
> On Mon, Jan 15, 2018 at 2:35 AM, <warepire.ml@xxxxxxxxx> wrote:
> > From: Warepire <Warepire@xxxxxxxxxxxxxxxxxxxxxxxx>
> > 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.
Messages sorted by: