Resume the child process first

This commit is contained in:
Jared Miller 2026-01-30 07:46:41 -05:00
parent d5194ede9e
commit 766ae27fee
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -147,12 +147,16 @@ async function main() {
} }
process.stdin.resume(); process.stdin.resume();
if (pty) { if (pty) {
// Resume child process // Resume child process first
process.kill(pty.pid, "SIGCONT"); process.kill(pty.pid, "SIGCONT");
// Trigger PTY redraw by sending resize + Ctrl+L // Give child time to wake up, then trigger redraw
const { cols, rows } = getTerminalSize(); setTimeout(() => {
pty.resize(cols, rows); if (pty && !isExiting) {
pty.write("\x0c"); // Ctrl+L forces TUI redraw const { cols, rows } = getTerminalSize();
pty.resize(cols, rows);
process.kill(pty.pid, "SIGWINCH"); // Tell child window changed
}
}, 50);
} }
}); });