Terminal: Don't forcibly kill conpty process

Sometimes (especially for the git bash.exe) closing a terminal seemed to
not kill the shell process. This seemed to happen because we forcibly
killed the conpty process which we rely on to actually kill the shell.
Since we killed the conpty before it was able to close the shell, the
shell would continue to run. This became evident during debugging, as
the shell was killed if we stepped through the function, thereby
delaying the killing of the conpty process.

Fixes: QTCREATORBUG-32509
Change-Id: I468ec23d8a13c11cbd8d4b31c9a99736b0cdd07c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Marcus Tillmanns
2025-02-18 08:43:26 +01:00
parent f93da92893
commit fce61829b9

View File

@@ -582,7 +582,6 @@ void _ClosePseudoConsoleMembers(_In_ PseudoConsole* pPty)
// has yet to send before we hard kill it.
if (_HandleIsValid(pPty->hConPtyProcess))
{
TerminateProcess(pPty->hConPtyProcess, 0);
CloseHandle(pPty->hConPtyProcess);
pPty->hConPtyProcess = nullptr;
}