LibVT: Implement Device Status Report (cursor position report)

This commit is contained in:
AnotherTest 2020-04-09 07:43:12 +04:30 committed by Andreas Kling
parent 8286f8b996
commit 2663739db1
Notes: sideshowbarker 2024-07-19 07:45:47 +09:00
2 changed files with 14 additions and 1 deletions

View file

@ -704,6 +704,12 @@ void Terminal::execute_escape_sequence(u8 final)
case 'f':
HVP(params);
break;
case 'n':
if (params.size() == 1 && params[0] == 6)
DSR();
else
dbg() << "Unknown CSIxn command";
break;
default:
dbgprintf("Terminal::execute_escape_sequence: Unhandled final '%c'\n", final);
break;
@ -806,6 +812,12 @@ void Terminal::RI()
CUU({});
}
void Terminal::DSR()
{
// Device Status Report (cursor position query)
emit_string(String::format("\033[%d;%dR", m_cursor_row + 1, m_cursor_column + 1));
}
void Terminal::on_char(u8 ch)
{
#ifdef TERMINAL_DEBUG

View file

@ -26,8 +26,8 @@
#pragma once
#include <AK/String.h>
#include <AK/NonnullOwnPtrVector.h>
#include <AK/String.h>
#include <AK/Vector.h>
#include <LibVT/Position.h>
@ -178,6 +178,7 @@ private:
void NEL();
void IND();
void RI();
void DSR();
TerminalClient& m_client;