From b00dd8d68d3c31b66401eef667bca9c5ccecc61c Mon Sep 17 00:00:00 2001 From: Bananymous Date: Wed, 5 Apr 2023 03:07:52 +0300 Subject: [PATCH] Kernel: Fix ansi control sequence cursor movement --- kernel/kernel/Terminal/TTY.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kernel/kernel/Terminal/TTY.cpp b/kernel/kernel/Terminal/TTY.cpp index 2f44e0f2..c1d525b4 100644 --- a/kernel/kernel/Terminal/TTY.cpp +++ b/kernel/kernel/Terminal/TTY.cpp @@ -260,9 +260,6 @@ namespace Kernel void TTY::handle_ansi_csi(uint8_t ch) { - uint32_t old_column = m_column; - uint32_t old_row = m_row; - switch (ch) { case '0': case '1': case '2': case '3': case '4': @@ -377,9 +374,6 @@ namespace Kernel dprintln("Unsupported ANSI CSI character {}", ch); return reset_ansi(); } - - if (old_column != m_column || old_row != m_row) - set_cursor_position(m_column, m_row); } void TTY::render_from_buffer(uint32_t x, uint32_t y) @@ -442,6 +436,7 @@ namespace Kernel return; case State::WaitingAnsiCSI: handle_ansi_csi(ch); + set_cursor_position(m_column, m_row); return; case State::WaitingUTF8: if ((ch & 0xC0) != 0x80)