Fix TTY handling of control characters

This commit is contained in:
Eladash 2021-02-23 20:47:00 +02:00 committed by Ivan
parent 0e7e5b59ae
commit 0012f39384
1 changed files with 2 additions and 5 deletions

View File

@ -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())
{