diff options
author | Ken Moore <moorekou@gmail.com> | 2016-03-12 23:13:14 -0500 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-03-12 23:13:14 -0500 |
commit | a8a5a405ecc1b4c73e82502f0c6d426a4cc298a5 (patch) | |
tree | 7d4d656c8c19529e071ce08fc7d0a7500865c08f /desktop-utilities/lumina-terminal/TtyProcess.cpp | |
parent | Merge pull request #204 from rezso/master (diff) | |
download | lumina-a8a5a405ecc1b4c73e82502f0c6d426a4cc298a5.tar.gz lumina-a8a5a405ecc1b4c73e82502f0c6d426a4cc298a5.tar.bz2 lumina-a8a5a405ecc1b4c73e82502f0c6d426a4cc298a5.zip |
Add some more work on moving ANSI cursor control codes over to the widget.
Diffstat (limited to 'desktop-utilities/lumina-terminal/TtyProcess.cpp')
-rw-r--r-- | desktop-utilities/lumina-terminal/TtyProcess.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/desktop-utilities/lumina-terminal/TtyProcess.cpp b/desktop-utilities/lumina-terminal/TtyProcess.cpp index 15094f64..8121b365 100644 --- a/desktop-utilities/lumina-terminal/TtyProcess.cpp +++ b/desktop-utilities/lumina-terminal/TtyProcess.cpp @@ -75,7 +75,10 @@ void TTYProcess::writeQtKey(int key){ ba.append("\x1b[D\x1b[K"); break; case Qt::Key_Left: + ba.append("\x1b[D"); + break; case Qt::Key_Right: + ba.append("\x1b[C"); break; case Qt::Key_Up: ba.append("\x1b[A"); @@ -150,7 +153,7 @@ QByteArray TTYProcess::CleanANSI(QByteArray raw, bool &incomplete){ index = raw.indexOf("\x1B]"); } - // GENERIC ANSI CODES + // GENERIC ANSI CODES ((Make sure the output is not cut off in the middle of a code) index = raw.indexOf("\x1B["); while(index>=0){ //CURSOR MOVEMENT @@ -162,10 +165,8 @@ QByteArray TTYProcess::CleanANSI(QByteArray raw, bool &incomplete){ end = i; //found the end of the control code } } - raw = raw.remove(index, 1+end); //control character +1 byte - index = raw.indexOf("\x1B["); + index = raw.indexOf("\x1B[",index+1); //now find the next one } - //qDebug() << " - Removed Color Codes:" << raw; // SYSTEM BELL index = raw.indexOf("\x07"); |