Update sideband '\r' progress in place above the throughput ticker

main

Commit

Soph4mo ago

Sideband progress from go-git ("source: Counting objects: 10%\r" → "Counting objects: 11%\r") was scrolling the scrollback because sessionStderr treated '\r' and '\n' as equivalent line ends and funneled both through notify(), which always emits a fresh row. The user gets one row per percentage update, which buries the useful state.

Promote the renderer to a 2-row live region: an optional transient row above (driven by '\r'-terminated sideband chunks) and the throughput ticker below. Each draw repositions the cursor to the top of the region with '\x1b[%dA\r', erases to end of screen with '\x1b[J', and re-emits both rows. sessionStderr now distinguishes terminators: '\r' calls setTransient (immediate redraw, in-place overwrite), '\n' calls notify (scrolls a permanent line above the region and clears the now-stale transient).

Result: "Compressing 89% (263/295)" updates a single row in place the way git itself shows it, while the throughput ticker keeps running below and slog/notice lines still scroll cleanly above.

Entire-Checkpoint: b2292eb61fce

Checkpoints

can you rebase soph/progress-indicators onto soph/smart-subdivision

Claude CodeOpus 4.7[1m]
View session
Checkpoint 1