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); } });