Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed handling of some escape sequences
Escape sequences such as ^[[;32m were totally ignored.
Now they are handled the way they are in other terminal emulators,
i.e. as if there were a zero before the semicolon: ^[[0;32m
  • Loading branch information
Arusekk authored and David Llewellyn-Jones committed Feb 5, 2021
1 parent c6ed48a commit 8ab5586
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion terminal.cpp
Expand Up @@ -548,11 +548,15 @@ void Terminal::ansiSequence(const QString& seq)
QList<int> params;

int x=1;
while(x<seq.length()-1 && !QChar(seq.at(x)).isNumber())
while(x<seq.length()-1 && !QChar(seq.at(x)).isNumber() && seq.at(x)!=';')
x++;

QList<QString> tmp = seq.mid(x,seq.length()-x-1).split(';');
foreach(QString b, tmp) {
if(b.isEmpty()) {
params.append(0);
continue;
}
bool ok=false;
int t = b.toInt(&ok);
if(ok) {
Expand Down

0 comments on commit 8ab5586

Please sign in to comment.