forked from qt-creator/qt-creator
Utils: Delay close signal in pty process
The close signal of the conpty process needs to be delayed as it otherwise might arrive before the last output of the process. This should be fixed in the future by using overlapped io for the pipes. Change-Id: I49fe4863672a0b14f5766bbe5ee7b1d8894594ca Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
2
src/libs/3rdparty/libptyqt/conptyprocess.cpp
vendored
2
src/libs/3rdparty/libptyqt/conptyprocess.cpp
vendored
@@ -184,7 +184,7 @@ bool ConPtyProcess::startProcess(const QString &executable,
|
|||||||
if (!m_aboutToDestruct)
|
if (!m_aboutToDestruct)
|
||||||
emit notifier()->aboutToClose();
|
emit notifier()->aboutToClose();
|
||||||
m_shellCloseWaitNotifier->setEnabled(false);
|
m_shellCloseWaitNotifier->setEnabled(false);
|
||||||
});
|
}, Qt::QueuedConnection);
|
||||||
|
|
||||||
//this code runned in separate thread
|
//this code runned in separate thread
|
||||||
m_readThread = QThread::create([this]() {
|
m_readThread = QThread::create([this]() {
|
||||||
|
6
src/libs/3rdparty/libptyqt/conptyprocess.h
vendored
6
src/libs/3rdparty/libptyqt/conptyprocess.h
vendored
@@ -115,11 +115,7 @@ public:
|
|||||||
|
|
||||||
void emitReadyRead()
|
void emitReadyRead()
|
||||||
{
|
{
|
||||||
//for emit signal from PtyBuffer own thread
|
emit readyRead();
|
||||||
QTimer::singleShot(1, this, [this]()
|
|
||||||
{
|
|
||||||
emit readyRead();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user