Subject: Re: [BUG] "git log" command wraps lines not correctly while terminal width changed

From: Junio C Hamano <[email-masked]>
Date: Fri, 29 Jul 2022 14:12:07 -0700

Jeff King <[email-masked]> writes:

> On Fri, Jul 29, 2022 at 06:35:20PM +0400, Sergey Grunenko wrote:
>
>> Hi, developers. I met some small bug in console report of "git log" command
>
> I don't think this is a bug in git, because git isn't actually doing any
> wrapping.

We do measure the terminal width when we start and adjust the length
of --stat and other things, but it does not affect the overall
correctness of what you said.  We just draw once, and never go back
to redraw with updated width in response to SIGWINCH.  After we emit
our output, it is up to the pager and the terminal.

> OK, so it sounds like you're probably seeing "less" get told by the
> terminal that the window size has changed, and it adapts.
> ...
> The mouse scroll wheel is presumably telling the terminal to move
> through its back-scroll. How it handles re-rendering of content that's
> only in the back-scroll is up to it, and totally outside the control of
> either git or the pager. It behaves as your 8a for me, using urxvt on
> Linux. You probably need to file a report with the provider of your
> terminal emulator.