fix(core)#20941: reap orphaned descendant processes on PTY abort (#21124)

Co-authored-by: Spencer <spencertang@google.com>
This commit is contained in:
Manav Sharma
2026-03-11 21:06:25 +05:30
committed by GitHub
parent b804fe9662
commit eaf6e8bbb1
5 changed files with 72 additions and 22 deletions

View File

@@ -1181,10 +1181,12 @@ export class ShellExecutionService {
await this.cleanupLogStream(pid);
if (activeChild) {
killProcessGroup({ pid }).catch(() => {});
await killProcessGroup({ pid }).catch(() => {});
this.activeChildProcesses.delete(pid);
} else if (activePty) {
killProcessGroup({ pid, pty: activePty.ptyProcess }).catch(() => {});
await killProcessGroup({ pid, pty: activePty.ptyProcess }).catch(
() => {},
);
try {
(activePty.ptyProcess as IPty & { destroy?: () => void }).destroy?.();
} catch {