diff options
Diffstat (limited to 'desktop-utilities')
-rw-r--r-- | desktop-utilities/lumina-terminal/TerminalWidget.cpp | 15 | ||||
-rw-r--r-- | desktop-utilities/lumina-terminal/TtyProcess.cpp | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/desktop-utilities/lumina-terminal/TerminalWidget.cpp b/desktop-utilities/lumina-terminal/TerminalWidget.cpp index 2ba4e7fa..b73b9ba3 100644 --- a/desktop-utilities/lumina-terminal/TerminalWidget.cpp +++ b/desktop-utilities/lumina-terminal/TerminalWidget.cpp @@ -338,9 +338,10 @@ QBrush brush = CFMT.background(); //Outgoing Data parsing void TerminalWidget::sendKeyPress(int key){ QByteArray ba; - QString cCol = QString::number(this->textCursor().columnNumber()); //current column number - QString cLine = QString::number(this->document()->toPlainText().left(this->textCursor().position()).count("\n")); - QString maxCol = QString::number( this->document()->toPlainText().section("\n",cLine.toInt(), cLine.toInt()).length()-1); + //QString cCol = QString::number(this->textCursor().columnNumber()); //current column number + //QString cLine = QString::number(this->document()->toPlainText().left(this->textCursor().position()).count("\n")); + //QString maxCol = QString::number( this->document()->toPlainText().section("\n",cLine.toInt(), cLine.toInt()).length()-1); + int fromEnd = this->document()->characterCount() - this->textCursor().position(); //Check for special keys switch(key){ case Qt::Key_Delete: @@ -362,12 +363,12 @@ void TerminalWidget::sendKeyPress(int key){ ba.append("\x1b[B"); break; case Qt::Key_Home: - ba.append( "\x1b[" ); //+cLine+";0H").toLocal8Bit().data() ); - ba.append( cLine.toLocal8Bit().data() ); - ba.append(";0H"); + ba.append("\x1b[H"); break; case Qt::Key_End: - ba.append( QString("\x1b["+cLine+";"+maxCol+"H").toLocal8Bit().data() ); + for(int i=0; i<fromEnd; i++){ + ba.append("\x1b[C"); + } break; } diff --git a/desktop-utilities/lumina-terminal/TtyProcess.cpp b/desktop-utilities/lumina-terminal/TtyProcess.cpp index 542af93d..c5844255 100644 --- a/desktop-utilities/lumina-terminal/TtyProcess.cpp +++ b/desktop-utilities/lumina-terminal/TtyProcess.cpp @@ -18,7 +18,7 @@ bool TTYProcess::startTTY(QString prog, QStringList args, QString workdir){ if(workdir=="~"){ workdir = QDir::homePath(); } QDir::setCurrent(workdir); QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); - setenv("TERM","vt102",1); //VT102 emulation support + setenv("TERM","vt100",1); //VT100 emulation support unsetenv("TERMCAP"); /*setenv("TERMCAP","mvterm|vv100|mvterm emulator with ANSI colors:\ :pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[100m:tc=vt102:",1); //see /etc/termcap as well*/ |