import type { Metadata } from "next"; import { CodeBlock } from "../../components/code-block"; export const metadata: Metadata = { title: "Concepts", description: "How cmux organizes terminals: windows, workspaces, panes, and surfaces. The hierarchy behind the sidebar, splits, and socket API.", }; export default function ConceptsPage() { return ( <>
cmux organizes your terminals in a four-level hierarchy. Understanding these levels helps when using the socket API, CLI, and keyboard shortcuts.
A macOS window. Open multiple windows with ⌘⇧N. Each
window has its own sidebar with independent workspaces.
A sidebar entry. Each workspace contains one or more split panes. Workspaces are what you see listed in the left sidebar.
In the UI and keyboard shortcuts, workspaces are often called “tabs” since they behave like tabs in the sidebar. The socket API and environment variables use the term “workspace”.
| Context | Term used |
|---|---|
| Sidebar UI | Tab |
| Keyboard shortcuts | Workspace or tab |
| Socket API |
workspace
|
| Environment variable |
CMUX_WORKSPACE_ID
|
Shortcuts: ⌘N (new),{" "}
⌘1–⌘9 (jump), ⌘⇧W (close),{" "}
⌘⇧[ / ⌘⇧] (prev/next)
A split region within a workspace. Created by splitting with{" "}
⌘D (right) or ⌘⇧D (down). Navigate between
panes with ⌥⌘ + arrow keys.
Each pane can hold multiple surfaces (tabs within the pane).
A tab within a pane. Each pane has its own tab bar and can hold multiple
surfaces. Created with ⌘T, navigated with{" "}
⌘[ / ⌘] or ⌃1–
⌃9.
Surfaces are the individual terminal or browser sessions you interact
with. Each surface has its own CMUX_SURFACE_ID environment
variable.
The content inside a surface. Currently two types:
Panel is mostly an internal concept. In the socket API and CLI, you interact with surfaces rather than panels directly.
In this example:
| Level | What it is | Created by | Identified by |
|---|---|---|---|
| Window | macOS window |
⌘⇧N
|
— |
| Workspace | Sidebar entry |
⌘N
|
CMUX_WORKSPACE_ID
|
| Pane | Split region |
⌘D / ⌘⇧D
|
Pane ID (socket API) |
| Surface | Tab within pane |
⌘T
|
CMUX_SURFACE_ID
|
| Panel | Terminal or browser | Automatic | Panel ID (internal) |