Skip to content

ManualTerminal

tmux control mode

Run tmux -CC in a chan terminal, locally or over ssh, and work with its windows and panes as Chan windows and panes.

What you can do

  • Run tmux -CC locally or over ssh. Each tmux window opens as a Chan window, with its panes laid out as tmux has them.
  • Split, resize, and close panes with Chan's shortcuts and Hybrid Nav. tmux does the work and owns the layout.
  • Manage the connection from its card on the Computers screen: new window, show, hide, detach.
  • Detach and come back later. The tmux server keeps running.
  • Script the panes with cs terminal list and cs terminal write, like any other Chan terminal.

Turn it on and connect

  1. Enable tmux control mode

    It is off by default. Turn it on in Settings → Terminal → tmux control mode (tmux -CC), or from a terminal. tmux 3.2 or newer is required.

    $chan config set terminal.tmux.enabled true
  2. Start tmux in a Chan terminal

    On the local machine:

    $tmux -CC new -A -s dev

    On another machine, over ssh:

    $ssh -t user@host tmux -CC new -A -s dev
  3. Answer the banner, if one shows

    A tmux you ran directly connects at once. When another program is in front, such as ssh or Eternal Terminal's et, a banner names it and asks: Allow, Allow for this tab, or Deny. No answer in 60 seconds is a deny.

To skip the question for a program you run as a habit, list its name under terminal.tmux.trust in server.toml:

[terminal.tmux]
trust = ["ssh", "et"]

Windows and panes

  • Each tmux window is a Chan window of its own. Its panes are tmux's panes, split as tmux lays them out.
  • The desktop opens the first eight windows at connect; the rest are listed hidden on the card. In a browser, open each window from its row with Open window.
  • A pane has no tab strip and no A and B sides. With tabs in the title bar, a tmux badge takes the A/B button's place.
  • A pane is named after the command running in it: bash at a prompt, top while top runs.
  • These windows are not saved. They last as long as the connection.
You domacOSWindows, Linuxtmux does
Split right, split downCmd+/ Cmd+Shift+/Ctrl+Alt+/ Ctrl+Alt+?Splits the pane. The new pane appears where tmux puts it.
New terminalCmd+TCtrl+Shift+TOpens a new tmux window, in a Chan window of its own.
Click a paneMakes it the active pane.
Drag a dividerResizes its panes. The divider settles where tmux lays it out.
Hybrid NavCmd+.Ctrl+.Nothing until Enter: splits and sizes are previewed, then asked for. Esc drops them.
Close a paneCmd+WCtrl+Shift+WKills the pane.
Close the windowCmd+Shift+WCtrl+Alt+WKills the window. The prompt also offers Detach and Hide.

The connection's card

A connection is a card on the Computers screen, beside the local machine and your devservers. Its rows are the connection's windows.

The card is titledWhen tmux runs
tmux -CC on this machineIn a terminal of the local machine.
tmux -CC on and the devserver's nameIn a devserver's terminal.
tmux -CC from and the command that reached it, such as tmux -CC from ssh -t user@host tmux -CC new -A -s devBehind another program, here ssh.
  • t asks tmux for a new window, and o detaches.
  • Each row focuses, shows, or hides its window. Hiding the last shown window detaches.
  • The terminal that ran tmux -CC is the connection's control terminal. It takes no typing while connected. It is listed on the card of the machine where it ran, the local machine's or the devserver's, marked buried and with a Detach button, and not on the connection's card.

Detach or end

You doThe tmux server
Detach, from a window's close prompt, from the card, or with oKeeps running. Its Chan windows close and the card goes.
Hide the connection's last shown windowKeeps running. The connection detaches.
Select the card with its check, then turn it off or remove itEnds, with every session it holds.
Close the control terminal's window, or exit tmuxThe connection ends, and every window it opened closes.
Details and limits
  • Every window attached to the terminal shows the banner, and the first answer wins. A deny writes one newline, which detaches a real tmux.
  • A peer that does not answer like tmux, or a tmux older than 3.2, is detached with a note in the terminal.
  • Turning the setting off leaves a running connection alone. tmux itself is always trusted.
  • On the desktop the control terminal moves to a hidden control window while connected, and returns as an ordinary terminal window when the connection ends. In a browser it stays a tab in its window.
  • A new pane reads as its tmux id, such as tmux %3, for about a second, until tmux reports its command.
  • cs terminal list lists the panes in the tmux group. Session names are unique, so two panes at a shell are bash and bash-2 there.
  • A label you give a window in Computers replaces tmux's name for it until you clear the label. It does not last across a reconnect.
  • A window moved with tmux's own move-window or swap-window keeps its Chan window and panes.
  • A divider between nested splits that no single pane's resize reaches does not drag.
  • Hybrid Nav stages no tabs and swaps no tiles in a tmux window, and its Tab does nothing there.

Next