From 766ae27feebf14655be3aec33c9c65c39986513c Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Fri, 30 Jan 2026 07:46:41 -0500 Subject: [PATCH] Resume the child process first --- src/cli.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 083a270..4d18bbd 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -147,12 +147,16 @@ async function main() { } process.stdin.resume(); if (pty) { - // Resume child process + // Resume child process first process.kill(pty.pid, "SIGCONT"); - // Trigger PTY redraw by sending resize + Ctrl+L - const { cols, rows } = getTerminalSize(); - pty.resize(cols, rows); - pty.write("\x0c"); // Ctrl+L forces TUI redraw + // Give child time to wake up, then trigger redraw + setTimeout(() => { + if (pty && !isExiting) { + const { cols, rows } = getTerminalSize(); + pty.resize(cols, rows); + process.kill(pty.pid, "SIGWINCH"); // Tell child window changed + } + }, 50); } });