# Comparison Frame

> The comparison lens: tmux optimizes a cross-platform C daemon and terminal protocol core, while cmux builds a macOS-native orchestration surface around terminals, browser panes, notifications, and agent hooks. No local STRATEGY.md or docs/solutions context was present, so repository code and tests are the source of truth.

- Repository: tmux/tmux-with-manaflow-ai-cmux
- GitHub: https://github.com/tmux/tmux
- Human wiki: https://grok-wiki.com/public/wiki/tmux-tmux-with-manaflow-ai-cmux-62db34dfaddc
- Complete Markdown: https://grok-wiki.com/public/wiki/tmux-tmux-with-manaflow-ai-cmux-62db34dfaddc/llms-full.txt

## Source Files

- `tmux-tmux:README`
- `tmux-tmux:tmux.h`
- `tmux-tmux:server.c`
- `manaflow-ai-cmux:README.md`
- `manaflow-ai-cmux:Sources/cmuxApp.swift`
- `manaflow-ai-cmux:Sources/Workspace.swift`

---

<details>
<summary>Relevant source files</summary>
The following files were used as context for generating this wiki page:
- [tmux-tmux:README](tmux-tmux/README)
- [tmux-tmux:configure.ac](tmux-tmux/configure.ac)
- [tmux-tmux:compat.h](tmux-tmux/compat.h)
- [tmux-tmux:tmux.h](tmux-tmux/tmux.h)
- [tmux-tmux:tmux-protocol.h](tmux-tmux/tmux-protocol.h)
- [tmux-tmux:server.c](tmux-tmux/server.c)
- [tmux-tmux:client.c](tmux-tmux/client.c)
- [tmux-tmux:cmd-queue.c](tmux-tmux/cmd-queue.c)
- [tmux-tmux:input.c](tmux-tmux/input.c)
- [tmux-tmux:tty-features.c](tmux-tmux/tty-features.c)
- [manaflow-ai-cmux:README.md](manaflow-ai-cmux/README.md)
- [manaflow-ai-cmux:cmux.xcodeproj/project.pbxproj](manaflow-ai-cmux/cmux.xcodeproj/project.pbxproj)
- [manaflow-ai-cmux:Sources/cmuxApp.swift](manaflow-ai-cmux/Sources/cmuxApp.swift)
- [manaflow-ai-cmux:Sources/TabManager.swift](manaflow-ai-cmux/Sources/TabManager.swift)
- [manaflow-ai-cmux:Sources/Workspace.swift](manaflow-ai-cmux/Sources/Workspace.swift)
- [manaflow-ai-cmux:Sources/GhosttyTerminalView.swift](manaflow-ai-cmux/Sources/GhosttyTerminalView.swift)
- [manaflow-ai-cmux:Sources/TerminalNotificationStore.swift](manaflow-ai-cmux/Sources/TerminalNotificationStore.swift)
- [manaflow-ai-cmux:Sources/TerminalController.swift](manaflow-ai-cmux/Sources/TerminalController.swift)
- [manaflow-ai-cmux:Sources/SocketControlSettings.swift](manaflow-ai-cmux/Sources/SocketControlSettings.swift)
- [manaflow-ai-cmux:Sources/Panels/BrowserPanel.swift](manaflow-ai-cmux/Sources/Panels/BrowserPanel.swift)
- [manaflow-ai-cmux:Sources/WorkspaceRemoteConfiguration.swift](manaflow-ai-cmux/Sources/WorkspaceRemoteConfiguration.swift)
</details>

# Comparison Frame

This page compares two terminal-oriented repositories through the lens of implementation ownership. `tmux` optimizes a portable C daemon, terminal protocol core, command queue, and client/server lifecycle. `cmux` builds a macOS-native orchestration surface around terminal panes, browser panes, sidebar metadata, notifications, remote sessions, and agent-facing automation.

No local `STRATEGY.md` or `docs/solutions/**` context was present in the workspace search, so the comparison treats repository code and tests as the source of truth. The provided Page Shape and QA Review guidance was used as portable wiki-routing context; no installed local Compound Engineering skill was proven or executed.

## Executive Comparison

| Lens | tmux-tmux | manaflow-ai-cmux |
|---|---|---|
| Primary product shape | Terminal multiplexer that creates, controls, detaches, and reattaches terminal sessions. | macOS terminal app with vertical tabs, split panes, notifications, in-app browser, SSH/remote support, and automation hooks. |
| Core runtime | C client/server daemon over a Unix socket, using libevent and terminal protocol parsing. | Swift/AppKit/SwiftUI app using Ghostty/libghostty for terminal rendering, Bonsplit for split layout, WebKit for browser surfaces, and local socket control. |
| Portability target | Cross-platform Unix-like systems: OpenBSD, FreeBSD, NetBSD, Linux, macOS, Solaris. | macOS app target with macOS 14 deployment settings and native macOS APIs. |
| Extension surface | Commands, key bindings, control mode, terminal feature negotiation, panes/windows/sessions. | CLI/socket RPC, workspace commands, browser automation surfaces, notification hooks, remote PTY bridge, sidebar metadata. |
| Agent posture | Vendor-agnostic because it is a terminal multiplexer and protocol engine, not an AI-agent product. | Agent-friendly but still provider-neutral: hooks and resume/index code can target multiple agents without requiring a specific model provider. |

Sources: [tmux-tmux:README:3-7](tmux-tmux/README#L3-L7), [tmux-tmux:compat.h:30-49](tmux-tmux/compat.h#L30-L49), [manaflow-ai-cmux:README.md:119-129](manaflow-ai-cmux/README.md#L119-L129), [manaflow-ai-cmux:cmux.xcodeproj/project.pbxproj:1694-1720](manaflow-ai-cmux/cmux.xcodeproj/project.pbxproj#L1694-L1720), [manaflow-ai-cmux:cmux.xcodeproj/project.pbxproj:2519-2663](manaflow-ai-cmux/cmux.xcodeproj/project.pbxproj#L2519-L2663)

## Runtime Ownership Model

```text
tmux-tmux
client process -> Unix socket -> server daemon -> sessions/windows/panes
                                 -> command queue
                                 -> terminal parser/features

manaflow-ai-cmux
macOS app -> TabManager -> Workspace -> Bonsplit panes -> TerminalPanel/Ghostty
                                     -> BrowserPanel/WKWebView
                                     -> NotificationStore
                                     -> socket RPC / remote bridge
```

`tmux` makes the daemon the center of gravity. The client connects to a Unix socket, starts the server when allowed, sends identify information, and then the server owns session state. The server creates and listens on an `AF_UNIX` socket, initializes windows, panes, sessions, key bindings, and message logs, then runs `proc_loop(server_proc, server_loop)`. The command queue is explicit infrastructure: global and per-client queues execute commands and callbacks, wait on external events, and emit control-mode guards.

`cmux` makes the application state tree the center of gravity. `cmuxApp` creates shared `TabManager`, `TerminalNotificationStore`, and sidebar state, configures Ghostty environment variables, and wires the AppDelegate before the main window scene appears. `TabManager` owns workspace selection and creation; `Workspace` owns Bonsplit pane layout and panel maps. Browser and terminal panels are sibling surface types inside that workspace model rather than separate daemon-owned panes.

Sources: [tmux-tmux:client.c:103-140](tmux-tmux/client.c#L103-L140), [tmux-tmux:client.c:283-323](tmux-tmux/client.c#L283-L323), [tmux-tmux:server.c:174-254](tmux-tmux/server.c#L174-L254), [tmux-tmux:server.c:262-305](tmux-tmux/server.c#L262-L305), [tmux-tmux:cmd-queue.c:31-120](tmux-tmux/cmd-queue.c#L31-L120), [tmux-tmux:cmd-queue.c:728-837](tmux-tmux/cmd-queue.c#L728-L837), [manaflow-ai-cmux:Sources/cmuxApp.swift:25-86](manaflow-ai-cmux/Sources/cmuxApp.swift#L25-L86), [manaflow-ai-cmux:Sources/TabManager.swift:898-1015](manaflow-ai-cmux/Sources/TabManager.swift#L898-L1015), [manaflow-ai-cmux:Sources/Workspace.swift:8973-9033](manaflow-ai-cmux/Sources/Workspace.swift#L8973-L9033)

## Terminal Core Versus Terminal Host

`tmux` implements terminal behavior deeply. `tmux.h` defines defaults for config paths, socket roots, TERM, pane/window minimums, key-code masks, Unicode/user/function/mouse key types, and mouse locations. `input.c` contains a terminal input parser based on a DEC/ANSI parser model with UTF-8, OSC, APC, DCS, rename handling, parser buffers, request tracking, and screen-write context. `tty-features.c` maps terminal capabilities such as title setting, OSC 7, mouse, OSC 52 clipboard, OSC 8 hyperlinks, sixel, and OSC 9;4 progress bar.

`cmux` delegates terminal emulation/rendering to Ghostty/libghostty and wraps it in macOS application behavior. `cmuxApp` resolves Ghostty resources, TERM, COLORTERM, and TERM_PROGRAM during launch. `GhosttyApp` is described in code as a minimal Ghostty wrapper using `GhosttyKit.xcframework` for terminal emulation; it owns one process-lifetime Ghostty app and config. The Xcode project links `GhosttyKit.xcframework`, Bonsplit, and Sparkle into the app target.

```c
/* tmux-tmux:server.c */
server_fd = server_create_socket(flags, &cause);
server_add_accept(0);
proc_loop(server_proc, server_loop);
```

```swift
// manaflow-ai-cmux:Sources/Workspace.swift
/// Workspace represents a sidebar tab.
/// Each workspace contains one BonsplitController that manages split panes and nested surfaces.
```

Sources: [tmux-tmux:tmux.h:82-118](tmux-tmux/tmux.h#L82-L118), [tmux-tmux:tmux.h:121-220](tmux-tmux/tmux.h#L121-L220), [tmux-tmux:input.c:31-52](tmux-tmux/input.c#L31-L52), [tmux-tmux:input.c:98-148](tmux-tmux/input.c#L98-L148), [tmux-tmux:tty-features.c:44-115](tmux-tmux/tty-features.c#L44-L115), [tmux-tmux:tty-features.c:350-470](tmux-tmux/tty-features.c#L350-L470), [manaflow-ai-cmux:Sources/cmuxApp.swift:96-143](manaflow-ai-cmux/Sources/cmuxApp.swift#L96-L143), [manaflow-ai-cmux:Sources/GhosttyTerminalView.swift:1673-1724](manaflow-ai-cmux/Sources/GhosttyTerminalView.swift#L1673-L1724), [manaflow-ai-cmux:cmux.xcodeproj/project.pbxproj:204-258](manaflow-ai-cmux/cmux.xcodeproj/project.pbxproj#L204-L258)

## Orchestration And Attention

`tmux` treats panes, clients, windows, jobs, and command execution as the core orchestration units. The server loop repeatedly drains the global queue and identified client queues, runs the client loop, and exits only when configured exit conditions, clients, sessions, and jobs allow it. That design is durable for terminal multiplexing because command execution and session lifetime are independent of the visible terminal client.

`cmux` adds a higher-level attention model on top of terminal surfaces. `TerminalNotification` stores workspace ID, surface ID, panel ID, title, subtitle, body, read state, pane-flash state, and click action. `TerminalNotificationStore` indexes unread state by workspace and surface, exposes latest notifications, and routes additions through policy hooks when configured. Ghostty desktop notification actions are converted into `TerminalNotificationStore.addNotification`, and remote errors can also become sidebar log entries plus notifications.

Sources: [tmux-tmux:server.c:262-305](tmux-tmux/server.c#L262-L305), [tmux-tmux:server.c:484-507](tmux-tmux/server.c#L484-L507), [tmux-tmux:cmd-queue.c:597-680](tmux-tmux/cmd-queue.c#L597-L680), [manaflow-ai-cmux:Sources/TerminalNotificationStore.swift:694-790](manaflow-ai-cmux/Sources/TerminalNotificationStore.swift#L694-L790), [manaflow-ai-cmux:Sources/TerminalNotificationStore.swift:1118-1265](manaflow-ai-cmux/Sources/TerminalNotificationStore.swift#L1118-L1265), [manaflow-ai-cmux:Sources/GhosttyTerminalView.swift:4248-4305](manaflow-ai-cmux/Sources/GhosttyTerminalView.swift#L4248-L4305), [manaflow-ai-cmux:Sources/GhosttyTerminalView.swift:4528-4570](manaflow-ai-cmux/Sources/GhosttyTerminalView.swift#L4528-L4570), [manaflow-ai-cmux:Sources/Workspace.swift:12000-12035](manaflow-ai-cmux/Sources/Workspace.swift#L12000-L12035)

## Browser And Workspace Surface Model

This is the biggest product-level difference. `tmux` has no browser-pane concept in the inspected core; its extensibility is terminal-native. `cmux` explicitly models browser surfaces beside terminal surfaces. `BrowserPanel.swift` imports WebKit and defines browser settings, search engines, proxy status, and theme behavior. `TabManager.openBrowser` can open a browser in the current workspace, reuse a target pane, split right, create a new browser surface, and remember focus. `Workspace` contains a panel map of `any Panel`, so terminal and browser panels share the same split container.

This makes `cmux` better suited for agent workflows that need to inspect a local web app while also driving terminal commands. It also raises UI-specific complexity that `tmux` avoids: focus routing, WebKit lifecycle, drag/drop, browser profiles, and split layout state.

Sources: [manaflow-ai-cmux:README.md:51-56](manaflow-ai-cmux/README.md#L51-L56), [manaflow-ai-cmux:README.md:127-129](manaflow-ai-cmux/README.md#L127-L129), [manaflow-ai-cmux:Sources/Panels/BrowserPanel.swift:1-16](manaflow-ai-cmux/Sources/Panels/BrowserPanel.swift#L1-L16), [manaflow-ai-cmux:Sources/Panels/BrowserPanel.swift:91-157](manaflow-ai-cmux/Sources/Panels/BrowserPanel.swift#L91-L157), [manaflow-ai-cmux:Sources/TabManager.swift:7262-7276](manaflow-ai-cmux/Sources/TabManager.swift#L7262-L7276), [manaflow-ai-cmux:Sources/TabManager.swift:7600-7685](manaflow-ai-cmux/Sources/TabManager.swift#L7600-L7685), [manaflow-ai-cmux:Sources/Workspace.swift:9031-9067](manaflow-ai-cmux/Sources/Workspace.swift#L9031-L9067)

## Automation, BYOC, And BYOK Neutrality

Both projects can support BYOC/BYOK-friendly architectures, but at different layers.

`tmux` is naturally provider-neutral because it knows about terminals, clients, sockets, commands, and terminal protocols rather than AI providers. The protocol header defines internal message types for versioning, identify, command, detach, resize, shell, shutdown, exec, file read/write, and related lifecycle messages. Nothing in the inspected tmux core assumes a hosted model provider, proprietary key format, or agent runtime.

`cmux` is agent-aware but should be integrated as a portable orchestration layer, not as a model-provider dependency. Its README names Claude Code, Codex, OpenCode, and agent hooks as examples, while the code exposes local socket modes (`off`, `cmuxOnly`, `automation`, `password`, `allowAll`) and RPC-style notification/workspace methods. The remote configuration supports SSH, local socket paths, relay fields, and a daemon WebSocket endpoint, so integrations should treat file, repository, or catalog-provided skills as replaceable inputs. BYOK stays outside the UI primitive: agent credentials and model choices should remain owned by the agent/tool process, while `cmux` receives terminal events, notifications, and socket commands.

Sources: [tmux-tmux:tmux-protocol.h:22-71](tmux-tmux/tmux-protocol.h#L22-L71), [tmux-tmux:tmux-protocol.h:73-119](tmux-tmux/tmux-protocol.h#L73-L119), [manaflow-ai-cmux:README.md:78-90](manaflow-ai-cmux/README.md#L78-L90), [manaflow-ai-cmux:README.md:133-139](manaflow-ai-cmux/README.md#L133-L139), [manaflow-ai-cmux:Sources/SocketControlSettings.swift:8-62](manaflow-ai-cmux/Sources/SocketControlSettings.swift#L8-L62), [manaflow-ai-cmux:Sources/TerminalController.swift:10215-10252](manaflow-ai-cmux/Sources/TerminalController.swift#L10215-L10252), [manaflow-ai-cmux:Sources/WorkspaceRemoteConfiguration.swift:66-81](manaflow-ai-cmux/Sources/WorkspaceRemoteConfiguration.swift#L66-L81), [manaflow-ai-cmux:Sources/WorkspaceRemoteConfiguration.swift:275-328](manaflow-ai-cmux/Sources/WorkspaceRemoteConfiguration.swift#L275-L328)

## What Each Project Does Better

### tmux strengths

`tmux` is the stronger reference for daemon durability, protocol ownership, and portable terminal semantics. Its Autoconf setup detects compilers, yacc, pkg-config, headers, platform functions, static-build constraints, fuzzing flags, and replacement functions. Its compatibility header wraps libevent and system differences. The implementation is compactly optimized around terminal sessions rather than app chrome.

Sources: [tmux-tmux:README:9-20](tmux-tmux/README#L9-L20), [tmux-tmux:configure.ac:44-83](tmux-tmux/configure.ac#L44-L83), [tmux-tmux:configure.ac:85-117](tmux-tmux/configure.ac#L85-L117), [tmux-tmux:configure.ac:135-180](tmux-tmux/configure.ac#L135-L180), [tmux-tmux:compat.h:170-285](tmux-tmux/compat.h#L170-L285)

### cmux strengths

`cmux` is the stronger reference for native desktop orchestration around terminals. It understands workspace metadata, Git branch and PR sidebar state, listening ports, browser panes, notifications, remote connection state, session snapshots, and local automation controls. Its workspace creation path carries initial commands, inputs, environment, inherited directory, terminal config, placement, and port ordinal metadata.

Sources: [manaflow-ai-cmux:README.md:119-129](manaflow-ai-cmux/README.md#L119-L129), [manaflow-ai-cmux:Sources/TabManager.swift:2500-2565](manaflow-ai-cmux/Sources/TabManager.swift#L2500-L2565), [manaflow-ai-cmux:Sources/TabManager.swift:1110-1245](manaflow-ai-cmux/Sources/TabManager.swift#L1110-L1245), [manaflow-ai-cmux:Sources/Workspace.swift:9121-9165](manaflow-ai-cmux/Sources/Workspace.swift#L9121-L9165), [manaflow-ai-cmux:Sources/Workspace.swift:15479-15543](manaflow-ai-cmux/Sources/Workspace.swift#L15479-L15543)

## Portable Ideas

| Portable idea | Source repo | How to reuse it |
|---|---|---|
| Keep command execution separate from UI attachment. | tmux | Use a queue or job model so automation can continue when a visual surface is absent. |
| Treat terminal capability support as negotiated feature data. | tmux | Avoid hard-coding terminal behavior into UI-only code; expose feature flags or adapters. |
| Model user attention as structured state. | cmux | Store read/unread, target workspace/surface, flash behavior, and click actions separately from delivery. |
| Keep browser and terminal panes under one workspace/split abstraction. | cmux | Useful when agents need both CLI and web-app inspection in the same task context. |
| Keep provider choice out of orchestration primitives. | both | Make files, repositories, socket commands, hooks, and catalogs portable inputs; do not tie workflow state to one hosted model or API key source. |

Sources: [tmux-tmux:cmd-queue.c:71-92](tmux-tmux/cmd-queue.c#L71-L92), [tmux-tmux:tty-features.c:371-470](tmux-tmux/tty-features.c#L371-L470), [manaflow-ai-cmux:Sources/TerminalNotificationStore.swift:694-739](manaflow-ai-cmux/Sources/TerminalNotificationStore.swift#L694-L739), [manaflow-ai-cmux:Sources/Workspace.swift:8973-9033](manaflow-ai-cmux/Sources/Workspace.swift#L8973-L9033), [manaflow-ai-cmux:Sources/SocketControlSettings.swift:35-62](manaflow-ai-cmux/Sources/SocketControlSettings.swift#L35-L62)

## Closing Summary

The short comparison is: `tmux` is a cross-platform terminal daemon and protocol engine; `cmux` is a macOS-native terminal-orchestration app that composes Ghostty rendering, Bonsplit panes, WebKit browser surfaces, notifications, socket automation, and remote-session machinery. The most reusable architecture lesson is to keep orchestration provider-neutral: terminal/session state, browser actions, notifications, skills, repositories, and model credentials should remain separable so BYOC/BYOK workflows can swap agents, skill sources, or model providers without rewriting the terminal surface. Sources: [tmux-tmux:server.c:105-154](tmux-tmux/server.c#L105-L154), [tmux-tmux:server.c:174-254](tmux-tmux/server.c#L174-L254), [manaflow-ai-cmux:Sources/cmuxApp.swift:206-248](manaflow-ai-cmux/Sources/cmuxApp.swift#L206-L248), [manaflow-ai-cmux:Sources/TerminalController.swift:10467-10530](manaflow-ai-cmux/Sources/TerminalController.swift#L10467-L10530)
