Re: Git trims the last character of content from remotes
- From
- Mikael Magnusson <mikachu@gmail.com>
- Date
- May 6, 2026, 09:37 UTC
- Message-ID
- <CAHYJk3Q6xjW8mBvbQkN3vsDb2e9Em6PuDinFoTFwqkTXaKK=rQ@mail.gmail.com>
- In-Reply-To
- <3364c573-b7f4-4ec0-b471-312aa11028fe@web.de>
On Tue, May 5, 2026 at 9:46 PM René Scharfe <l.s.r@web.de> wrote:
Show 18 quoted lines
> > On 5/5/26 2:34 AM, Chris Torek wrote: > > On Mon, May 4, 2026 at 10:02 AM Hugo Osvaldo Barrera <hugo@whynothugo.nl> wrote: > > [snippage] > >> When the width of a whole line is the same as my terminal width ... > > [snippage] > >> ... sideband.c prints ANSI_SUFFIX = "\033[K", this escape > >> sequence being "clear the line from the current position until the end of the > >> line", and this is the root cause of the issue. > > > If you have a non-empty prefix > > string before this "clear to end of line" suffix, the solution is more > > obvious: print the ESC [ K as a *prefix* rather than a suffix, but > > that fails with the empty prefix. > We do have a non-empty prefix, but why would it be necessary? What's > wrong with clearing the full line starting from column 1? > > Anyway, do you mean something like this?
If the purpose of the clear is to reset the background color on wrapped lines, this will not have any effect, since you clear before the new line is wrapped in. (This is a bit of an obscure edge case, if you set the background color, and wrap the line, the entire new line will be scrolled in with the active background color, then you write perhaps 10 more characters and send the sequence to reset the background color, but the entire rest of the line is still brown, or whatever it was set to when you wrapped).
Example command to reproduce locally, % echo -e '\e[43maaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\e[0mhihi' (Add more aaaaaaa if necessary so that the line breaks before they end).
-- Mikael Magnusson