Better color code detection

Should produce less false positives.
This commit is contained in:
tastytea 2022-03-16 21:24:18 +01:00
parent b204b3e855
commit 4d599e877f
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ std::string remove_colors(const std::string &text)
auto newtext{text};
size_t pos{0};
while ((pos = newtext.find('\x1b')) != std::string::npos)
while ((pos = newtext.find("\x1b[")) != std::string::npos)
{
const auto nchars{newtext.find('m', pos) + 1 - pos};
newtext.replace(pos, nchars, "");