Skip to main content
Menu

Documentation

Sessions and panes

Agents keep running when Bentomux does not. Here is what survives a quit, a crash, and a reboot — and what does not.

The pty host

A PTY dies with whoever holds its master file descriptor. When that was the app itself, quitting Bentomux closed the fd, the kernel hung up the slave, and every agent CLI in every pane took a SIGHUP.

So the master fds live somewhere else. The first time you open a pane, Bentomux launches itself a second time as a background daemon and talks to it over a loopback socket.

bentomux --pty-host

The daemon publishes its port and a shared secret in an owner-only address file, and speaks newline-delimited JSON over the socket. Quitting, crashing, or force-quitting the app now leaves your agent CLIs running. The next launch asks the daemon which terms are still alive and reattaches to the same processes — the same pids, not respawns.

What survives

EventWhat happens
Switch tab or paneThe shell and its agent keep running in the background.
Quit BentomuxEverything stays alive in the daemon. Reopen and the panes are still there.
Crash or force-quitSame as a clean quit — the daemon is a separate process.
RebootProcesses are gone. Bentomux restores your layout and starts fresh shells.
App updateThe daemon checks a protocol version on connect. If it disagrees, Bentomux replaces it and moves the live terminals across.

When the last pane exits and the last client disconnects, the daemon waits ten seconds and then exits. Leaving a pane open is what keeps the session alive.

What is not preserved

Bentomux is not tmux, and it does not pretend to be. Three things it does not do:

  • No reattach from another terminal. The daemon speaks to the app over a loopback socket with a local-only secret. Attach from a second machine or a plain shell: not supported.
  • No history replay. Reattaching restores the live screen, not a recording. Close the tab and its shell is gone — scrollback lives in the terminal emulator and dies with the pane.
  • No server-side layout. The layout is your state file, not a session the daemon owns.

If you want agents to outlive a reboot, give them a session manager of their own — tmux inside a pane works fine.

The state file

Layout and preferences live in a single JSON file in the app data directory, as bentomux.json. It records your workspaces, your tabs, and the split tree inside each tab — which pane sits where, in which direction, and how the borders were dragged.

The file is written by the app. Edit it while Bentomux is closed, or the next write overwrites you. Exact locations are in Configuration.

Configuration →

Edit this page (opens in a new tab)