Terminal: Handle bell and warn on unimplemented control characters

This commit is contained in:
Bananymous 2025-07-21 14:28:09 +03:00
parent 4efaf65d3f
commit 1e65f02ff7
1 changed files with 9 additions and 0 deletions

View File

@ -676,6 +676,9 @@ Rectangle Terminal::putcodepoint(uint32_t codepoint)
auto& texture = m_window->texture(); auto& texture = m_window->texture();
switch (codepoint) switch (codepoint)
{ {
case '\a':
// TODO: bell
break;
case '\e': case '\e':
m_state = State::ESC; m_state = State::ESC;
break; break;
@ -697,6 +700,12 @@ Rectangle Terminal::putcodepoint(uint32_t codepoint)
break; break;
default: default:
{ {
if (iscntrl(codepoint))
{
dwarnln("unhandled control character 0x{2H}", codepoint);
break;
}
if (m_cursor.x >= cols()) if (m_cursor.x >= cols())
{ {
m_cursor.x = 0; m_cursor.x = 0;