Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lldb/source/Core/Statusline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void Statusline::UpdateScrollWindow(ScrollWindowMode mode) {
if (!stream_sp)
return;

const unsigned reduced_scroll_window = m_terminal_height - 1;
const unsigned reduced_scroll_rows = m_terminal_height - 1;
LockedStreamFile locked_stream = stream_sp->Lock();

switch (mode) {
Expand All @@ -101,13 +101,14 @@ void Statusline::UpdateScrollWindow(ScrollWindowMode mode) {
locked_stream.Printf(ANSI_UP_ROWS, 1);
// Reduce the scroll window.
locked_stream << ANSI_SAVE_CURSOR;
locked_stream.Printf(ANSI_SET_SCROLL_ROWS, reduced_scroll_window);
locked_stream.Printf(ANSI_SET_SCROLL_ROWS, reduced_scroll_rows);
locked_stream << ANSI_RESTORE_CURSOR;
break;
case DisableStatusline:
// Reset the scroll window.
locked_stream << ANSI_SAVE_CURSOR;
locked_stream.Printf(ANSI_SET_SCROLL_ROWS, 0);
locked_stream.Printf(ANSI_SET_SCROLL_ROWS,
static_cast<unsigned>(m_terminal_height));
locked_stream << ANSI_RESTORE_CURSOR;
// Clear the screen below to hide the old statusline.
locked_stream << ANSI_CLEAR_BELOW;
Expand All @@ -116,7 +117,7 @@ void Statusline::UpdateScrollWindow(ScrollWindowMode mode) {
// Clear the screen and update the scroll window.
// FIXME: Find a better solution (#146919).
locked_stream << ANSI_CLEAR_SCREEN;
locked_stream.Printf(ANSI_SET_SCROLL_ROWS, reduced_scroll_window);
locked_stream.Printf(ANSI_SET_SCROLL_ROWS, reduced_scroll_rows);
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def test(self):
self.expect('set set separator "| "')

# Hide the statusline and check or the control character.
self.expect("set set show-statusline false", ["\x1b[1;0r"])
self.expect(
"set set show-statusline false", ["\x1b[1;{}r".format(self.TERMINAL_HEIGHT)]
)

def test_no_color(self):
"""Basic test for the statusline with colors disabled."""
Expand Down
Loading