Files
fusion/packages/dashboard/app/components/TerminalModal.tsx
gsxdsm 58e3933b50 fix(dashboard): bind xterm onData once to prevent input doubling
Move the xterm.onData -> sendInput wiring (and the window resize listener)
from a separate post-init effect into initTerminal itself, so they share
the xterm instance's lifetime. Under StrictMode + Vite Fast Refresh the
separate effect could re-run and attach a second listener to the same
live xterm instance, producing per-character input doubling (every
keystroke -> two pty.write calls -> shell echoes "aabbcc"). The handler
now reads sendInput via a ref, so function-identity changes no longer
require re-binding. Resize listener is removed at every xterm disposal
site (tab switch, modal close, session-invalid replace, reinitialize).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 17:22:44 -07:00

47 KiB