fix(coding-agent): handle ctrl+z on windows closes #3191

This commit is contained in:
Mario Zechner
2026-04-16 12:33:47 +02:00
parent eb1cf80b10
commit 624a7f794f
5 changed files with 47 additions and 2 deletions

View File

@@ -52,7 +52,10 @@ export const KEYBINDINGS = {
"app.interrupt": { defaultKeys: "escape", description: "Cancel or abort" },
"app.clear": { defaultKeys: "ctrl+c", description: "Clear editor" },
"app.exit": { defaultKeys: "ctrl+d", description: "Exit when editor is empty" },
"app.suspend": { defaultKeys: "ctrl+z", description: "Suspend to background" },
"app.suspend": {
defaultKeys: process.platform === "win32" ? [] : "ctrl+z",
description: "Suspend to background",
},
"app.thinking.cycle": {
defaultKeys: "shift+tab",
description: "Cycle thinking level",

View File

@@ -2958,6 +2958,11 @@ export class InteractiveMode {
}
private handleCtrlZ(): void {
if (process.platform === "win32") {
this.showStatus("Suspend to background is not supported on Windows");
return;
}
// Keep the event loop alive while suspended. Without this, stopping the TUI
// can leave Node with no ref'ed handles, causing the process to exit on fg
// before the SIGCONT handler gets a chance to restore the terminal.