From 559983098e7171842fa006b85794b5ea7afcc0fb Mon Sep 17 00:00:00 2001 From: mkorwel Date: Tue, 21 Apr 2026 15:39:05 +0000 Subject: [PATCH] test: force exit interactive pty with double Ctrl+C --- packages/test-utils/src/test-rig.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/test-utils/src/test-rig.ts b/packages/test-utils/src/test-rig.ts index af387cf86a..b1261ba4d9 100644 --- a/packages/test-utils/src/test-rig.ts +++ b/packages/test-utils/src/test-rig.ts @@ -302,11 +302,6 @@ export class InteractiveRun { if (this._isDead) return; return new Promise((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(); }); }