diff --git a/Libraries/LibVT/Terminal.cpp b/Libraries/LibVT/Terminal.cpp index c51def99bb3..80b6c7ad787 100644 --- a/Libraries/LibVT/Terminal.cpp +++ b/Libraries/LibVT/Terminal.cpp @@ -833,7 +833,7 @@ void Terminal::on_char(u8 ch) } } -void Terminal::inject_string(const String& str) +void Terminal::inject_string(const StringView& str) { for (int i = 0; i < str.length(); ++i) on_char(str[i]); diff --git a/Libraries/LibVT/Terminal.h b/Libraries/LibVT/Terminal.h index f41a32bfbb0..ab1a843bb0a 100644 --- a/Libraries/LibVT/Terminal.h +++ b/Libraries/LibVT/Terminal.h @@ -104,6 +104,8 @@ public: int max_history_size() const { return 500; } const NonnullOwnPtrVector& history() const { return m_history; } + void inject_string(const StringView&); + private: typedef Vector ParamVector; @@ -114,7 +116,6 @@ private: void put_character_at(unsigned row, unsigned column, u8 ch); void set_window_title(const String&); - void inject_string(const String&); void unimplemented_escape(); void unimplemented_xterm_escape(); diff --git a/Libraries/LibVT/TerminalWidget.h b/Libraries/LibVT/TerminalWidget.h index 45cf2b54626..829c98158ae 100644 --- a/Libraries/LibVT/TerminalWidget.h +++ b/Libraries/LibVT/TerminalWidget.h @@ -19,6 +19,11 @@ public: virtual ~TerminalWidget() override; void set_pty_master_fd(int fd); + void inject_string(const StringView& string) + { + m_terminal.inject_string(string); + flush_dirty_lines(); + } void create_window();