Skip to content

Migrate runtime adapter from Zellij → tmux #2181

Description

@i-trytoohard

Migrate runtime adapter from Zellij → tmux

Problem

The backend runtime is currently hardwired to Zellij. The daemon imports and instantiates zellij.Runtime directly with no abstraction layer:

  • backend/internal/daemon/daemon.go:16 — imports adapters/runtime/zellij
  • backend/internal/daemon/daemon.go:99 — creates runtimeAdapter := zellij.New(zellij.Options{...})
  • backend/internal/daemon/daemon.go:89-96 — zellij-specific socket dir handling (DefaultSocketDir(), ZELLIJ_SOCKET_DIR)
  • backend/internal/daemon/lifecycle_wiring.go:13 — imports zellij package
  • backend/internal/daemon/lifecycle_wiring.go:65startSession takes runtime *zellij.Runtime (concrete type, not interface)
  • backend/internal/daemon/lifecycle_wiring.go:130 — comments reference zellij.Runtime.SendMessage

The ports.Runtime interface (backend/internal/ports/outbound.go:79) only requires Create, Destroy, IsAlive — the contract is clean, but the wiring bypasses it by depending on the concrete zellij.Runtime type.

Goal

Replace Zellij with tmux as the terminal multiplexer runtime. This:

  • Removes a hard dependency on Zellij (less common install base than tmux)
  • Eliminates the macOS socket-path-length workaround (DefaultSocketDir)
  • Aligns with the upstream fork (aoagents/ReverbCode) which already completed this migration in #404

Scope

  1. New adapter: backend/internal/adapters/runtime/tmux/ implementing ports.Runtime — tmux equivalents of Create (new-session), Destroy (kill-session), IsAlive (list-sessions), plus Attach/Stream/SendMessage.
  2. Abstract the wiring: Introduce a runtimeselect (or similar) layer so daemon.go and lifecycle_wiring.go depend on ports.Runtime, not the concrete type. startSession should take ports.Runtime (or runtimeselect.Runtime), not *zellij.Runtime.
  3. Remove zellij-specific code: socket dir handling, DefaultSocketDir(), zellij config/kdl handling, min-version checks (minMajor/minMinor/minPatch).
  4. Update tests: All zellij_test.go references, fake runner patterns, etc.
  5. Docs: Update any references to zellij in docs/ and comments.

Reference

ReverbCode PR #404 "Zellij to Tmux and some other fixes" is a complete prior implementation of this exact migration. The tmux adapter there (backend/internal/adapters/runtime/tmux/tmux.go) can be used as the blueprint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions