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.

feat: remove filtering of Ctrl+C characters from terminal input and paste streams

0xken15c4ed39df7ae8
diff --git a/cli/src/lib/terminalStreamManager.spec.ts b/cli/src/lib/terminalStreamManager.spec.ts
index 94796f7e3..bd6da16e7 100644
--- a/cli/src/lib/terminalStreamManager.spec.ts
+++ b/cli/src/lib/terminalStreamManager.spec.ts
@@ -191,9 +191,9 @@ describe('TerminalStreamManager', () => {
expect(stream.pastes).toEqual([longPaste])
expect(stream.writes).toHaveLength(0)
- // Ctrl+C pasted alongside real content must never reach the pane, same rule as input().
+ // Ctrl+C pasted alongside real content is forwarded like any other byte, same as input().
await manager.handleFrame('web-1', 'terminal_paste', { streamId, text: 'a\x03b' })
- expect(stream.pastes.at(-1)).toBe('ab')
+ expect(stream.pastes.at(-1)).toBe('a\x03b')
await manager.handleFrame('web-1', 'terminal_paste', { streamId, text: '' })
expect(sent.at(-1)?.payload.code).toBe('TERMINAL_PASTE_INVALID')
diff --git a/cli/src/lib/terminalStreamManager.ts b/cli/src/lib/terminalStreamManager.ts
index 0a53f32f9..e9172d550 100644
--- a/cli/src/lib/terminalStreamManager.ts
+++ b/cli/src/lib/terminalStreamManager.ts
@@ -395,14 +395,7 @@ export class TerminalStreamManager {
}
state.lastInputSeq = inputSeq
state.expiresAt = this.now() + HEARTBEAT_TIMEOUT_MS
- // 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)
+ const result = await state.handle.writeRaw(bytes)
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)
@@ -444,11 +437,7 @@ export class TerminalStreamManager {
return
}
state.expiresAt = this.now() + HEARTBEAT_TIMEOUT_MS
- // Same reason as input(): the engine in the pane has no job-control fallback for an uncaught
- // SIGINT, so a stray 0x03 pasted alongside real content must never reach it.
- const filtered = text.includes('\x03') ? text.replaceAll('\x03', '') : text
- if (filtered.length === 0) return
- const result = await state.handle.pasteRaw(filtered)
+ const result = await state.handle.pasteRaw(text)
if (result.state !== 'succeeded') {
this.sendError(connId, 'TERMINAL_PASTE_FAILED', { streamId: state.streamId, message: result.reason })
if (result.dispatch === 'possibly_executed') await this.sendKeyframe(state)