Skip to content

Terminal multiplexer integration: Zellij pane bezel + cmux socket API #30

Description

@bearmug

Context

CCC currently runs as a standalone TUI. When used inside Zellij or cmux, there's an opportunity to integrate directly into the multiplexer's native UI rather than occupying a separate pane.

Zellij: Pane Bezel Integration

Zellij supports per-pane title customization via WASM plugins and the pipe IPC system. A small Rust plugin could show live session status in each pane's border.

Architecture

CCC Daemon → zellij pipe "ccc-status" → WASM Plugin → rename_terminal_pane()

Pane border would show:

┌─ Claude [YOLO] [PR #42 passing] ──────────────┐

Implementation

  1. Rust WASM plugin (~100 lines) — listens on ccc-status pipe, calls rename_terminal_pane(pane_id, title) for each Claude pane
  2. Daemon side — detect $ZELLIJ env var, send JSON updates via zellij pipe CLI when session state changes
  3. Pane mapping — use $ZELLIJ_PANE_ID (available inside each pane) to map Claude sessions to Zellij panes

Plugin permissions needed

  • ReadApplicationState — track pane state
  • ChangeApplicationState — rename panes

Prior art

  • zellij-load — daemon + WASM plugin over pipes (proven pattern)
  • zjstatus — custom status bar plugin

cmux: Socket API Integration

cmux is a native macOS terminal (built on libghostty) purpose-built for AI workflows. It already has:

  • Notification rings around panes (green/yellow/red)
  • Sidebar with git branch, linked PR status, working directory
  • Socket API for scripting/automation
  • OSC escape sequence support for notifications

Investigation needed

  1. Socket API — what commands are available? Can we push session state (autopilot mode, PR status, pending tools) to cmux's sidebar?
  2. Notification rings — can the daemon trigger the ring color changes (green=running, yellow=waiting, red=failing)?
  3. PR linking — cmux sidebar already shows linked PRs. Can CCC feed PR data to cmux instead of duplicating it?
  4. OSC sequences — CCC already uses Ghostty shaders. Can it use OSC escape codes to trigger cmux-native notifications instead of macOS notifications?

Key question

Does CCC need its own TUI at all inside cmux, or should it feed data to cmux's native UI and let cmux handle display?

Scope

  • Zellij: minimal WASM plugin for pane title updates
  • Zellij: daemon detects $ZELLIJ and sends pipe updates
  • cmux: investigate socket API capabilities
  • cmux: prototype pushing session state to cmux sidebar
  • Both: detect multiplexer at startup, adjust behavior accordingly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions