diff options
author | Ken Moore <moorekou@gmail.com> | 2016-03-10 15:00:36 -0500 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-03-10 15:00:36 -0500 |
commit | 41bdf520b0bbf629a0ca45aea3d665c6c951e0e7 (patch) | |
tree | ac52a62903fb654c9b3944a030392e3116471b9b /desktop-utilities/lumina-terminal/TerminalWidget.cpp | |
parent | Finish cleaning up the TTY Process class, and get it setup for close notifica... (diff) | |
download | lumina-41bdf520b0bbf629a0ca45aea3d665c6c951e0e7.tar.gz lumina-41bdf520b0bbf629a0ca45aea3d665c6c951e0e7.tar.bz2 lumina-41bdf520b0bbf629a0ca45aea3d665c6c951e0e7.zip |
Clean up a lot of the ANSI control codes (tested with csh)
Diffstat (limited to 'desktop-utilities/lumina-terminal/TerminalWidget.cpp')
-rw-r--r-- | desktop-utilities/lumina-terminal/TerminalWidget.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/desktop-utilities/lumina-terminal/TerminalWidget.cpp b/desktop-utilities/lumina-terminal/TerminalWidget.cpp index 6818201a..fa67093b 100644 --- a/desktop-utilities/lumina-terminal/TerminalWidget.cpp +++ b/desktop-utilities/lumina-terminal/TerminalWidget.cpp @@ -9,6 +9,7 @@ #include <QProcessEnvironment> #include <QDebug> #include <QApplication> +#include <QScrollBar> TerminalWidget::TerminalWidget(QWidget *parent, QString dir) : QTextEdit(parent){ //Setup the text widget @@ -43,20 +44,14 @@ void TerminalWidget::aboutToClose(){ // ================== void TerminalWidget::UpdateText(){ //read the data from the process - qDebug() << "UpdateText"; + //qDebug() << "UpdateText"; if(!PROC->isOpen()){ return; } - //if ( PROC->bytesAvailable() <= 0 ) - // return; - - /*qDebug() << "Reading all data"; - char buffer[64]; - ssize_t rtot = read(sn->socket(),&buffer,64); - buffer[rtot]='\0';*/ QByteArray buffer = PROC->readTTY(); - qDebug() << "Process Data:" << QString(buffer); - this->insertPlainText(QString(buffer)); + QString text = QString(buffer); + text.replace("\r\n","\n"); + this->insertPlainText(text); //adjust the scrollbar as needed - + this->verticalScrollBar()->setValue(this->verticalScrollBar()->maximum()); } void TerminalWidget::ShellClosed(){ @@ -85,8 +80,9 @@ void TerminalWidget::keyPressEvent(QKeyEvent *ev){ //QTextEdit::keyPressEvent(ev); //echo the input on the widget }*/ QByteArray ba; ba.append(txt); //avoid any byte conversions - qDebug() << "Forward Input:" << txt << ev->key() << ba; + //qDebug() << "Forward Input:" << txt << ev->key() << ba; PROC->writeTTY(ba); + ev->ignore(); } void TerminalWidget::mousePressEvent(QMouseEvent *ev){ |