prevent wrap-around when redrawing console

This commit is contained in:
folkert van heusden 2022-03-22 17:06:45 +01:00
parent b956854826
commit f09085c165

View file

@ -102,7 +102,7 @@ void console::operator()()
if (c == 3) // ^c if (c == 3) // ^c
*terminate = true; *terminate = true;
else if (c == 12) { // ^l 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); 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(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 { else {
input_buffer.push_back(c); input_buffer.push_back(c);