mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 08:03:39 +00:00
fix(coding-agent): ignore SIGINT while process is suspended (#1668)
Add a no-op SIGINT handler before sending SIGTSTP in handleCtrlZ(). Remove it on SIGCONT. Prevents Ctrl+C from killing the backgrounded process.
This commit is contained in:
parent
9a0a8d7ccb
commit
0b4dea466d
1 changed files with 6 additions and 0 deletions
|
|
@ -2612,8 +2612,14 @@ export class InteractiveMode {
|
|||
}
|
||||
|
||||
private handleCtrlZ(): void {
|
||||
// Ignore SIGINT while suspended so Ctrl+C in the terminal does not
|
||||
// kill the backgrounded process. The handler is removed on resume.
|
||||
const ignoreSigint = () => {};
|
||||
process.on("SIGINT", ignoreSigint);
|
||||
|
||||
// Set up handler to restore TUI when resumed
|
||||
process.once("SIGCONT", () => {
|
||||
process.removeListener("SIGINT", ignoreSigint);
|
||||
this.ui.start();
|
||||
this.ui.requestRender(true);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue