Skip to content

Commit 6c5b49d

Browse files
DavidsonGomesclaude
andcommitted
fix(terminal): pass cols/rows upfront on start_claude to avoid DA1 echo
When spawning claude through the terminal-server, the pty was born at the default 80x24 from claude-bridge.js and only got resized after the first frame arrived. During that startup window claude sends a DA1 query ("\x1b[c" — device attributes) to detect terminal capabilities, and the xterm.js response ("\x1b[?1;2c") was landing back in the prompt as literal input before the process was ready for it. Visible symptom: the Oracle terminal (and every other agent terminal) started with "0?1;2c0?1;2c" sitting in the input line on first frame. Fix: pass cols/rows in the start_claude options payload so the pty is created at the right size on first spawn. The claude-bridge already destructures `cols = 80, rows = 24` with defaults, so this lines up cleanly — no bridge changes needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ad16369 commit 6c5b49d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

dashboard/frontend/src/components/AgentTerminal.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,23 @@ export default function AgentTerminal({ agent, workingDir, accentColor = '#00FFA
154154
}
155155
} else {
156156
// Start Claude with --agent <agent>
157+
// Pass cols/rows up-front so the pty is born at the right
158+
// size — otherwise claude's DA1 (\x1b[c) / cursor-position
159+
// queries during startup can echo back into the prompt as
160+
// literal text ("0?1;2c0?1;2c") before the first resize
161+
// message arrives.
157162
setStatus('starting')
163+
const fit = fitRef.current
164+
if (fit) {
165+
try { fit.fit() } catch {}
166+
}
158167
ws.send(JSON.stringify({
159168
type: 'start_claude',
160169
options: {
161170
dangerouslySkipPermissions: true,
162171
agent,
172+
cols: term!.cols,
173+
rows: term!.rows,
163174
},
164175
}))
165176
}

0 commit comments

Comments
 (0)