Layout files
A .bmux.toml in a folder declares the windows, splits and pane commands a
session there starts with, like tmuxinator or tmuxp. Bare bmux, bmux new,
the picker’s n and the new-session popup all build it when they create a session
in that folder. It’s the restore format, in TOML:
A split’s first and second can be splits themselves. Each command is one
line typed into its pane’s fresh shell, as if you typed it. Every pane must
appear in exactly one window, directories must exist, and unknown settings
are errors: a file with a problem gives one pane, and the notice box says
what’s wrong.
A folder’s .bmux.toml can come from anyone who can write to the repository,
so its commands run only once you trust it: bmux layout trust in that
folder trusts its current content. Until then, sessions get its windows and
panes and the notice box says the commands were skipped. Editing the file
untrusts it again, like direnv. Trusted files are recorded by path and
SHA-256 in trusted-layouts.json next to the saved sessions.
bmux layout save writes a session’s current windows to its folder’s
.bmux.toml and trusts it. Pane directories are where each shell is now;
agents get their resume command. bmux can’t see what else a pane runs, so
commands from the file being replaced are kept for panes without an agent,
but only if that file was trusted; an untrusted file’s commands are left out,
since saving trusts the result.