summaryrefslogtreecommitdiff
path: root/Libraries/LibVT
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-01-25 19:49:42 +0100
committerAndreas Kling <kling@serenityos.org>2020-01-25 19:49:42 +0100
commit20e41ab381d71b88db979560b55f8e2190ad7990 (patch)
treec70c3b89429d3dd42b519f989395e2975726b705 /Libraries/LibVT
parente6f5ce82852f6f88d5f6296ef469963244b34f17 (diff)
downloadserenity-20e41ab381d71b88db979560b55f8e2190ad7990.zip
LibVT: Support HVP (Horizontal and Vertical Position) (final 'f')
Diffstat (limited to 'Libraries/LibVT')
-rw-r--r--Libraries/LibVT/Terminal.cpp15
-rw-r--r--Libraries/LibVT/Terminal.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/Libraries/LibVT/Terminal.cpp b/Libraries/LibVT/Terminal.cpp
index 4241392053..cd7ee9d1b3 100644
--- a/Libraries/LibVT/Terminal.cpp
+++ b/Libraries/LibVT/Terminal.cpp
@@ -290,6 +290,18 @@ void Terminal::escape$H(const ParamVector& params)
set_cursor(row - 1, col - 1);
}
+void Terminal::escape$f(const ParamVector& params)
+{
+ // HVP – Horizontal and Vertical Position
+ unsigned row = 1;
+ unsigned col = 1;
+ if (params.size() >= 1)
+ row = params[0];
+ if (params.size() >= 2)
+ col = params[1];
+ set_cursor(row - 1, col - 1);
+}
+
void Terminal::escape$A(const ParamVector& params)
{
int num = 1;
@@ -668,6 +680,9 @@ void Terminal::execute_escape_sequence(u8 final)
case 'c':
escape$c(params);
break;
+ case 'f':
+ escape$f(params);
+ break;
default:
dbgprintf("Terminal::execute_escape_sequence: Unhandled final '%c'\n", final);
break;
diff --git a/Libraries/LibVT/Terminal.h b/Libraries/LibVT/Terminal.h
index 7679eb6fa7..1c6bf482a0 100644
--- a/Libraries/LibVT/Terminal.h
+++ b/Libraries/LibVT/Terminal.h
@@ -171,6 +171,7 @@ private:
void escape$L(const ParamVector&);
void escape$h_l(bool, bool, const ParamVector&);
void escape$c(const ParamVector&);
+ void escape$f(const ParamVector&);
TerminalClient& m_client;