Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

fix: prevent Ctrl+C signals from being forwarded to the terminal to avoid unintended process termination

0xken15784017e5c106
diff --git a/cli/src/lib/terminalStreamManager.ts b/cli/src/lib/terminalStreamManager.ts
index d9eecbacf..84fcbba1d 100644
--- a/cli/src/lib/terminalStreamManager.ts
+++ b/cli/src/lib/terminalStreamManager.ts
@@ -359,7 +359,14 @@ export class TerminalStreamManager {
}
state.lastInputSeq = inputSeq
state.expiresAt = this.now() + HEARTBEAT_TIMEOUT_MS
- const result = await state.handle.writeRaw(bytes)
+ // Ctrl+C (0x03) is never forwarded to the pane: the engine there has no
+ // local job-control fallback, so an uncaught SIGINT kills it outright
+ // and drops tmux back to a bare shell instead of just interrupting the
+ // current turn. Enforced here too (not just client-side) so it holds
+ // regardless of which client is attached.
+ const filtered = bytes.includes(0x03) ? bytes.filter((b) => b !== 0x03) : bytes
+ if (filtered.length === 0) return
+ const result = await state.handle.writeRaw(filtered)
if (result.state !== 'succeeded') {
this.sendError(state.connId, 'TERMINAL_INPUT_FAILED', { streamId: state.streamId, message: result.reason })
if (result.dispatch === 'possibly_executed') await this.sendKeyframe(state)