From f81a8e92fba55acf65e33206af4e4894b0a248e8 Mon Sep 17 00:00:00 2001 From: dhaern Date: Mon, 5 Oct 2026 06:02:59 +0000 Subject: [PATCH] fix(web): send Ctrl+C input to the PTY Ctrl+C in the web terminal opened the Kill Session confirmation instead of reaching the PTY. Forward all xterm data through onSendInput and remove onInterrupt. Ctrl+C now interrupts the foreground program; Kill Session still kills. --- src/web/client/components/app.tsx | 1 - src/web/client/components/terminal-renderer.tsx | 15 ++------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/web/client/components/app.tsx b/src/web/client/components/app.tsx index a672d385..e8710dda 100644 --- a/src/web/client/components/app.tsx +++ b/src/web/client/components/app.tsx @@ -116,7 +116,6 @@ export function App() { key={activeSession?.id} rawOutput={rawOutput} onSendInput={handleSendInput} - onInterrupt={handleKillSession} disabled={!activeSession || activeSession.status !== 'running'} /> diff --git a/src/web/client/components/terminal-renderer.tsx b/src/web/client/components/terminal-renderer.tsx index e79cc085..16aaecb0 100644 --- a/src/web/client/components/terminal-renderer.tsx +++ b/src/web/client/components/terminal-renderer.tsx @@ -15,7 +15,6 @@ declare global { interface RawTerminalProps { rawOutput: string onSendInput?: (data: string) => void - onInterrupt?: () => void disabled?: boolean } @@ -89,21 +88,11 @@ export class RawTerminal extends React.Component { } private setupInputHandling(term: Terminal) { - const { onSendInput, onInterrupt, disabled } = this.props + const { onSendInput, disabled } = this.props if (disabled) return - const handleData = (data: string) => { - if (data === '\u0003') { - // Ctrl+C - onInterrupt?.() - } else { - // Send input to PTY server (PTY will echo back for interactive sessions) - onSendInput?.(data) - } - } - - term.onData(handleData) + term.onData((data) => onSendInput?.(data)) } override render() {