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

Re: [PATCH] use clear-to-end to reduce trailing whitespace



On Sun, Jan 19, 2025 at 3:52 PM Daniel Colascione <dancol@xxxxxxxxxx> wrote:
>
> The attached new version of the patch should handle right prompts too. I
> tested it with both zero and non-zero right prompt margins.

Thanks, a couple of remaining notes:

Your patch has Windows CRLF line endings, so won't apply cleanly to
the base source, which has only UNIX/Linux LF line endings.

Please don't use ".diff", ".patch", etc. extensions on attachments.  I
know it's a little annoying given proclivities of email clients and
IDEs, but we (and the archive software) prefer plain text attachments
-- please either force Content-Type: text/plain or use a ".txt"
extension.

> I also tested a bunch of terminals. I was unable to get any of them to
> mistakenly scroll due to issuing a clear-to-end-of-line at the right
> edge of the screen.

Thanks.  Re-reading more closely the comment "2:" that you edited,
another test case would be:

* The cursor is somewhere above the bottom of the screen, and
* the current line is exactly filled with text (even if possibly whitespace), so
* therefore the terminal has already auto-margin'd to the next line, and
* consequently emitting CEOL would erase the line below the expected
line, which may clobber residual text from previous output

There was a discussion about use of CEOS back in
https://zsh.org/users/29197 for which there are already workarounds
(mentioned in subsequent thread).  There may be a similar issue here.




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