Skip to content

Chan manual

Terminal & teams

Use terminal commands, rich prompts, drafts, program status, and agent teams.

The terminal and its commands

Open New terminal from Computers, a pane menu, or the command launcher. A standalone terminal works with the machine's filesystem; a workspace terminal also has project search, graph, export, and team commands. Pane and window controls are covered in Navigation.

Every chan terminal is scriptable. chan manages workspaces and devservers. cs (chan shell, also available as chan shell) controls the window and terminal sessions you are working in, from any shell script or program running in them. Run cs --help or add --help to a subcommand for its options.

$chan open .
$cs open README.md
$cs open .
$cs terminal new

chan open . registers and serves the current directory as a workspace; use --here when intentionally opening a subdirectory of a repository. cs open README.md opens a file in the current window, and cs open . opens its file browser. Paths refer to the machine hosting the terminal, including on a devserver.

Terminal walkthrough

Running commands in a Chan terminal.

Control terminal tabs

$cs terminal new --tab-name build
$cs terminal list
$cs terminal scrollback --tab-name build

Give a terminal a name to address it later. cs terminal write sends input, cs terminal restart restarts a session, and cs terminal close ends it. Use --tab-name to select a named session, or --tab-group for a group where supported. scrollback selects one tab by name, not a group. cs terminal list --json provides the session roster for scripts.

Write into another terminal and read its scrollback with cs.

Clipboard shortcuts in the terminal are Cmd+C/Cmd+V on macOS and Ctrl+Shift+C/Ctrl+Shift+V on Windows and Linux. The cs commands below also transfer images and rich text.

Compose and transfer

Rich Prompt

When a terminal needs more than a line, like pasting images into a remote agent or editing a longer prompt, bring up the Rich Prompt bubble over the terminal: press Cmd+Shift+P on macOS (Ctrl+Alt+P on Windows, Linux, and web), or choose "Show/Hide Rich Prompt" from the command launcher's opening list or the terminal's right-click menu. The close button at the bubble's top right hides it and keeps the draft for the next time it is shown. Write Markdown, paste images, and submit with Cmd+Enter on macOS or Ctrl+Enter elsewhere; submissions are queued so writes from other terminals (cs terminal write) do not conflict with your typing. While the bubble is shown, Show Style Toolbar in the terminal's right-click menu (or "Toggle Rich Prompt style toolbar" in the command launcher) floats the editor's formatting toolbar over the text, and Hide Style Toolbar puts it away. The toolbar's source toggle, or Cmd+E on macOS (Ctrl+E on Windows and Linux) in the bubble, switches the draft between rendered Markdown and its source. Terminals spawned with a supported agent automatically select its submit encoding; custom launchers can set CHAN_AGENT. Supported names are agy, claude, codex, gemini, kimi, muse, and opencode. The command-line equivalent is cs terminal write --submit=<agent>.

The Rich Prompt bubble over a terminal running a coding agent: rendered Markdown with a list, a pasted image, and a submit-with-cmd-enter hint
The Rich Prompt bubble over a terminal running an agent on a devserver.

Copy and paste freely

The commands cs copy and cs paste integrate every chan terminal, standalone or workspace, local or on a devserver, with your clipboard: cs copy < photo.png puts stdin on the clipboard (plain text, HTML, or an image), and cs paste > file.png writes it back out as raw bytes. The clipboard belongs to the machine viewing the window, while the command runs wherever the terminal lives: use it locally like pbcopy/pbpaste, copy on a devserver and paste into any app, or move content across devservers by copying on one and pasting on another.

Copy text from one terminal and paste it into a file in another.

Download and upload freely

Similarly, cs download {path} downloads a file or a tarball of the target directory, and cs upload {path} imports files into the target directory through a file picker. Both show the same progress UI as the Inspector, and . means the current directory. This works in local and devserver terminals alike, so files flow between your machine and any chan session.

Drafts and untitled-1/draft.md

Choose New draft from a pane menu or the command launcher. A draft appears as Drafts/untitled/draft.md, then Drafts/untitled-1/draft.md and higher numbered names as needed. It is a Markdown document with a companion directory for attachments. Rich Prompt uses a real draft too, so a longer prompt and its pasted images can be edited together before submission.

Drafts in the file browser is a separate area. In a workspace, its files live in chan's workspace metadata, outside the project directory. The displayed Drafts/… path is not a repository-relative shell path. Drafts stay out of project search and the project graph until you save them into the workspace.

Open a draft from the Drafts group to keep editing. Closing it offers Save to Workspace (Save to Disk in a standalone window), Discard Draft, or Cancel to keep editing. Saving a draft with attachments carries the companion files with it. A directory named Drafts that you create inside your repository is ordinary project content.

Program status: OSC 7501

Programs can report whether they are working, done, blocked, or in error using OSC 7501, the Program Status Protocol that Superlogical specifies for Rex and any other terminal. Chan shows activity and progress in the terminal tab and an attention marker when a program needs you. To read what was reported, right-click the terminal tab and choose Details, or run Toggle details in the Command launcher. While the feature is on and the session has status, Details lists each record with its source, id, state, and the reported app, title, and message, above the tab's queued messages.

It is on by default; turn it off in Settings → Terminal → Program status (OSC 7501). Programs must emit reports for their state to appear; ordinary terminal output does not supply those records. Shell scripts can use cs terminal status:

$cs terminal status working --id build --app cargo --progress 40 --sleep 10
$cs terminal status blocked --id build --kind permission --msg "Waiting for approval" --sleep 10
$cs terminal status done --id build --msg "Tests passed"
$cs terminal status clear --id build

States are idle, working, done, blocked, error, and clear. A blocked report can name permission, question, or auth; progress is an integer from 0 to 100 for working or blocked reports. Each state shows this in the tab and in Details:

ReportIn the tabIn Details
workingThe terminal icon's prompt with a cursor being typed; with --progress, a pie in a ring that fills to the percentage.The record as working, with its progress.
blockedAn amber mark after the name: a shield for permission, a question mark in a circle for question, a key for auth, and a pause sign with no kind. It shows even while its tab is in front.The record as blocked, with its kind.
doneA green check in a circle while unseen.The record as done, seen or not.
errorA red exclamation mark in a circle while unseen.The record as error, seen or not.
idleNo mark.The record as idle.
clearThe cleared records' marks go.The cleared records go.

Hover a blocked, done, or error mark to read the report's state, kind, progress, app, title, and message. When several records stand at once, the tab shows one mark: blocked over error, error over done, and the latest report among equals. A done or error report is seen when it arrives while its tab is in front, the selected tab of the focused pane, or as soon as its tab comes to the front; a seen report has no mark and stays in Details. So a done or error report typed at the prompt of the tab in front shows no mark, and switching away after the report does not make it unseen.

To see those marks, report from the tab under test after a delay, then select another tab within the five seconds. The mark appears on the first tab and clears when you select it again:

$(sleep 5; cs terminal status done --id build --msg "Tests passed") &
$(sleep 5; cs terminal status error --id build --msg "Tests failed") &

The background job reports to the terminal it was started from, since its output still goes to that terminal.

Each report replaces that record, including its optional fields. Use --id to give a subprocess its own record instead of replacing its parent's root record. clear --id build removes that record and its children. The status also appears in cs terminal list; its JSON form includes the reported text for orchestration.

--sleep 10 writes once, then waits ten seconds so you can inspect a transient state from an interactive shell. It accepts whole seconds from 0 to 86400; omitted or 0 returns immediately. Expiry and Ctrl-C write nothing further. Done and error stay until replaced or cleared. Transient states follow the terminal's foreground-job and prompt rules; waiting on the control-socket route keeps only the sender alive.

Use cs terminal list --json to read retained records even when they have no mark.

tmux control mode: tmux -CC

A tmux -CC client prints a marker when it enters control mode, and from then on its output is the control protocol, not screen bytes. Chan reads the marker on the server and keeps the protocol off the screen. A tmux you ran in the terminal enters at once. Any other program in the foreground, such as ssh or Eternal Terminal's et running a remote tmux -CC, or a program printing the marker on its own, raises a banner over the terminal naming that program and its command line, with Allow, Allow for this tab and Deny. Nothing is written to the terminal until you answer; every window attached to the terminal shows the banner, the first answer wins, and no answer in 60 seconds is a deny. A deny writes one newline, which detaches a real tmux, and the terminal draws again. After an allow chan sends a harmless first command and checks the tmux version; a peer that does not answer like tmux, or a tmux older than 3.2, is detached with a note in the terminal.

It is off by default, and the marker is ordinary output until you turn it on in Settings → Terminal → tmux control mode (tmux -CC) or with chan config set terminal.tmux.enabled true. Turning it off again leaves a connection already running alone. To skip the question for a program you run as a habit, list its name in terminal.tmux.trust in server.toml (for example trust = ["ssh", "et"]); tmux itself is always trusted. tmux 3.2 or newer is required.

Once connected, the connection is a card on the Computers screen beside this machine and the devservers, titled tmux -CC on this machine when the tmux you ran is local, tmux -CC on and the devserver's name when you ran it in a devserver terminal, and tmux -CC from command otherwise, tmux -CC from ssh geekom for one reached over ssh. The card works like a devserver's: t asks tmux for a new window, o detaches, and its rows are the connection's windows with focus and show/hide; to end the tmux server, select the card with the check and turn it off or remove it, as with any card. Hiding the connection's last shown window detaches it. The terminal that ran tmux -CC becomes the card's control terminal and stays listed on the card. On the desktop it moves to a hidden control window while the connection runs. In a browser it stays as a tab in the source window, and no separate control page opens. It takes no typing while connected and shows chan's notices. Each tmux window is a chan window of its own, whose panes are tmux's panes split as tmux lays them out. On the desktop the first eight tmux windows open at connect; a window past that is listed hidden on the card, and showing it opens it. In a browser nothing opens by itself: open each window from its row on the card with Open window. None of these windows is saved: they last as long as the connection.

A tmux window's panes are tmux's panes and nothing else: they carry no tab strip, nothing drags into or out of them, and the window's splits are tmux's layout. A split (Cmd+/ or Cmd+Shift+/ on macOS, Ctrl+Alt+/ and Ctrl+Alt+? elsewhere) splits the tmux pane, and the new pane appears where tmux put it. Clicking a pane makes it tmux's active pane. New terminal (Cmd+T on the desktop, or the command launcher) and Window → New Window each ask tmux for a new window, which opens in a chan window of its own. tmux owns the geometry: chan tells tmux the grid the window can show, tmux lays the panes out inside it and sizes each one, and the panes draw at tmux's size. Dragging a divider resizes tmux's panes: chan asks tmux when the drag ends, and the divider settles where tmux lays it out, within tmux's minimum pane size. chan moves a divider by resizing one tmux pane, so a divider between nested splits that no single pane's resize reaches does not drag. Each tmux pane is a terminal session of the same tenant: cs terminal list lists it under its tmux window's name in the tmux group, cs terminal write types into it, and it ends when its pane or the connection does.

Hybrid Nav (Cmd+. on macOS, Ctrl+. elsewhere) previews what tmux will do: a split shows the new pane staged beside the one it splits, and a divider move, by key or by dragging the divider, shows the new size. Enter asks tmux for them and the panes arrive as tmux lays them out; Esc drops them and tmux is not asked. A staged pane is split only after the commit, once tmux has made it. A tmux window's panes have no A and B sides, so the A/B flip and Hybrid Nav's Tab do nothing there, and Hybrid Nav stages no tab and swaps no tiles.

Closing a pane (Cmd+W, or its program exiting) kills the tmux pane and closing a tmux window kills the tmux window; the window's close prompt offers Detach beside Hide and Close, and Hide buries the window and leaves tmux alone. Detach, from the prompt or the card, drops the whole connection and leaves the tmux server running, and so does hiding the connection's last shown window; ending the server, with every session it holds, is the selection's turn off or remove on the card. The connection also ends when tmux exits, when you close the control terminal's window, or when the control process ends. Every tmux window it opened closes with it and the card goes. The desktop's control terminal returns as an ordinary terminal window; the browser's source tab accepts normal shell typing again, where tmux -CC returned.

Under the hood: design.md describes the connection model, and crates/chan-tmux/design.md the control-mode protocol chan speaks.

Teams and orchestration

Open New team from the workspace's pane menu or command launcher to configure a team of agents in named terminal tabs. The dialog and cs terminal team use the same saved configuration. Agents run as ordinary terminal programs; their commands must already be installed on the host. Team commands require a workspace terminal.

See the team setup and running terminals
The Spawn agents dialog with a team directory, terminal group, and optional brief
Choose a team directory and group, then add a brief for the agents.
Four named agents assigned to a two-by-two grid of terminal panes
Choose the lead and member commands, then arrange agents in tabs or split panes.
A lead and three worker agents exchanging task-file references in named terminals
Named terminals let the lead and workers send messages and share task references through cs.

For the CLI, save a configuration such as this to team.toml. A team has one to nine members, with exactly one lead:

team_name = "review"
host_name = "You"
host_handle = "@@Host"
tab_group = "review"

[[members]]
handle = "@@Lead"
command = "claude"
is_lead = true

[[members]]
handle = "@@Reviewer"
command = "codex"

Create the team, or load it in a later session:

$cs terminal team new teams/review --config team.toml
$cs terminal team load teams/review

The first command creates a team from your configuration; the second respawns one already saved in the workspace. Running either command again spawns another live copy in a new group. Close an existing copy first with cs terminal close --tab-group review if you intend to replace it. new overwrites the saved config and regenerates the bootstrap. The team directory contains config.toml, generated bootstrap.md, and tasks/, journals/, and followups/. Put shared instructions in a brief passed with --brief; the generated bootstrap describes the coordination process.

For a smaller setup, create and address named terminals directly:

$cs terminal new --tab-name reviewer --tab-group review --command codex
$cs terminal write --tab-name reviewer --submit=codex "Review the current diff"
$cs terminal list --json

--submit selects the agent's submit key sequence. Match it to the target agent; a mixed-agent group needs a separate command per agent. Without it, the text is written without an agent submit chord. Writes are queued and delivered when the terminal is idle, with a 4096-byte limit per call.

Use cs terminal scrollback to inspect output and cs terminal survey --help for a choice prompt delivered to another terminal's window. For the full in-terminal reference, run cs dump-skill --list and select a topic with --topic.

Under the hood: the contracts agents rely on when they drive chan through cs are in .agents/orchestration/README.md, and crates/chan-shell/design.md describes the control socket itself.