git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] sideband: clear full line when printing remote messages

From
Junio C Hamano <gitster@pobox.com>
Date
May 10, 2026, 23:30 UTC
Message-ID
<xmqqzf26971p.fsf@gitster.g>
In-Reply-To
<9826dabf-c9a6-4397-8ae6-a24f9c507f1b@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 21 quoted lines
> demultiplex_sideband() can write its remote output over active local
> progress lines.  That's why it has been using ANSI code Erase in Line on
> smart terminals to clear the remainder of lines it writes since
> ebe8fa738d (fix display overlap between remote and local progress,
> 2007-11-04).
>
> This erases the last character of remote lines that span the full width
> of the terminal, though, as the cursor is stuck at the rightmost column
> for them.  It's the same effect as in the following command, which
> clears the 1 and shows just the leading zeros:
>
>    $ EL="\033[K"
>    $ printf "%0${COLUMNS}d${EL}\n" 1
>
> If we move the ANSI code to the start we get to see the 1 as well:
>
>    $ printf "${EL}%0${COLUMNS}d\n" 1
>
> So do the same in demultiplex_sideband() and emit the ANSI code as a
> prefix instead of a suffix to show messages in full even if they happen
> to fill the whole width of a smart terminal.

Makes sense. The final objective is to make sure that leftover letters near the end of line printed by previous "print" would not remain after the material we are printing, so it does not matter if we print and then erase the remainder or we erase the whole line and print. And the latter is an obvious way to make it easier to reason about in the presense of funkiness in the ways terminals behave around the end of line.

Previous: René ScharfeNext: Mikael Magnusson
Message 8 of 10 in “Git trims the last character of content from remotes”
  1. Hugo Osvaldo BarreraMay 4, 2026
  2. Chris TorekMay 5, 2026
  3. René ScharfeMay 5, 2026
  4. Mikael MagnussonMay 6, 2026
  5. Mikael MagnussonMay 6, 2026
  6. René ScharfeMay 6, 2026
  7. sideband: clear full line when printing remote messagesRené Scharfe, May 10, 2026
  8. Junio C HamanoMay 10, 2026
  9. Mikael MagnussonMay 5, 2026
  10. Junio C HamanoAug 3, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.