From 1618cffb758658f9dd72124fd646fbd69441ad98 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Sat, 5 Jun 2021 14:13:50 +0200 Subject: [PATCH] LibVT: Don't return a history size if alternate buffer is used The line history is unavailable if the alternate screen buffer is currently enabled. However, since TerminalWidget uses the history size to offset its line numbers when rendering, it will try to render inaccessible lines once the history is not empty anymore. --- Userland/Libraries/LibVT/Terminal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibVT/Terminal.h b/Userland/Libraries/LibVT/Terminal.h index 6775ee5a77..fdc5c0e6c1 100644 --- a/Userland/Libraries/LibVT/Terminal.h +++ b/Userland/Libraries/LibVT/Terminal.h @@ -156,7 +156,7 @@ public: } m_max_history_lines = value; } - size_t history_size() const { return m_history.size(); } + size_t history_size() const { return m_use_alternate_screen_buffer ? 0 : m_history.size(); } #endif void inject_string(const StringView&);