From c82d7ccdcde982b40ecb6690af2dd182fd8dba75 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Mon, 15 May 2023 11:03:16 +0200 Subject: [PATCH] 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 --- src/libs/3rdparty/libptyqt/conptyprocess.cpp | 2 +- src/libs/3rdparty/libptyqt/conptyprocess.h | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/libs/3rdparty/libptyqt/conptyprocess.cpp b/src/libs/3rdparty/libptyqt/conptyprocess.cpp index 687d3116f5a..b9a4afd1262 100644 --- a/src/libs/3rdparty/libptyqt/conptyprocess.cpp +++ b/src/libs/3rdparty/libptyqt/conptyprocess.cpp @@ -184,7 +184,7 @@ bool ConPtyProcess::startProcess(const QString &executable, if (!m_aboutToDestruct) emit notifier()->aboutToClose(); m_shellCloseWaitNotifier->setEnabled(false); - }); + }, Qt::QueuedConnection); //this code runned in separate thread m_readThread = QThread::create([this]() { diff --git a/src/libs/3rdparty/libptyqt/conptyprocess.h b/src/libs/3rdparty/libptyqt/conptyprocess.h index ac940489816..d4ffd62b7ee 100644 --- a/src/libs/3rdparty/libptyqt/conptyprocess.h +++ b/src/libs/3rdparty/libptyqt/conptyprocess.h @@ -115,11 +115,7 @@ public: void emitReadyRead() { - //for emit signal from PtyBuffer own thread - QTimer::singleShot(1, this, [this]() - { - emit readyRead(); - }); + emit readyRead(); } private: