Skip to content

Several devices

You can run mocante on a laptop and a desktop, and both see the same agents. Your sessions live in tmux on the hosts, so any device that reaches a host sees its sessions. Your configuration (projects, hosts and workspaces) can follow you through a folder that your devices already sync.

There is no mocante account and no mocante cloud service. Devices never connect to each other directly.

What Where it lives
Projects, hosts and workspaces, with their tags Synced between devices when sync is on.
The order of projects, workspaces and sessions in the sidebar Synced between devices when sync is on.
Sessions, tabs and agent status Live on the host. Every device that connects to the host sees them. Nothing to sync.
Settings (theme, terminal renderer, sync folder, …) Each device. Settings never sync, so each device can differ.
Host connection state, resource readings, shared files Each device.

Because sessions run on hosts, you can start an agent on a remote host from your laptop, close the laptop, and pick up the same session from your desktop.

Each device’s own machine shows in its host list as the local host, and another device’s local machine does not show at all. To see the sessions that run on your desktop from your laptop, add the desktop to the laptop as a remote host.

  1. Pick a folder that a sync service already replicates between your devices: iCloud Drive, Dropbox, Syncthing, a NAS mount. Any service that syncs files works.
  2. Open Settings and go to Sync.
  3. Set Sync between devices to Synced folder.
  4. Enter the folder’s path. On macOS, Use iCloud Drive fills in a folder in your iCloud Drive.
  5. Do the same on every other device, with the same folder.

Sync stays off until a folder is set. Off keeps each device’s configuration to itself.

Each device writes only its own file in the folder, and reads the files of the others. This means the sync service never sees two devices change one file, so it never makes conflict copies. The This device row in the Sync settings shows the id that names this device’s file, with a copy button.

What happens when two devices change the same thing

Section titled “What happens when two devices change the same thing”
  • Changes to different fields of one record, such as a new name on one device and new tags on the other, both apply.
  • Changes to the same field end with one value on both devices. mocante picks it the same way everywhere, which is not always the newer one.
  • Deleting a record wins over a change to it on another device.
  • Tags that two devices add at the same time are both kept.
  • When you add a host on one device, the other device connects to it as soon as the change arrives.

A file that is only half synced is skipped and read again later, so a slow sync service does not break anything.

Both devices see the same sessions on a host and can attach to the same session at once. A few things go to the device that connected to the host last: