Kernel/Terminal: Add support for ANSI DSR

This commit is contained in:
2025-04-23 06:10:38 +03:00
parent 8a00b53050
commit 28bf2d6374
2 changed files with 26 additions and 3 deletions

View File

@@ -517,11 +517,21 @@ Rectangle Terminal::handle_csi(char ch)
case 'l':
if (!m_csi_info.question || m_csi_info.fields[0] != 25)
{
dprintln("invalid ANSI CSI ?{}{}", m_csi_info.fields[0], (char)ch);
dprintln("unsupported ANSI CSI {}", ch);
break;
}
m_cursor_shown = (ch == 'h');
break;
case 'n':
if (m_csi_info.fields[0] != 6)
{
dprintln("unsupported ANSI CSI n");
break;
}
char buffer[2 + 10 + 1 + 10 + 2];
sprintf(buffer, "\e[%u;%uR", m_cursor.y + 1, m_cursor.x + 1);
write(m_shell_info.pts_master, buffer, strlen(buffer));
break;
default:
dprintln("TODO: CSI {}", ch);
break;