From a4c5220019ee02965df00039a159094d1645405d Mon Sep 17 00:00:00 2001 From: Peisong Xiao Date: Sat, 6 Jul 2024 20:00:22 -0400 Subject: [PATCH] added clear screen to console_output::render --- src/console_output.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/console_output.cc b/src/console_output.cc index 9beef14..20cbc41 100644 --- a/src/console_output.cc +++ b/src/console_output.cc @@ -70,6 +70,8 @@ std::string console_output::get_code(const int attr) { } void console_output::render() { + out << "\x1B[2J\x1B[H"; + for (std::size_t idx = 0; idx < contents.size(); ++idx) { if (idx % DISPLAY_WIDTH == 0 && idx) out << std::endl;