Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Python workspace examples

Python
  • Python
  • Ruby
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

Edit this page on GitHub

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-vertical
windows:
- window_name: my test window
panes:
- echo hello
- echo hello

Load the workspace and attach to it:

Terminal window
$ tmuxp load workspace.yaml

Inside 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:

Terminal window
$ tmuxp load \
-L workspace-json-example \
-d \
workspace.json

Inspect its panes:

Terminal window
$ tmux -L workspace-json-example list-panes -t '=json-workspace:editor'

Remove the example session when finished:

Terminal window
$ 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.

Two-pane YAML source

Esc

Type to search.