Python workspace examples
tmuxp 1.74.0 · Source
Save a workspace file and pass it to tmuxp. These examples require tmuxp and tmux; the guide covers installation. No Python program is needed.
Load YAMLLink to section
Save this upstream two-pane example as workspace.yaml:
session_name: 2-pane-verticalwindows: - window_name: my test window panes: - echo hello - echo helloLoad the workspace and attach to it:
$ tmuxp load workspace.yamlInside tmux, the loader offers to switch clients or append windows. Detach
with your tmux prefix followed by d to leave the session running.
Load JSON without attachingLink to section
The same configuration fields also work in JSON. Save this separate workspace
as workspace.json:
{ "session_name": "json-workspace", "windows": [ { "window_name": "editor", "panes": ["echo ready", "echo ready"] } ]}Load it detached on a dedicated socket:
$ tmuxp load \ -L workspace-json-example \ -d \ workspace.jsonInspect its panes:
$ tmux -L workspace-json-example list-panes -t '=json-workspace:editor'Remove the example session when finished:
$ tmux -L workspace-json-example kill-session -t '=json-workspace'More configurationsLink to section
The upstream configuration examples cover layouts, focus, directories, environment values, and command shorthand. The load reference documents file selection, attachment, and existing sessions.
For contributors studying how a file becomes a session, see the internal builder example.