diff --git a/src/terminal.cpp b/src/terminal.cpp index 227de61..5244ebc 100644 --- a/src/terminal.cpp +++ b/src/terminal.cpp @@ -297,14 +297,7 @@ void Terminal::insertInBuffer(const QString& chars) } } else if(ch.toLatin1()=='\t') { //tab - if(cursorPos().y() <= iTabStops.size()) { - for(int i=0; i cursorPos().x()) { - setCursorPos(QPoint( iTabStops[cursorPos().y()-1][i], cursorPos().y() )); - break; - } - } - } + forwardTab(); } else if(ch.toLatin1()==14 || ch.toLatin1()==15) { //SI and SO, related to character set... ignore } @@ -457,6 +450,30 @@ void Terminal::clearAll(bool wholeBuffer) setCursorPos(QPoint(1,1)); } +void Terminal::backwardTab(void) +{ + if(cursorPos().y() <= iTabStops.size()) { + for(int i=iTabStops[cursorPos().y()-1].count()-1; i>=0; i--) { + if(iTabStops[cursorPos().y()-1][i] < cursorPos().x()) { + setCursorPos(QPoint( iTabStops[cursorPos().y()-1][i], cursorPos().y() )); + break; + } + } + } +} + +void Terminal::forwardTab(void) +{ + if(cursorPos().y() <= iTabStops.size()) { + for(int i=0; i cursorPos().x()) { + setCursorPos(QPoint( iTabStops[cursorPos().y()-1][i], cursorPos().y() )); + break; + } + } + } +} + void Terminal::ansiSequence(const QString& seq) { @@ -609,6 +626,43 @@ void Terminal::ansiSequence(const QString& seq) } break; + case 'X': + if(!extra.isEmpty() || (params.count()>1)) { + unhandled=true; + break; + } + if (params.count()==0) { + params.append(1); + } + eraseLineAtCursor(cursorPos().x(),cursorPos().x()+(params.at(0)?params.at(0)-1:0)); + break; + + case 'I': + if(!extra.isEmpty() || (params.count()>1)) { + unhandled=true; + break; + } + if (params.count()==0) { + params.append(1); + } + for (int i=0;i1)) { + unhandled=true; + break; + } + if (params.count()==0) { + params.append(1); + } + for (int i=0;i