summaryrefslogtreecommitdiff
path: root/Libraries/LibVT/Terminal.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-01-25 19:12:08 +0100
committerAndreas Kling <kling@serenityos.org>2020-01-25 19:12:08 +0100
commite6f5ce82852f6f88d5f6296ef469963244b34f17 (patch)
treeb144c00ec30305d75dc1bff19e76bbf32665fd3a /Libraries/LibVT/Terminal.cpp
parentf4e7aecec24d1aa910e22a782f169efdfdfd564b (diff)
downloadserenity-e6f5ce82852f6f88d5f6296ef469963244b34f17.zip
LibVT: Support the DA (Device Attributes) request (final 'c')
This is used by vttest on startup to query the device for identity.
Diffstat (limited to 'Libraries/LibVT/Terminal.cpp')
-rw-r--r--Libraries/LibVT/Terminal.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Libraries/LibVT/Terminal.cpp b/Libraries/LibVT/Terminal.cpp
index fe191c1872..4241392053 100644
--- a/Libraries/LibVT/Terminal.cpp
+++ b/Libraries/LibVT/Terminal.cpp
@@ -491,6 +491,12 @@ void Terminal::escape$L(const ParamVector& params)
m_need_full_flush = true;
}
+void Terminal::escape$c(const ParamVector&)
+{
+ // DA - Device Attributes
+ emit_string("\033[?1;0c");
+}
+
void Terminal::escape$M(const ParamVector& params)
{
int count = 1;
@@ -659,6 +665,9 @@ void Terminal::execute_escape_sequence(u8 final)
case 'h':
escape$h_l(false, question_param, params);
break;
+ case 'c':
+ escape$c(params);
+ break;
default:
dbgprintf("Terminal::execute_escape_sequence: Unhandled final '%c'\n", final);
break;
@@ -867,6 +876,12 @@ void Terminal::inject_string(const StringView& str)
on_char(str[i]);
}
+void Terminal::emit_string(const StringView& str)
+{
+ for (size_t i = 0; i < str.length(); ++i)
+ m_client.emit_char(str[i]);
+}
+
void Terminal::unimplemented_escape()
{
StringBuilder builder;