diff options
-rw-r--r-- | Userland/Libraries/LibVT/Terminal.cpp | 22 | ||||
-rw-r--r-- | Userland/Libraries/LibVT/Terminal.h | 6 |
2 files changed, 28 insertions, 0 deletions
diff --git a/Userland/Libraries/LibVT/Terminal.cpp b/Userland/Libraries/LibVT/Terminal.cpp index 5e72d1dd8e..7009a79db5 100644 --- a/Userland/Libraries/LibVT/Terminal.cpp +++ b/Userland/Libraries/LibVT/Terminal.cpp @@ -888,6 +888,22 @@ void Terminal::RI() set_cursor(cursor_row() - 1, cursor_column()); } +void Terminal::DECFI() +{ + if (cursor_column() == columns() - 1) + scroll_left(cursor_row(), 0, 1); + else + set_cursor(cursor_row(), cursor_column() + 1); +} + +void Terminal::DECBI() +{ + if (cursor_column() == 0) + scroll_right(cursor_row(), 0, 1); + else + set_cursor(cursor_row(), cursor_column() - 1); +} + void Terminal::DSR(Parameters params) { if (params.size() == 1 && params[0] == 5) { @@ -991,12 +1007,18 @@ void Terminal::execute_escape_sequence(Intermediates intermediates, bool ignore, case '\\': // ST (string terminator) -- do nothing return; + case '6': + DECBI(); + return; case '7': DECSC(); return; case '8': DECRC(); return; + case '9': + DECFI(); + return; } } else if (intermediates[0] == '#') { switch (last_byte) { diff --git a/Userland/Libraries/LibVT/Terminal.h b/Userland/Libraries/LibVT/Terminal.h index ea719935ba..3087a05c4f 100644 --- a/Userland/Libraries/LibVT/Terminal.h +++ b/Userland/Libraries/LibVT/Terminal.h @@ -304,6 +304,12 @@ protected: // RI - Reverse Index (move up) void RI(); + // DECBI - Back Index + void DECBI(); + + // DECFI - Forward Index + void DECFI(); + // DSR - Device Status Reports void DSR(Parameters); |