Files
loki/docs
Mao NakamotoandClaude Opus 4.8 842e26ea7f refactor(terminal): merge two xterm wrappers into one transport-parameterized view (P4)
WorkspaceTerminal (server PTY) and TerminalView (machine peek) were
near-duplicate xterm wrappers — the input-buffering race fix was
copy-pasted in both. Merge into one src/components/terminal/TerminalView.tsx
parameterized by a TerminalTransport (terminal-transport.ts):
- workspaceTransport(id) → server-owned PTY (/api/workspaces/[id])
- runnerTransport(tab)   → Fleet Runner machine PTY (peek-stream + rawkey)

The view owns xterm, the shared input buffer (race fix now in ONE place),
fit/resize and chrome; the transport owns I/O. Delivers the 'same xterm
view, two substrates' the TerminalSurface doc-comment promised. A third
substrate is a third factory, no view change. All 4 call sites migrated;
old control/WorkspaceTerminal.tsx + control/TerminalView.tsx deleted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 19:37:32 +02:00
..