From 364e3d909e800f71970e6dfada5da7d5b3b7c0e2 Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Fri, 30 Jan 2026 07:47:22 -0500 Subject: [PATCH] Restore terminal to cooked before suspending --- src/cli.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cli.ts b/src/cli.ts index 4d18bbd..9aa94b8 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -181,6 +181,11 @@ async function main() { process.stdin.on("data", (data: Buffer) => { // ctrl+z in raw mode - suspend child and self if (data.length === 1 && data[0] === 0x1a) { + // Restore terminal to cooked mode BEFORE suspending + // This lets the shell work properly while we're stopped + if (process.stdin.isTTY) { + process.stdin.setRawMode(false); + } if (pty) { process.kill(pty.pid, "SIGTSTP"); }