Workspace ManagerconceptHome

Choose documentation 3

v0.1.2

Current version

v0.1.2
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

Edit this page on GitHub

tmux workspace manager, forged in Ruby.

Session manager for tmux. Load tmux sessions through YAML/JSON configuration files. Powered by libtmux for Ruby.

Install

Install the workspace package separately from the core library.

$ gem install libtmux-workspace
gem "libtmux-workspace"

libtmux-workspace parses bounded YAML or JSON into an immutable creation plan. validate and offline plan do not contact tmux. load and plan --live borrow an existing server selected with --socket.

The manager creates a new session. It does not reconcile, replace, or delete a preexisting workspace. Applying a plan authorizes declared shell commands; their delivery does not prove that the pane programs completed.

Start here

The source-owned workspace guide is staged from the same revision as the generated reference.

Example workspaces

Each workspace below is a file that libtmux/libtmux-ruby loads in a test or a scheduled run, as the list under it says. The drawing shows the panes of each window and the commands each pane receives.

Tiled layout

The tiled layout arranges the panes in a grid.

Also shows: two panes, environment

session_name: work
environment:
PROJECT_MODE: development
windows:
- window_name: editor
window_index: 1
layout: tiled
panes:
- shell_command: printf 'editor ready\n'
- {}
{
"session_name": "work",
"environment": {
"PROJECT_MODE": "development"
},
"windows": [
{
"window_name": "editor",
"window_index": 1,
"layout": "tiled",
"panes": [
{
"shell_command": "printf 'editor ready\\n'"
},
{}
]
}
]
}

Converted from the YAML; the tests load the YAML.

1:editor
Window 1, editor: 2 panes, tiled❯ printf 'editor ready\n'
layout tiled

Source: examples/workspace.yaml

Loaded by:

  • test_installed_imports_use_declared_dependencies_without_starting_resources: Installs the gems into an isolated home and runs each installed example program in examples/manifest.json, including workspace_apply, which runs the installed libtmux-workspace executable on this file. (test/packaging/package_test.rb; a test runs the command)
  • workspace_apply: Loads the file with Workspace.load and applies it through the library, then runs the libtmux-workspace executable's validate, plan and load on it. (examples/workspace_apply.rb; a test runs the command)
Esc

Type to search.

Reference previewOpen reference