Resume the child process first
This commit is contained in:
parent
d5194ede9e
commit
766ae27fee
1 changed files with 9 additions and 5 deletions
10
src/cli.ts
10
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
|
||||
// Give child time to wake up, then trigger redraw
|
||||
setTimeout(() => {
|
||||
if (pty && !isExiting) {
|
||||
const { cols, rows } = getTerminalSize();
|
||||
pty.resize(cols, rows);
|
||||
pty.write("\x0c"); // Ctrl+L forces TUI redraw
|
||||
process.kill(pty.pid, "SIGWINCH"); // Tell child window changed
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue