# HG changeset patch # User Jacob Dawid # Date 1327361182 -3600 # Node ID 29c817466160871d10f13369080ae34783750168 # Parent 462e0f609d01050f75740e945784c5279a589188 Removed Konsole namespaces. diff -r 462e0f609d01 -r 29c817466160 libqterminal/BlockArray.cpp --- a/libqterminal/BlockArray.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/BlockArray.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -34,8 +34,6 @@ #include -using namespace Konsole; - static int blocksize = 0; BlockArray::BlockArray() diff -r 462e0f609d01 -r 29c817466160 libqterminal/BlockArray.h --- a/libqterminal/BlockArray.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/BlockArray.h Tue Jan 24 00:26:22 2012 +0100 @@ -25,14 +25,9 @@ #include -//#error Do not use in KDE 2.1 - #define BlockSize (1 << 12) #define ENTRIES ((BlockSize - sizeof(size_t) ) / sizeof(unsigned char)) -namespace Konsole -{ - struct Block { Block() { size = 0; } unsigned char data[ENTRIES]; @@ -120,6 +115,4 @@ }; -} - #endif diff -r 462e0f609d01 -r 29c817466160 libqterminal/Character.h --- a/libqterminal/Character.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/Character.h Tue Jan 24 00:26:22 2012 +0100 @@ -31,9 +31,6 @@ // Local #include "CharacterColor.h" -namespace Konsole -{ - typedef unsigned char LineProperty; static const int LINE_DEFAULT = 0; @@ -204,7 +201,5 @@ QHash extendedCharTable; }; -} - #endif // CHARACTER_H diff -r 462e0f609d01 -r 29c817466160 libqterminal/CharacterColor.h --- a/libqterminal/CharacterColor.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/CharacterColor.h Tue Jan 24 00:26:22 2012 +0100 @@ -28,9 +28,6 @@ // Qt #include -namespace Konsole -{ - /** * An entry in a terminal display's color palette. * @@ -291,8 +288,5 @@ } } - -} - #endif // CHARACTERCOLOR_H diff -r 462e0f609d01 -r 29c817466160 libqterminal/Emulation.cpp --- a/libqterminal/Emulation.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/Emulation.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -49,19 +49,6 @@ #include "TerminalCharacterDecoder.h" #include "ScreenWindow.h" -using namespace Konsole; - -/* ------------------------------------------------------------------------- */ -/* */ -/* Emulation */ -/* */ -/* ------------------------------------------------------------------------- */ - -//#define CNTL(c) ((c)-'@') - -/*! -*/ - Emulation::Emulation() : _currentScreen(0), _codec(0), diff -r 462e0f609d01 -r 29c817466160 libqterminal/Emulation.h --- a/libqterminal/Emulation.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/Emulation.h Tue Jan 24 00:26:22 2012 +0100 @@ -30,15 +30,11 @@ // Qt #include -//#include + #include #include #include - -namespace Konsole -{ - class KeyboardTranslator; class HistoryType; class Screen; @@ -460,6 +456,4 @@ }; -} - #endif // ifndef EMULATION_H diff -r 462e0f609d01 -r 29c817466160 libqterminal/Filter.cpp --- a/libqterminal/Filter.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/Filter.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -34,15 +34,9 @@ #include #include -// KDE -//#include -//#include - // Konsole #include "TerminalCharacterDecoder.h" -using namespace Konsole; - FilterChain::~FilterChain() { QMutableListIterator iter(*this); diff -r 462e0f609d01 -r 29c817466160 libqterminal/Filter.h --- a/libqterminal/Filter.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/Filter.h Tue Jan 24 00:26:22 2012 +0100 @@ -33,9 +33,6 @@ // Local #include "Character.h" -namespace Konsole -{ - /** * A filter processes blocks of text looking for certain patterns (such as URLs or keywords from a list) * and marks the areas which match the filter's patterns as 'hotspots'. @@ -379,5 +376,4 @@ QList* _linePositions; }; -} #endif //FILTER_H diff -r 462e0f609d01 -r 29c817466160 libqterminal/History.cpp --- a/libqterminal/History.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/History.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -37,8 +37,6 @@ // Reasonable line size #define LINE_SIZE 1024 -using namespace Konsole; - /* An arbitrary long scroll. diff -r 462e0f609d01 -r 29c817466160 libqterminal/History.h --- a/libqterminal/History.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/History.h Tue Jan 24 00:26:22 2012 +0100 @@ -20,8 +20,8 @@ 02110-1301 USA. */ -#ifndef TEHISTORY_H -#define TEHISTORY_H +#ifndef HISTORY_H +#define HISTORY_H // Qt #include @@ -32,13 +32,6 @@ #include "BlockArray.h" #include "Character.h" -namespace Konsole -{ - -#if 1 -/* - An extendable tmpfile(1) based buffer. -*/ class HistoryFile { @@ -75,7 +68,6 @@ //when readWriteBalance goes below this threshold, the file will be mmap'ed automatically static const int MAP_THRESHOLD = -1000; }; -#endif ////////////////////////////////////////////////////////////////////// @@ -124,7 +116,6 @@ }; -#if 1 ////////////////////////////////////////////////////////////////////// // File-based history (e.g. file log, no limitation in length) @@ -209,7 +200,6 @@ };*/ -#endif ////////////////////////////////////////////////////////////////////// // Nothing-based history (no history :-) @@ -306,7 +296,7 @@ size_t m_size; }; -#if 1 + class HistoryTypeFile : public HistoryType { public: @@ -337,8 +327,4 @@ unsigned int m_nbLines; }; -#endif - -} - -#endif // TEHISTORY_H +#endif // HISTORY_H diff -r 462e0f609d01 -r 29c817466160 libqterminal/KeyboardTranslator.cpp --- a/libqterminal/KeyboardTranslator.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/KeyboardTranslator.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -35,9 +35,6 @@ #include #include - -using namespace Konsole; - //and this is default now translator - default.keytab from original Konsole const char* KeyboardTranslatorManager::defaultTranslatorText = #include "ExtendedDefaultTranslator.h" diff -r 462e0f609d01 -r 29c817466160 libqterminal/KeyboardTranslator.h --- a/libqterminal/KeyboardTranslator.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/KeyboardTranslator.h Tue Jan 24 00:26:22 2012 +0100 @@ -110,9 +110,6 @@ class QIODevice; class QTextStream; -namespace Konsole -{ - /** * A convertor which maps between key sequences pressed by the user and the * character strings which should be sent to the terminal and commands @@ -648,10 +645,6 @@ } inline KeyboardTranslator::States KeyboardTranslator::Entry::stateMask() const { return _stateMask; } -} - -Q_DECLARE_METATYPE(Konsole::KeyboardTranslator::Entry) -Q_DECLARE_METATYPE(const Konsole::KeyboardTranslator*) #endif // KEYBOARDTRANSLATOR_H diff -r 462e0f609d01 -r 29c817466160 libqterminal/PseudoTerminal.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libqterminal/PseudoTerminal.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -0,0 +1,335 @@ +/* + This file is part of Konsole, an X terminal. + Copyright (C) 1997,1998 by Lars Doelle + + Rewritten for QT4 by e_k , Copyright (C)2008 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. +*/ + +// Own +#include "PseudoTerminal.h" + +// System +#include +#include +#include +#include +#include + +// Qt +#include + +// KDE +#include "kpty.h" + +void PseudoTerminal::donePty() +{ + emit done(exitStatus()); +} + +void PseudoTerminal::setWindowSize(int lines, int cols) +{ + _windowColumns = cols; + _windowLines = lines; + + if (pty()->masterFd() >= 0) + pty()->setWinSize(lines, cols); +} +QSize PseudoTerminal::windowSize() const +{ + return QSize(_windowColumns,_windowLines); +} + +void PseudoTerminal::setXonXoff(bool enable) +{ + _xonXoff = enable; + + if (pty()->masterFd() >= 0) + { + struct ::termios ttmode; + pty()->tcGetAttr(&ttmode); + if (!enable) + ttmode.c_iflag &= ~(IXOFF | IXON); + else + ttmode.c_iflag |= (IXOFF | IXON); + if (!pty()->tcSetAttr(&ttmode)) + qWarning("Unable to set terminal attributes."); + } +} + +void PseudoTerminal::setUtf8Mode(bool enable) +{ +#ifdef IUTF8 // XXX not a reasonable place to check it. + _utf8 = enable; + + if (pty()->masterFd() >= 0) + { + struct ::termios ttmode; + pty()->tcGetAttr(&ttmode); + if (!enable) + ttmode.c_iflag &= ~IUTF8; + else + ttmode.c_iflag |= IUTF8; + if (!pty()->tcSetAttr(&ttmode)) + qWarning("Unable to set terminal attributes."); + } +#endif +} + +void PseudoTerminal::setErase(char erase) +{ + _eraseChar = erase; + + if (pty()->masterFd() >= 0) + { + struct ::termios ttmode; + + pty()->tcGetAttr(&ttmode); + + ttmode.c_cc[VERASE] = erase; + + if (!pty()->tcSetAttr(&ttmode)) + qWarning("Unable to set terminal attributes."); + } +} + +char PseudoTerminal::erase() const +{ + if (pty()->masterFd() >= 0) + { + qDebug() << "Getting erase char"; + struct ::termios ttyAttributes; + pty()->tcGetAttr(&ttyAttributes); + return ttyAttributes.c_cc[VERASE]; + } + + return _eraseChar; +} + +void PseudoTerminal::addEnvironmentVariables(const QStringList& environment) +{ + QListIterator iter(environment); + while (iter.hasNext()) + { + QString pair = iter.next(); + + // split on the first '=' character + int pos = pair.indexOf('='); + + if ( pos >= 0 ) + { + QString variable = pair.left(pos); + QString value = pair.mid(pos+1); + + //kDebug() << "Setting environment pair" << variable << + // " set to " << value; + + setEnvironment(variable,value); + } + } +} + +int PseudoTerminal::start(const QString& program, + const QStringList& programArguments, + const QStringList& environment, + ulong winid, + bool addToUtmp, + int masterFd, + int slaveFd +// const QString& dbusService, +// const QString& dbusSession) + ) +{ + clearArguments(); + + setBinaryExecutable(program.toLatin1()); + + addEnvironmentVariables(environment); + + QStringListIterator it( programArguments ); + while (it.hasNext()) + arguments.append( it.next().toUtf8() ); + +// if ( !dbusService.isEmpty() ) +// setEnvironment("KONSOLE_DBUS_SERVICE",dbusService); +// if ( !dbusSession.isEmpty() ) +// setEnvironment("KONSOLE_DBUS_SESSION", dbusSession); + + setEnvironment("WINDOWID", QString::number(winid)); + + // unless the LANGUAGE environment variable has been set explicitly + // set it to a null string + // this fixes the problem where KCatalog sets the LANGUAGE environment + // variable during the application's startup to something which + // differs from LANG,LC_* etc. and causes programs run from + // the terminal to display mesages in the wrong language + // + // this can happen if LANG contains a language which KDE + // does not have a translation for + // + // BR:149300 + if (!environment.contains("LANGUAGE")) + setEnvironment("LANGUAGE",QString()); + + setUsePty(All, addToUtmp, masterFd, slaveFd); + + pty()->open(); + + struct ::termios ttmode; + pty()->tcGetAttr(&ttmode); + if (!_xonXoff) + ttmode.c_iflag &= ~(IXOFF | IXON); + else + ttmode.c_iflag |= (IXOFF | IXON); +#ifdef IUTF8 // XXX not a reasonable place to check it. + if (!_utf8) + ttmode.c_iflag &= ~IUTF8; + else + ttmode.c_iflag |= IUTF8; +#endif + + if (_eraseChar != 0) + ttmode.c_cc[VERASE] = _eraseChar; + + if (!pty()->tcSetAttr(&ttmode)) + qWarning("Unable to set terminal attributes."); + + pty()->setWinSize(_windowLines, _windowColumns); + + if ( K3Process::start(NotifyOnExit, (Communication) (Stdin | Stdout)) == false ) + return -1; + + resume(); // Start... + return 0; + +} + +void PseudoTerminal::setWriteable(bool writeable) +{ + struct stat sbuf; + stat(pty()->ttyName(), &sbuf); + if (writeable) + chmod(pty()->ttyName(), sbuf.st_mode | S_IWGRP); + else + chmod(pty()->ttyName(), sbuf.st_mode & ~(S_IWGRP|S_IWOTH)); +} + +PseudoTerminal::PseudoTerminal() + : _bufferFull(false), + _windowColumns(0), + _windowLines(0), + _eraseChar(0), + _xonXoff(true), + _utf8(true) +{ + connect(this, SIGNAL(receivedStdout(K3Process *, char *, int )), + this, SLOT(dataReceived(K3Process *,char *, int))); + connect(this, SIGNAL(processExited(K3Process *)), + this, SLOT(donePty())); + connect(this, SIGNAL(wroteStdin(K3Process *)), + this, SLOT(writeReady())); + _pty = new KPty; + + setUsePty(All, false, -1, -1); // utmp will be overridden later +} + +PseudoTerminal::PseudoTerminal(int masterFd, int slaveFd) + : _bufferFull(false), + _windowColumns(0), + _windowLines(0), + _eraseChar(0), + _xonXoff(true), + _utf8(true) +{ + connect(this, SIGNAL(receivedStdout(K3Process *, char *, int )), + this, SLOT(dataReceived(K3Process *,char *, int))); + connect(this, SIGNAL(processExited(K3Process *)), + this, SLOT(donePty())); + connect(this, SIGNAL(wroteStdin(K3Process *)), + this, SLOT(writeReady())); + _pty = new KPty(masterFd, slaveFd); + + setUsePty(All, false, masterFd, slaveFd); // utmp will be overridden later +} + +PseudoTerminal::~PseudoTerminal() +{ + delete _pty; +} + +void PseudoTerminal::writeReady() +{ + _pendingSendJobs.erase(_pendingSendJobs.begin()); + _bufferFull = false; + doSendJobs(); +} + +void PseudoTerminal::doSendJobs() { + if(_pendingSendJobs.isEmpty()) + { + emit bufferEmpty(); + return; + } + + SendJob& job = _pendingSendJobs.first(); + + + if (!writeStdin( job.data(), job.length() )) + { + qWarning("Pty::doSendJobs - Could not send input data to terminal process."); + return; + } + _bufferFull = true; +} + +void PseudoTerminal::appendSendJob(const char* s, int len) +{ + _pendingSendJobs.append(SendJob(s,len)); +} + +void PseudoTerminal::sendData(const char* s, int len) +{ + appendSendJob(s,len); + if (!_bufferFull) + doSendJobs(); +} + +void PseudoTerminal::dataReceived(K3Process *,char *buf, int len) +{ + emit receivedData(buf,len); +} + +void PseudoTerminal::lockPty(bool lock) +{ + if (lock) + suspend(); + else + resume(); +} + +int PseudoTerminal::foregroundProcessGroup() const +{ + int pid = tcgetpgrp(pty()->masterFd()); + + if ( pid != -1 ) + { + return pid; + } + + return 0; +} + diff -r 462e0f609d01 -r 29c817466160 libqterminal/PseudoTerminal.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libqterminal/PseudoTerminal.h Tue Jan 24 00:26:22 2012 +0100 @@ -0,0 +1,241 @@ +/* + This file is part of Konsole, KDE's terminal emulator. + + Copyright (C) 2007 by Robert Knight + Copyright (C) 1997,1998 by Lars Doelle + + Rewritten for QT4 by e_k , Copyright (C)2008 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. +*/ + +#ifndef PTY_H +#define PTY_H + +// Qt +#include +#include +#include +#include + +#include "k3process.h" + +/** + * The Pty class is used to start the terminal process, + * send data to it, receive data from it and manipulate + * various properties of the pseudo-teletype interface + * used to communicate with the process. + * + * To use this class, construct an instance and connect + * to the sendData slot and receivedData signal to + * send data to or receive data from the process. + * + * To start the terminal process, call the start() method + * with the program name and appropriate arguments. + */ +class PseudoTerminal: public K3Process +{ +Q_OBJECT + + public: + + /** + * Constructs a new Pty. + * + * Connect to the sendData() slot and receivedData() signal to prepare + * for sending and receiving data from the terminal process. + * + * To start the terminal process, call the run() method with the + * name of the program to start and appropriate arguments. + */ + PseudoTerminal(); + PseudoTerminal(int masterFd, int slaveFd); + + ~PseudoTerminal(); + + /** + * Starts the terminal process. + * + * Returns 0 if the process was started successfully or non-zero + * otherwise. + * + * @param program Path to the program to start + * @param arguments Arguments to pass to the program being started + * @param environment A list of key=value pairs which will be added + * to the environment for the new process. At the very least this + * should include an assignment for the TERM environment variable. + * @param winid Specifies the value of the WINDOWID environment variable + * in the process's environment. + * @param addToUtmp Specifies whether a utmp entry should be created for + * the pty used. See K3Process::setUsePty() + * @param dbusService Specifies the value of the KONSOLE_DBUS_SERVICE + * environment variable in the process's environment. + * @param dbusSession Specifies the value of the KONSOLE_DBUS_SESSION + * environment variable in the process's environment. + */ + int start( const QString& program, + const QStringList& arguments, + const QStringList& environment, + ulong winid, + bool addToUtmp, + int masterFd, + int slaveFd +// const QString& dbusService, +// const QString& dbusSession + ); + + /** TODO: Document me */ + void setWriteable(bool writeable); + + /** + * Enables or disables Xon/Xoff flow control. + */ + void setXonXoff(bool on); + + /** + * Sets the size of the window (in lines and columns of characters) + * used by this teletype. + */ + void setWindowSize(int lines, int cols); + + /** Returns the size of the window used by this teletype. See setWindowSize() */ + QSize windowSize() const; + + /** TODO Document me */ + void setErase(char erase); + + /** */ + char erase() const; + + /** + * Returns the process id of the teletype's current foreground + * process. This is the process which is currently reading + * input sent to the terminal via. sendData() + * + * If there is a problem reading the foreground process group, + * 0 will be returned. + */ + int foregroundProcessGroup() const; + + /** + * Returns whether the buffer used to send data to the + * terminal process is full. + */ + bool bufferFull() const { return _bufferFull; } + + + public slots: + + /** + * Put the pty into UTF-8 mode on systems which support it. + */ + void setUtf8Mode(bool on); + + /** + * Suspend or resume processing of data from the standard + * output of the terminal process. + * + * See K3Process::suspend() and K3Process::resume() + * + * @param lock If true, processing of output is suspended, + * otherwise processing is resumed. + */ + void lockPty(bool lock); + + /** + * Sends data to the process currently controlling the + * teletype ( whose id is returned by foregroundProcessGroup() ) + * + * @param buffer Pointer to the data to send. + * @param length Length of @p buffer. + */ + void sendData(const char* buffer, int length); + + signals: + + /** + * Emitted when the terminal process terminates. + * + * @param exitCode The status code which the process exited with. + */ + void done(int exitCode); + + /** + * Emitted when a new block of data is received from + * the teletype. + * + * @param buffer Pointer to the data received. + * @param length Length of @p buffer + */ + void receivedData(const char* buffer, int length); + + /** + * Emitted when the buffer used to send data to the terminal + * process becomes empty, i.e. all data has been sent. + */ + void bufferEmpty(); + + + private slots: + + // called when terminal process exits + void donePty(); + // called when data is received from the terminal process + void dataReceived(K3Process*, char* buffer, int length); + // sends the first enqueued buffer of data to the + // terminal process + void doSendJobs(); + // called when the terminal process is ready to + // receive more data + void writeReady(); + + private: + // takes a list of key=value pairs and adds them + // to the environment for the process + void addEnvironmentVariables(const QStringList& environment); + + // enqueues a buffer of data to be sent to the + // terminal process + void appendSendJob(const char* buffer, int length); + + // a buffer of data in the queue to be sent to the + // terminal process + class SendJob { + public: + SendJob() {} + SendJob(const char* b, int len) : buffer(len) + { + memcpy( buffer.data() , b , len ); + } + + const char* data() const { return buffer.constData(); } + int length() const { return buffer.size(); } + private: + QVector buffer; + }; + + QList _pendingSendJobs; + bool _bufferFull; + + int _windowColumns; + int _windowLines; + char _eraseChar; + bool _xonXoff; + bool _utf8; + KPty *_pty; +}; + +#endif // PTY_H diff -r 462e0f609d01 -r 29c817466160 libqterminal/Pty.cpp --- a/libqterminal/Pty.cpp Mon Jan 23 22:52:43 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,341 +0,0 @@ -/* - This file is part of Konsole, an X terminal. - Copyright (C) 1997,1998 by Lars Doelle - - Rewritten for QT4 by e_k , Copyright (C)2008 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301 USA. -*/ - -// Own -#include "Pty.h" - -// System -#include -#include -#include -#include -#include - -// Qt -#include - -// KDE -//#include -//#include -//#include -#include "kpty.h" - -using namespace Konsole; - -void Pty::donePty() -{ - emit done(exitStatus()); -} - -void Pty::setWindowSize(int lines, int cols) -{ - _windowColumns = cols; - _windowLines = lines; - - if (pty()->masterFd() >= 0) - pty()->setWinSize(lines, cols); -} -QSize Pty::windowSize() const -{ - return QSize(_windowColumns,_windowLines); -} - -void Pty::setXonXoff(bool enable) -{ - _xonXoff = enable; - - if (pty()->masterFd() >= 0) - { - struct ::termios ttmode; - pty()->tcGetAttr(&ttmode); - if (!enable) - ttmode.c_iflag &= ~(IXOFF | IXON); - else - ttmode.c_iflag |= (IXOFF | IXON); - if (!pty()->tcSetAttr(&ttmode)) - qWarning("Unable to set terminal attributes."); - } -} - -void Pty::setUtf8Mode(bool enable) -{ -#ifdef IUTF8 // XXX not a reasonable place to check it. - _utf8 = enable; - - if (pty()->masterFd() >= 0) - { - struct ::termios ttmode; - pty()->tcGetAttr(&ttmode); - if (!enable) - ttmode.c_iflag &= ~IUTF8; - else - ttmode.c_iflag |= IUTF8; - if (!pty()->tcSetAttr(&ttmode)) - qWarning("Unable to set terminal attributes."); - } -#endif -} - -void Pty::setErase(char erase) -{ - _eraseChar = erase; - - if (pty()->masterFd() >= 0) - { - struct ::termios ttmode; - - pty()->tcGetAttr(&ttmode); - - ttmode.c_cc[VERASE] = erase; - - if (!pty()->tcSetAttr(&ttmode)) - qWarning("Unable to set terminal attributes."); - } -} - -char Pty::erase() const -{ - if (pty()->masterFd() >= 0) - { - qDebug() << "Getting erase char"; - struct ::termios ttyAttributes; - pty()->tcGetAttr(&ttyAttributes); - return ttyAttributes.c_cc[VERASE]; - } - - return _eraseChar; -} - -void Pty::addEnvironmentVariables(const QStringList& environment) -{ - QListIterator iter(environment); - while (iter.hasNext()) - { - QString pair = iter.next(); - - // split on the first '=' character - int pos = pair.indexOf('='); - - if ( pos >= 0 ) - { - QString variable = pair.left(pos); - QString value = pair.mid(pos+1); - - //kDebug() << "Setting environment pair" << variable << - // " set to " << value; - - setEnvironment(variable,value); - } - } -} - -int Pty::start(const QString& program, - const QStringList& programArguments, - const QStringList& environment, - ulong winid, - bool addToUtmp, - int masterFd, - int slaveFd -// const QString& dbusService, -// const QString& dbusSession) - ) -{ - clearArguments(); - - setBinaryExecutable(program.toLatin1()); - - addEnvironmentVariables(environment); - - QStringListIterator it( programArguments ); - while (it.hasNext()) - arguments.append( it.next().toUtf8() ); - -// if ( !dbusService.isEmpty() ) -// setEnvironment("KONSOLE_DBUS_SERVICE",dbusService); -// if ( !dbusSession.isEmpty() ) -// setEnvironment("KONSOLE_DBUS_SESSION", dbusSession); - - setEnvironment("WINDOWID", QString::number(winid)); - - // unless the LANGUAGE environment variable has been set explicitly - // set it to a null string - // this fixes the problem where KCatalog sets the LANGUAGE environment - // variable during the application's startup to something which - // differs from LANG,LC_* etc. and causes programs run from - // the terminal to display mesages in the wrong language - // - // this can happen if LANG contains a language which KDE - // does not have a translation for - // - // BR:149300 - if (!environment.contains("LANGUAGE")) - setEnvironment("LANGUAGE",QString()); - - setUsePty(All, addToUtmp, masterFd, slaveFd); - - pty()->open(); - - struct ::termios ttmode; - pty()->tcGetAttr(&ttmode); - if (!_xonXoff) - ttmode.c_iflag &= ~(IXOFF | IXON); - else - ttmode.c_iflag |= (IXOFF | IXON); -#ifdef IUTF8 // XXX not a reasonable place to check it. - if (!_utf8) - ttmode.c_iflag &= ~IUTF8; - else - ttmode.c_iflag |= IUTF8; -#endif - - if (_eraseChar != 0) - ttmode.c_cc[VERASE] = _eraseChar; - - if (!pty()->tcSetAttr(&ttmode)) - qWarning("Unable to set terminal attributes."); - - pty()->setWinSize(_windowLines, _windowColumns); - - if ( K3Process::start(NotifyOnExit, (Communication) (Stdin | Stdout)) == false ) - return -1; - - resume(); // Start... - return 0; - -} - -void Pty::setWriteable(bool writeable) -{ - struct stat sbuf; - stat(pty()->ttyName(), &sbuf); - if (writeable) - chmod(pty()->ttyName(), sbuf.st_mode | S_IWGRP); - else - chmod(pty()->ttyName(), sbuf.st_mode & ~(S_IWGRP|S_IWOTH)); -} - -Pty::Pty() - : _bufferFull(false), - _windowColumns(0), - _windowLines(0), - _eraseChar(0), - _xonXoff(true), - _utf8(true) -{ - connect(this, SIGNAL(receivedStdout(K3Process *, char *, int )), - this, SLOT(dataReceived(K3Process *,char *, int))); - connect(this, SIGNAL(processExited(K3Process *)), - this, SLOT(donePty())); - connect(this, SIGNAL(wroteStdin(K3Process *)), - this, SLOT(writeReady())); - _pty = new KPty; - - setUsePty(All, false, -1, -1); // utmp will be overridden later -} - -Pty::Pty(int masterFd, int slaveFd) - : _bufferFull(false), - _windowColumns(0), - _windowLines(0), - _eraseChar(0), - _xonXoff(true), - _utf8(true) -{ - connect(this, SIGNAL(receivedStdout(K3Process *, char *, int )), - this, SLOT(dataReceived(K3Process *,char *, int))); - connect(this, SIGNAL(processExited(K3Process *)), - this, SLOT(donePty())); - connect(this, SIGNAL(wroteStdin(K3Process *)), - this, SLOT(writeReady())); - _pty = new KPty(masterFd, slaveFd); - - setUsePty(All, false, masterFd, slaveFd); // utmp will be overridden later -} - -Pty::~Pty() -{ - delete _pty; -} - -void Pty::writeReady() -{ - _pendingSendJobs.erase(_pendingSendJobs.begin()); - _bufferFull = false; - doSendJobs(); -} - -void Pty::doSendJobs() { - if(_pendingSendJobs.isEmpty()) - { - emit bufferEmpty(); - return; - } - - SendJob& job = _pendingSendJobs.first(); - - - if (!writeStdin( job.data(), job.length() )) - { - qWarning("Pty::doSendJobs - Could not send input data to terminal process."); - return; - } - _bufferFull = true; -} - -void Pty::appendSendJob(const char* s, int len) -{ - _pendingSendJobs.append(SendJob(s,len)); -} - -void Pty::sendData(const char* s, int len) -{ - appendSendJob(s,len); - if (!_bufferFull) - doSendJobs(); -} - -void Pty::dataReceived(K3Process *,char *buf, int len) -{ - emit receivedData(buf,len); -} - -void Pty::lockPty(bool lock) -{ - if (lock) - suspend(); - else - resume(); -} - -int Pty::foregroundProcessGroup() const -{ - int pid = tcgetpgrp(pty()->masterFd()); - - if ( pid != -1 ) - { - return pid; - } - - return 0; -} - -//#include "moc_Pty.cpp" diff -r 462e0f609d01 -r 29c817466160 libqterminal/Pty.h --- a/libqterminal/Pty.h Mon Jan 23 22:52:43 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,247 +0,0 @@ -/* - This file is part of Konsole, KDE's terminal emulator. - - Copyright (C) 2007 by Robert Knight - Copyright (C) 1997,1998 by Lars Doelle - - Rewritten for QT4 by e_k , Copyright (C)2008 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301 USA. -*/ - -#ifndef PTY_H -#define PTY_H - -// Qt -#include -#include -#include -#include - -#include "k3process.h" - - -namespace Konsole -{ - -/** - * The Pty class is used to start the terminal process, - * send data to it, receive data from it and manipulate - * various properties of the pseudo-teletype interface - * used to communicate with the process. - * - * To use this class, construct an instance and connect - * to the sendData slot and receivedData signal to - * send data to or receive data from the process. - * - * To start the terminal process, call the start() method - * with the program name and appropriate arguments. - */ -class Pty: public K3Process -{ -Q_OBJECT - - public: - - /** - * Constructs a new Pty. - * - * Connect to the sendData() slot and receivedData() signal to prepare - * for sending and receiving data from the terminal process. - * - * To start the terminal process, call the run() method with the - * name of the program to start and appropriate arguments. - */ - Pty(); - Pty(int masterFd, int slaveFd); - - ~Pty(); - - /** - * Starts the terminal process. - * - * Returns 0 if the process was started successfully or non-zero - * otherwise. - * - * @param program Path to the program to start - * @param arguments Arguments to pass to the program being started - * @param environment A list of key=value pairs which will be added - * to the environment for the new process. At the very least this - * should include an assignment for the TERM environment variable. - * @param winid Specifies the value of the WINDOWID environment variable - * in the process's environment. - * @param addToUtmp Specifies whether a utmp entry should be created for - * the pty used. See K3Process::setUsePty() - * @param dbusService Specifies the value of the KONSOLE_DBUS_SERVICE - * environment variable in the process's environment. - * @param dbusSession Specifies the value of the KONSOLE_DBUS_SESSION - * environment variable in the process's environment. - */ - int start( const QString& program, - const QStringList& arguments, - const QStringList& environment, - ulong winid, - bool addToUtmp, - int masterFd, - int slaveFd -// const QString& dbusService, -// const QString& dbusSession - ); - - /** TODO: Document me */ - void setWriteable(bool writeable); - - /** - * Enables or disables Xon/Xoff flow control. - */ - void setXonXoff(bool on); - - /** - * Sets the size of the window (in lines and columns of characters) - * used by this teletype. - */ - void setWindowSize(int lines, int cols); - - /** Returns the size of the window used by this teletype. See setWindowSize() */ - QSize windowSize() const; - - /** TODO Document me */ - void setErase(char erase); - - /** */ - char erase() const; - - /** - * Returns the process id of the teletype's current foreground - * process. This is the process which is currently reading - * input sent to the terminal via. sendData() - * - * If there is a problem reading the foreground process group, - * 0 will be returned. - */ - int foregroundProcessGroup() const; - - /** - * Returns whether the buffer used to send data to the - * terminal process is full. - */ - bool bufferFull() const { return _bufferFull; } - - - public slots: - - /** - * Put the pty into UTF-8 mode on systems which support it. - */ - void setUtf8Mode(bool on); - - /** - * Suspend or resume processing of data from the standard - * output of the terminal process. - * - * See K3Process::suspend() and K3Process::resume() - * - * @param lock If true, processing of output is suspended, - * otherwise processing is resumed. - */ - void lockPty(bool lock); - - /** - * Sends data to the process currently controlling the - * teletype ( whose id is returned by foregroundProcessGroup() ) - * - * @param buffer Pointer to the data to send. - * @param length Length of @p buffer. - */ - void sendData(const char* buffer, int length); - - signals: - - /** - * Emitted when the terminal process terminates. - * - * @param exitCode The status code which the process exited with. - */ - void done(int exitCode); - - /** - * Emitted when a new block of data is received from - * the teletype. - * - * @param buffer Pointer to the data received. - * @param length Length of @p buffer - */ - void receivedData(const char* buffer, int length); - - /** - * Emitted when the buffer used to send data to the terminal - * process becomes empty, i.e. all data has been sent. - */ - void bufferEmpty(); - - - private slots: - - // called when terminal process exits - void donePty(); - // called when data is received from the terminal process - void dataReceived(K3Process*, char* buffer, int length); - // sends the first enqueued buffer of data to the - // terminal process - void doSendJobs(); - // called when the terminal process is ready to - // receive more data - void writeReady(); - - private: - // takes a list of key=value pairs and adds them - // to the environment for the process - void addEnvironmentVariables(const QStringList& environment); - - // enqueues a buffer of data to be sent to the - // terminal process - void appendSendJob(const char* buffer, int length); - - // a buffer of data in the queue to be sent to the - // terminal process - class SendJob { - public: - SendJob() {} - SendJob(const char* b, int len) : buffer(len) - { - memcpy( buffer.data() , b , len ); - } - - const char* data() const { return buffer.constData(); } - int length() const { return buffer.size(); } - private: - QVector buffer; - }; - - QList _pendingSendJobs; - bool _bufferFull; - - int _windowColumns; - int _windowLines; - char _eraseChar; - bool _xonXoff; - bool _utf8; - KPty *_pty; -}; - -} - -#endif // PTY_H diff -r 462e0f609d01 -r 29c817466160 libqterminal/QTerminal.cpp --- a/libqterminal/QTerminal.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/QTerminal.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -20,8 +20,6 @@ #include "QTerminal.h" #include "pty.h" -using namespace Konsole; - QTerminal::QTerminal(QWidget *parent) : QWidget(parent) { setMinimumSize(600, 400); diff -r 462e0f609d01 -r 29c817466160 libqterminal/QTerminal.h --- a/libqterminal/QTerminal.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/QTerminal.h Tue Jan 24 00:26:22 2012 +0100 @@ -24,8 +24,6 @@ #include "Session.h" #include "TerminalDisplay.h" -using namespace Konsole; - class QTerminal : public QWidget { Q_OBJECT diff -r 462e0f609d01 -r 29c817466160 libqterminal/Screen.cpp --- a/libqterminal/Screen.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/Screen.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -39,8 +39,6 @@ #include "konsole_wcwidth.h" #include "TerminalCharacterDecoder.h" -using namespace Konsole; - //FIXME: this is emulation specific. Use false for xterm, true for ANSI. //FIXME: see if we can get this from terminfo. #define BS_CLEARS false diff -r 462e0f609d01 -r 29c817466160 libqterminal/Screen.h --- a/libqterminal/Screen.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/Screen.h Tue Jan 24 00:26:22 2012 +0100 @@ -42,11 +42,6 @@ #define MODE_NewLine 5 #define MODES_SCREEN 6 -namespace Konsole -{ - -/*! -*/ struct ScreenParm { int mode[MODES_SCREEN]; @@ -657,6 +652,4 @@ static Character defaultChar; }; -} - #endif // SCREEN_H diff -r 462e0f609d01 -r 29c817466160 libqterminal/ScreenWindow.cpp --- a/libqterminal/ScreenWindow.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/ScreenWindow.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -28,8 +28,6 @@ // Konsole #include "Screen.h" -using namespace Konsole; - ScreenWindow::ScreenWindow(QObject* parent) : QObject(parent) , _windowBuffer(0) @@ -41,6 +39,7 @@ , _scrollCount(0) { } + ScreenWindow::~ScreenWindow() { delete[] _windowBuffer; @@ -293,4 +292,3 @@ emit outputChanged(); } -//#include "moc_ScreenWindow.cpp" diff -r 462e0f609d01 -r 29c817466160 libqterminal/ScreenWindow.h --- a/libqterminal/ScreenWindow.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/ScreenWindow.h Tue Jan 24 00:26:22 2012 +0100 @@ -30,9 +30,6 @@ // Konsole #include "Character.h" -namespace Konsole -{ - class Screen; /** @@ -252,5 +249,4 @@ // the last call to resetScrollCount() }; -} #endif // SCREENWINDOW_H diff -r 462e0f609d01 -r 29c817466160 libqterminal/Session.cpp --- a/libqterminal/Session.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/Session.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -38,13 +38,11 @@ #include #include -#include "Pty.h" +#include "PseudoTerminal.h" #include "TerminalDisplay.h" #include "ShellCommand.h" #include "Vt102Emulation.h" -using namespace Konsole; - int Session::lastSessionId = 0; Session::Session(int masterFd, int slaveFd) : @@ -79,9 +77,9 @@ //create teletype for I/O with shell process if(_masterFd >= 0) { - _shellProcess = new Pty(_masterFd, _slaveFd); + _shellProcess = new PseudoTerminal(_masterFd, _slaveFd); } else { - _shellProcess = new Pty(); + _shellProcess = new PseudoTerminal(); } //create emulation backend @@ -1029,4 +1027,3 @@ } } -//#include "moc_Session.cpp" diff -r 462e0f609d01 -r 29c817466160 libqterminal/Session.h --- a/libqterminal/Session.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/Session.h Tue Jan 24 00:26:22 2012 +0100 @@ -35,13 +35,9 @@ class KProcess; -namespace Konsole -{ - class Emulation; -class Pty; +class PseudoTerminal; class TerminalDisplay; -//class ZModemDialog; /** * Represents a terminal session consisting of a pseudo-teletype and a terminal emulation. @@ -489,7 +485,7 @@ int _uniqueIdentifier; - Pty* _shellProcess; + PseudoTerminal* _shellProcess; Emulation* _emulation; QList _views; @@ -617,6 +613,4 @@ int _masterMode; }; -} - #endif diff -r 462e0f609d01 -r 29c817466160 libqterminal/ShellCommand.cpp --- a/libqterminal/ShellCommand.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/ShellCommand.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -25,9 +25,6 @@ //some versions of gcc(4.3) require explicit include #include - -using namespace Konsole; - // expands environment variables in 'text' // function copied from kdelibs/kio/kio/kurlcompletion.cpp static bool expandEnv(QString& text); diff -r 462e0f609d01 -r 29c817466160 libqterminal/ShellCommand.h --- a/libqterminal/ShellCommand.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/ShellCommand.h Tue Jan 24 00:26:22 2012 +0100 @@ -25,9 +25,6 @@ // Qt #include -namespace Konsole -{ - /** * A class to parse and extract information about shell commands. * @@ -88,7 +85,5 @@ QStringList _arguments; }; -} - #endif // SHELLCOMMAND_H diff -r 462e0f609d01 -r 29c817466160 libqterminal/TerminalCharacterDecoder.cpp --- a/libqterminal/TerminalCharacterDecoder.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/TerminalCharacterDecoder.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -27,9 +27,6 @@ // Qt #include - -using namespace Konsole; - PlainTextDecoder::PlainTextDecoder() : _output(0) , _includeTrailingWhitespace(true) diff -r 462e0f609d01 -r 29c817466160 libqterminal/TerminalCharacterDecoder.h --- a/libqterminal/TerminalCharacterDecoder.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/TerminalCharacterDecoder.h Tue Jan 24 00:26:22 2012 +0100 @@ -28,9 +28,6 @@ class QTextStream; -namespace Konsole -{ - /** * Base class for terminal character decoders * @@ -134,6 +131,4 @@ }; -} - #endif diff -r 462e0f609d01 -r 29c817466160 libqterminal/TerminalDisplay.cpp --- a/libqterminal/TerminalDisplay.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/TerminalDisplay.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -48,8 +48,6 @@ #include "ScreenWindow.h" #include "TerminalCharacterDecoder.h" -using namespace Konsole; - #ifndef loc #define loc(X,Y) ((Y)*_columns+(X)) #endif @@ -150,7 +148,7 @@ // assert for i in [0..31] : vt100extended(vt100_graphics[i]) == i. -unsigned short Konsole::vt100_graphics[32] = +unsigned short vt100_graphics[32] = { // 0/8 1/9 2/10 3/11 4/12 5/13 6/14 7/15 0x0020, 0x25C6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1, 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, @@ -2743,5 +2741,3 @@ _lineSpacing = i; setVTFont(font()); // Trigger an update. } - -//#include "moc_TerminalDisplay.cpp" diff -r 462e0f609d01 -r 29c817466160 libqterminal/TerminalDisplay.h --- a/libqterminal/TerminalDisplay.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/TerminalDisplay.h Tue Jan 24 00:26:22 2012 +0100 @@ -46,11 +46,6 @@ class QHideEvent; class QWidget; -//class KMenu; - -namespace Konsole -{ - extern unsigned short vt100_graphics[32]; class ScreenWindow; @@ -760,6 +755,4 @@ } }; -} - #endif // TERMINALDISPLAY_H diff -r 462e0f609d01 -r 29c817466160 libqterminal/Vt102Emulation.cpp --- a/libqterminal/Vt102Emulation.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/Vt102Emulation.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -23,9 +23,6 @@ // Own #include "Vt102Emulation.h" -//#include - - #if defined(__osf__) || defined(__APPLE__) #define AVOID_XKB #endif @@ -59,7 +56,6 @@ void scrolllock_set_on(); #endif -using namespace Konsole; /* VT102 Terminal Emulation diff -r 462e0f609d01 -r 29c817466160 libqterminal/Vt102Emulation.h --- a/libqterminal/Vt102Emulation.h Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/Vt102Emulation.h Tue Jan 24 00:26:22 2012 +0100 @@ -47,9 +47,6 @@ #define MODE_Ansi (MODES_SCREEN+7) #define MODE_total (MODES_SCREEN+8) -namespace Konsole -{ - struct DECpar { bool mode[MODE_total]; @@ -187,6 +184,4 @@ }; -} - #endif // VT102EMULATION_H diff -r 462e0f609d01 -r 29c817466160 libqterminal/k3process.cpp --- a/libqterminal/k3process.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/k3process.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -65,10 +65,6 @@ #include #include -//#include -//#include -//#include - ////////////////// // private data // @@ -1072,5 +1068,3 @@ return K3Process::start(runmode, comm); } - -//#include "moc_k3process.cpp" diff -r 462e0f609d01 -r 29c817466160 libqterminal/kpty.cpp --- a/libqterminal/kpty.cpp Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/kpty.cpp Tue Jan 24 00:26:22 2012 +0100 @@ -127,9 +127,6 @@ # endif #endif -//#include -//#include // findExe - #include // not defined on HP-UX for example diff -r 462e0f609d01 -r 29c817466160 libqterminal/libqterminal.pro --- a/libqterminal/libqterminal.pro Mon Jan 23 22:52:43 2012 +0100 +++ b/libqterminal/libqterminal.pro Tue Jan 24 00:26:22 2012 +0100 @@ -24,7 +24,6 @@ kpty.h \ kpty_p.h \ LineFont.h \ - Pty.h \ QTerminal.h \ Screen.h \ ScreenWindow.h \ @@ -32,7 +31,8 @@ ShellCommand.h \ TerminalCharacterDecoder.h \ TerminalDisplay.h \ - Vt102Emulation.h + Vt102Emulation.h \ + PseudoTerminal.h SOURCES = BlockArray.cpp \ Emulation.cpp \ Filter.cpp \ @@ -42,7 +42,6 @@ KeyboardTranslator.cpp \ konsole_wcwidth.cpp \ kpty.cpp \ - Pty.cpp \ QTerminal.cpp \ Screen.cpp \ ScreenWindow.cpp \ @@ -50,4 +49,5 @@ ShellCommand.cpp \ TerminalCharacterDecoder.cpp \ TerminalDisplay.cpp \ - Vt102Emulation.cpp + Vt102Emulation.cpp \ + PseudoTerminal.cpp