Kernel: Optimize VTTY cursor rendering

cursor is now only updated once after all consecutive `putchar`s are
handled.
This commit is contained in:
2025-04-18 03:55:56 +03:00
parent 6858546ce9
commit 9258c73484
4 changed files with 23 additions and 3 deletions

View File

@@ -215,6 +215,7 @@ namespace Kernel
auto* ptr = reinterpret_cast<const uint8_t*>(ansi_c_str);
while (*ptr)
handle_input_byte(*ptr++);
update_cursor();
}
}
@@ -358,6 +359,7 @@ namespace Kernel
SpinLockGuard _(m_write_lock);
for (size_t i = 0; i < buffer.size(); i++)
putchar(buffer[i]);
update_cursor();
return buffer.size();
}
@@ -366,6 +368,7 @@ namespace Kernel
ASSERT(s_tty);
SpinLockGuard _(s_tty->m_write_lock);
s_tty->putchar(ch);
s_tty->update_cursor();
}
bool TTY::is_initialized()