diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-06-11 07:31:47 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-06-11 07:32:53 +0200 |
commit | 1372f10dda8dcac10fd1961ec9e7707778fa0bfc (patch) | |
tree | 1c7dda70e2407b56f4727fa6084e605f950ab04d | |
parent | 58a2b9336aed30c7e468003e6a633bf2e79ee826 (diff) | |
download | serenity-1372f10dda8dcac10fd1961ec9e7707778fa0bfc.zip |
Terminal: Add support for REP ('b' final)
Patch contributed by "pd"
-rw-r--r-- | Applications/Terminal/Terminal.cpp | 14 | ||||
-rw-r--r-- | Applications/Terminal/Terminal.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/Applications/Terminal/Terminal.cpp b/Applications/Terminal/Terminal.cpp index 41c52f1fcb..2cbdd73fc3 100644 --- a/Applications/Terminal/Terminal.cpp +++ b/Applications/Terminal/Terminal.cpp @@ -372,6 +372,15 @@ void Terminal::escape$G(const ParamVector& params) set_cursor(m_cursor_row, new_column); } +void Terminal::escape$b(const ParamVector& params) +{ + if (params.size() < 1) + return; + + for (unsigned i = 0; i < params[0]; ++i) + put_character_at(m_cursor_row, m_cursor_column++, m_last_char); +} + void Terminal::escape$d(const ParamVector& params) { int new_row = 1; @@ -617,6 +626,9 @@ void Terminal::execute_escape_sequence(byte final) case 'X': escape$X(params); break; + case 'b': + escape$b(params); + break; case 'd': escape$d(params); break; @@ -714,6 +726,8 @@ void Terminal::put_character_at(unsigned row, unsigned column, byte ch) line.characters[column] = ch; line.attributes[column] = m_current_attribute; line.dirty = true; + + m_last_char = ch; } void Terminal::on_char(byte ch) diff --git a/Applications/Terminal/Terminal.h b/Applications/Terminal/Terminal.h index 4322986008..7dfb70d0d0 100644 --- a/Applications/Terminal/Terminal.h +++ b/Applications/Terminal/Terminal.h @@ -63,6 +63,7 @@ private: void escape$M(const ParamVector&); void escape$G(const ParamVector&); void escape$X(const ParamVector&); + void escape$b(const ParamVector&); void escape$d(const ParamVector&); void escape$m(const ParamVector&); void escape$s(const ParamVector&); @@ -204,4 +205,6 @@ private: CTimer m_cursor_blink_timer; CTimer m_visual_beep_timer; RetainPtr<CConfigFile> m_config; + + byte m_last_char { 0 }; }; |