From a8a5a405ecc1b4c73e82502f0c6d426a4cc298a5 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Sat, 12 Mar 2016 23:13:14 -0500 Subject: Add some more work on moving ANSI cursor control codes over to the widget. --- desktop-utilities/lumina-terminal/TtyProcess.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'desktop-utilities/lumina-terminal/TtyProcess.cpp') 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"); -- cgit