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

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



On 15 Jan 2018, at 04:35, warepire.ml@xxxxxxxxx wrote:
>Additionally to the commit message: I have only managed to test this
>for my own use-cases, which is a very narrow subset of tests.

FYI, if it's any help, i tested this in the following, too:

  * Terminal.app
  * iTerm2
  * Alacritty

I used a multi-line prompt where the top line had a length of COLUMNS, COLUMNS +
1, or COLUMNS - 1. I tried both with single-byte characters only and with mixed
single/multi-byte characters.

Replication:

  % zle-line-init() zle reset-prompt
  % zle -N zle-line-init
  % PROMPT=${(l<$COLUMNS><abc>):-}$'\n%~ %# '
  abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc
  ~ % echo foo

Current behaviour: The echo output is swallowed up by the next prompt.
Patched behaviour: The echo output remains unmolested.

PS: When i was testing it i had changed the comparison in both places; as
mentioned, the patch as submitted only changes the first one.

dana



Messages sorted by: Reverse Date, Date, Thread, Author