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:
Marcus Tillmanns
2023-05-15 11:03:16 +02:00
parent 9dad4ab9d4
commit c82d7ccdcd
2 changed files with 2 additions and 6 deletions

View File

@@ -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]() {

View File

@@ -114,12 +114,8 @@ public:
qint64 size() const { return m_readBuffer.size(); } qint64 size() const { return m_readBuffer.size(); }
void emitReadyRead() void emitReadyRead()
{
//for emit signal from PtyBuffer own thread
QTimer::singleShot(1, this, [this]()
{ {
emit readyRead(); emit readyRead();
});
} }
private: private: