FrankenTerm

Why FrankenTerm Owns Its Terminal Engine

450 words2 min read3 subsectionsFrom the README at ft 0.15.21

On this page3
The decisionWhy not abstract over both WezTerm and (say) Zellij?Weekly upstream backport workflow

FrankenTerm runs on its own terminal engine — a fully vendored, in-tree fork of WezTerm's mux/termwiz/term crates that the project now owns and has diverged, not a live dependency on upstream WezTerm and not an abstraction layer over arbitrary terminal multiplexers. The terminal-emulation core began as a WezTerm fork; everything built on top of it — the watcher capture loop, the pattern/change-point engine, Robot Mode + MCP, missions and transactions, the policy gate, and the operating-envelope contract — is FrankenTerm's own. This section explains why that engine is vendored and owned rather than wrapped, and how upstream fixes are still harvested.

The decision

The vendored frankenterm/<crate>/ workspace members are first-class. There are currently 42 top-level vendored crate directories and 55 Cargo workspace members when nested derive/lua crates are included. No "implementation boundary" exists between ft and "the mux"; the in-process mux session API is the MuxInterface trait, and the audit under docs/proposals/ft-zoxxq-mux-boundary-truth.md (7,803 LOC examined, 31 importers, 192 concrete-type refs, 0 trait-object consumers) confirmed that nobody actually treats the boundary as polymorphic.

Why not abstract over both WezTerm and (say) Zellij?

  1. Mux semantics aren't interchangeable. WezTerm's pane lifecycle, scrollback model, alt-screen handling, and PDU schema are concretely different from Zellij's or tmux's. Pretending otherwise produces an abstraction that's a worst-of-all-worlds compromise.
  2. The asupersync runtime contract is tighter than upstream WezTerm assumes. ft owns its own async story (Cx-first propagation, structured task ownership, and audited cancellation checkpoints/races). Reusing the vendored crates means we can (and do) patch them when their runtime assumptions don't fit ours.
  3. Test/proof surfaces are easier on owned code. RuntimeProof, the asupersync_test! macro, the Loom model, and the cargo-deny tokio ban only work because we control the entire dependency graph.
  4. Bundle identity matters. FrankenTerm.app is a distinct macOS bundle (separate bundle ID, separate icon, separate update channel). Side-by-side install with upstream WezTerm is intentional.

Weekly upstream backport workflow

We never blindly merge upstream WezTerm. Upstream is treated as a read-only patch source:

  1. Find the upstream baseline from frankenterm/PROVENANCE.json (divergence_point.subject records the imported WezTerm commit).
  2. Fetch upstream into a read-only tracking ref.
  3. Build an inventory of upstream commits since the baseline, grouped by subsystem: term, termwiz, window, config, mux, pty, font, ssh, codec, GUI, mux-server.
  4. Prioritize security, crash, data-loss, terminal-correctness, macOS/windowing, PTY, SSH, and font fixes before cosmetic changes.
  5. For each accepted upstream commit, port the smallest coherent slice manually into the renamed FrankenTerm paths (no regex-based code rewrites). Include the upstream SHA in the commit body as Upstream-WezTerm: <sha>.
  6. Validate package-scoped first (e.g., cargo check -p mux --lib), then broader workspace checks.
  7. Update provenance/backport notes at the end of each batch.

Good backports feel like FrankenTerm-native fixes with traceable upstream provenance, not like a partial re-import of WezTerm.