From ab665a4d26f13bf58a00409722126a98aca035c3 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Tue, 22 Mar 2022 17:06:45 +0100 Subject: [PATCH] prevent wrap-around when redrawing console --- console.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/console.cpp b/console.cpp index 65d06ba..7966d09 100644 --- a/console.cpp +++ b/console.cpp @@ -102,7 +102,7 @@ void console::operator()() if (c == 3) // ^c *terminate = true; else if (c == 12) { // ^l - put_string_ll(format("\033[2J")); + put_string_ll(format("\033[2J\033[?7l")); fprintf(stderr, "%d %d\n", tx, ty); @@ -112,7 +112,7 @@ void console::operator()() put_string_ll(std::string(screen_buffer[row], t_width)); } - put_string_ll(format("\033[%d;%dH", ty + 1, tx + 1)); + put_string_ll(format("\033[%d;%dH\033[?7h", ty + 1, tx + 1)); } else { input_buffer.push_back(c);