test: force exit interactive pty with double Ctrl+C

This commit is contained in:
mkorwel
2026-04-21 15:39:05 +00:00
parent 4f162ecd2c
commit 559983098e
+3 -5
View File
@@ -302,11 +302,6 @@ export class InteractiveRun {
if (this._isDead) return;
return new Promise<void>((resolve) => {
const timer = setTimeout(() => {
try {
process.kill(this.ptyProcess.pid, 'SIGKILL');
} catch (e) {
// Ignore if already dead
}
resolve(); // Resolve anyway to avoid hanging tests!
}, 5000); // Wait 5 seconds
@@ -314,6 +309,9 @@ export class InteractiveRun {
clearTimeout(timer);
resolve();
});
// Send double Ctrl+C to force exit
this.ptyProcess.write('\x03\x03');
this.ptyProcess.kill();
});
}