diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2014-03-18 20:23:08 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2014-03-19 13:33:32 +0100 |
commit | 0960127ece411c8a937f2a023afa03ebedde6f05 (patch) | |
tree | a17c32c0a00ead5be1e113e7da4d5796e89f1f9f /src/libs/utils/ansiescapecodehandler.cpp | |
parent | 1c953f0ac0749fc71f3446556de0aaed915c6382 (diff) |
Utils: Support \r handling in OutputFormatter
Change-Id: Iae7ddc376cff86eef9d6873bdb6a6ed3f5f7022f
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/libs/utils/ansiescapecodehandler.cpp')
-rw-r--r-- | src/libs/utils/ansiescapecodehandler.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libs/utils/ansiescapecodehandler.cpp b/src/libs/utils/ansiescapecodehandler.cpp index 190093767f..14d5dd8f8e 100644 --- a/src/libs/utils/ansiescapecodehandler.cpp +++ b/src/libs/utils/ansiescapecodehandler.cpp @@ -100,12 +100,18 @@ QList<FormattedText> AnsiEscapeCodeHandler::parseText(const FormattedText &input const QChar semicolon = QLatin1Char(';'); const QChar colorTerminator = QLatin1Char('m'); + const QChar eraseToEol = QLatin1Char('K'); // strippedText always starts with "\e[" QString strippedText = input.text.mid(escapePos); while (!strippedText.isEmpty()) { while (strippedText.startsWith(escape)) { strippedText.remove(0, 2); + // \e[K is not supported. Just strip it. + if (strippedText.startsWith(eraseToEol)) { + strippedText.remove(0, 1); + continue; + } // get the number QString strNumber; QStringList numbers; |