================
@@ -41,10 +41,26 @@ Statusline::Statusline(Debugger &debugger)
 Statusline::~Statusline() { Disable(); }
 
 void Statusline::TerminalSizeChanged() {
-  UpdateTerminalProperties();
+  const uint64_t terminal_width = m_debugger.GetTerminalWidth();
+  const uint64_t terminal_height = m_debugger.GetTerminalHeight();
+
+  // Remember whether the terminal height changed.
+  const bool terminal_height_changed = terminal_height != m_terminal_height;
+
+  // Avoid clearing the old statusline if it's not visible (i.e. when the
+  // terminal height decreases), unless the width changed and the old 
statusline
+  // wrapped.
+  if (terminal_height > m_terminal_height || terminal_width < m_terminal_width)
+    UpdateScrollWindow(DisableStatusline);
+
+  // Update the terminal dimensions.
+  m_terminal_width = terminal_width;
+  m_terminal_height = terminal_height;
+
+  // Update the scroll window if the terminal height changed.
+  if (terminal_height_changed)
----------------
labath wrote:

So I think we'd need to do this unconditionally.

https://github.com/llvm/llvm-project/pull/146435
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to