From 0012f39384099eca8859f5d4cf5d325ccbd4f98a Mon Sep 17 00:00:00 2001 From: Eladash Date: Tue, 23 Feb 2021 20:47:00 +0200 Subject: [PATCH] Fix TTY handling of control characters --- rpcs3/rpcs3qt/log_frame.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/rpcs3/rpcs3qt/log_frame.cpp b/rpcs3/rpcs3qt/log_frame.cpp index 335775aed2..61676f3973 100644 --- a/rpcs3/rpcs3qt/log_frame.cpp +++ b/rpcs3/rpcs3qt/log_frame.cpp @@ -488,11 +488,8 @@ void log_frame::UpdateUI() buf.resize(size); buf.resize(m_tty_file.read(&buf.front(), buf.size())); - if (buf.find_first_of('\0') != umax) - { - m_tty_file.seek(s64{0} - buf.size(), fs::seek_mode::seek_cur); - break; - } + // Ignore control characters and greater/equal to 0x80 + buf.erase(std::remove_if(buf.begin(), buf.end(), [](s8 c) { return c <= 0x8 || c == 0x7F || (c >= 0xE && c <= 0x1F); }), buf.end()); if (!buf.empty() && m_TTYAct->isChecked()) {