[Lldb-commits] [lldb] [lldb] Recompute the statusline on resize without clearing the screen (PR #202691)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Thu Jun 11 03:00:05 PDT 2026
================
@@ -114,13 +126,44 @@ void Statusline::UpdateScrollWindow(ScrollWindowMode mode) {
// Clear the screen below to hide the old statusline.
locked_stream << ANSI_CLEAR_BELOW;
break;
- case ResizeStatusline:
- // Clear the screen and update the scroll window.
- // FIXME: Find a better solution (#146919).
- locked_stream << ANSI_CLEAR_SCREEN;
+ case ResizeStatusline: {
+ // The old statusline is still on screen after a resize: a width shrink
+ // reflows that full-width line into ceil(prev_width / width) rows at the
+ // bottom, and growing taller strands it at its old row. Clear from the
+ // topmost row it can occupy to the bottom (preserving the scrollback
+ // above), then re-establish the scroll region. DECSTBM homes the cursor,
+ // so save and restore it.
+ const unsigned height = static_cast<unsigned>(m_terminal_height);
+ unsigned reflow = 1;
+ if (prev_width > m_terminal_width && m_terminal_width > 0)
+ reflow = (prev_width + m_terminal_width - 1) / m_terminal_width;
----------------
labath wrote:
```suggestion
reflow = llvm::divideCeil(prev_width, m_terminal_width);
```
https://github.com/llvm/llvm-project/pull/202691
More information about the lldb-commits
mailing list