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