diff --git a/cockatrice/src/dialogs/dlg_view_log.cpp b/cockatrice/src/dialogs/dlg_view_log.cpp index dc569c92c..7b4e8c617 100644 --- a/cockatrice/src/dialogs/dlg_view_log.cpp +++ b/cockatrice/src/dialogs/dlg_view_log.cpp @@ -4,6 +4,7 @@ #include "../utility/logger.h" #include +#include #include DlgViewLog::DlgViewLog(QWidget *parent) : QDialog(parent) @@ -44,7 +45,12 @@ void DlgViewLog::loadInitialLogBuffer() void DlgViewLog::logEntryAdded(QString message) { - logArea->appendPlainText(message); + static auto colorEscapeCodePattern = QRegularExpression("\033\\[\\d+m"); + + QString sanitizedMessage = message; + sanitizedMessage.replace(colorEscapeCodePattern, ""); + + logArea->appendPlainText(sanitizedMessage); } void DlgViewLog::closeEvent(QCloseEvent * /* event */)