diff options
-rw-r--r-- | Applications/Terminal/Terminal.cpp | 25 | ||||
-rw-r--r-- | Applications/Terminal/Terminal.h | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/Applications/Terminal/Terminal.cpp b/Applications/Terminal/Terminal.cpp index 2cbdd73fc3..94720d8f62 100644 --- a/Applications/Terminal/Terminal.cpp +++ b/Applications/Terminal/Terminal.cpp @@ -533,6 +533,28 @@ void Terminal::escape$M(const ParamVector& params) } } +void Terminal::escape$P(const ParamVector& params) +{ + int num = 1; + if (params.size() >= 1) + num = params[0]; + + if (num == 0) + num = 1; + + auto& line = this->line(m_cursor_row); + + // Move n characters of line to the left + for (int i = m_cursor_column; i < line.m_length - num; i++) + line.characters[i] = line.characters[i + num]; + + // Fill remainder of line with blanks + for (int i = line.m_length - num; i < line.m_length; i++) + line.characters[i] = ' '; + + line.dirty = true; +} + void Terminal::execute_xterm_command() { m_final = '@'; @@ -611,6 +633,9 @@ void Terminal::execute_escape_sequence(byte final) case 'M': escape$M(params); break; + case 'P': + escape$P(params); + break; case 'S': escape$S(params); break; diff --git a/Applications/Terminal/Terminal.h b/Applications/Terminal/Terminal.h index 7dfb70d0d0..d631416bf6 100644 --- a/Applications/Terminal/Terminal.h +++ b/Applications/Terminal/Terminal.h @@ -61,6 +61,7 @@ private: void escape$J(const ParamVector&); void escape$K(const ParamVector&); void escape$M(const ParamVector&); + void escape$P(const ParamVector&); void escape$G(const ParamVector&); void escape$X(const ParamVector&); void escape$b(const ParamVector&); |