Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH 1/1] prompt: Fix an off-by-one in the overf check in countpromt.



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: Reverse Date, Date, Thread, Author