---
id: TASK-35
title: Port folk-multmux shape (xterm.js terminal emulator)
status: To Do
assignee: []
created_date: '2026-02-18 19:50'
labels:
  - shape-port
  - phase-4
  - dev-tools
milestone: m-0
dependencies:
  - TASK-24
  - TASK-25
references:
  - canvas-website/src/shapes/MultmuxShapeUtil.tsx
priority: medium
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Port MultmuxShapeUtil from canvas-website to rspace-online.

Source: canvas-website/src/shapes/MultmuxShapeUtil.tsx (850 lines)
Target: rspace-online/lib/folk-multmux.ts

Features to implement:
- xterm.js terminal emulator in a shape
- WebSocket session management with auto-reconnect
- Session naming and persistence
- Fit addon for responsive terminal sizing
- Shape migration support (versioning)

Dependencies: @xterm/xterm, @xterm/addon-fit (TASK-24)
Needs WebSocket terminal endpoint on server (TASK-25).
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Terminal renders with xterm.js
- [ ] #2 WebSocket connection to terminal session works
- [ ] #3 Auto-reconnect on disconnect
- [ ] #4 Session state persists across page reloads
- [ ] #5 Toolbar button added to canvas.html
<!-- AC:END -->
