Files
fusion/.changeset/cli-agent-tui-attach.md
gsxdsm 57631c749f feat(cli): TUI full-screen attach to cli-agent sessions (U14)
Suspend-and-handoff passthrough from the Ink TUI to a cli-agent PTY session:
mint an attach ticket, open the cli-session WebSocket, enter the alternate
screen + raw mode, stream WS scrollback/data frames to stdout, frame stdin
bytes into input messages, propagate resizes, and ACK consumed bytes for flow
control. Detach chord Ctrl-] restores the terminal and remounts Ink; a dropped
WS surfaces the error and restores the terminal cleanly.

Untrusted terminal output is neutralized through the same hardening filter the
dashboard WS bridge uses (re-exported from @fusion/dashboard) so OSC 52, non-
http(s) OSC 8 links, and device-status queries are stripped before reaching the
host TTY — the riskiest leg, since the host terminal honors more sequences than
xterm.js. CJK/double-width bytes pass through verbatim.

- packages/cli/src/commands/dashboard-tui/terminal-attach.ts (passthrough loop +
  injectable WS transport for tests)
- controller.openTerminalAttach() Ink integration (unmount/run/remount)
- adds `ws` runtime dep to packages/cli
- re-exports neutralizeTerminalOutput/flushTerminalOutput from @fusion/dashboard

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:56:10 -07:00

708 B

@runfusion/fusion
@runfusion/fusion
minor

Add full-screen TUI attach to cli-agent sessions (U14). The Ink dashboard TUI can hand the terminal to a CLI agent session as a raw passthrough: it enters the alternate screen, streams WebSocket terminal bytes to stdout and stdin keystrokes back as input frames, propagates resizes, and ACKs consumed bytes for flow control. The detach chord (Ctrl-]) restores the TUI cleanly, and a dropped connection surfaces an error and restores the terminal. Untrusted terminal output is neutralized through the same hardening filter the dashboard WS bridge uses (OSC 52 clipboard writes, non-http(s) OSC 8 links, and device-status queries are stripped before reaching the host TTY).