Workspace ManagerconceptGuides

Choose documentation 3

latest

Current version

latest
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

Install and load a workspace

libtmux-workspace 0.1.2-SNAPSHOT · Source

Build the documented tmux-workspace revision, then load a small session on a private socket. Use a Unix shell with tmux 3.3a or newer on PATH.

Build the command

Fetch the documented source revision, then build from its repository root. Keep the exported PATH in this shell for the rest of the walkthrough.

Terminal window
$ git clone --filter=blob:none https://github.com/libtmux/libtmux-java.git
Terminal window
$ cd libtmux-java
Terminal window
$ git fetch --depth=1 origin 3e5b20d22af3890ae5f7f52842e4b05d170a983f
Terminal window
$ git checkout --detach FETCH_HEAD

Use JDK 25 or newer and the repository’s Gradle wrapper:

Terminal window
$ ./gradlew --no-daemon --max-workers=2 :libtmux-workspace-cli:installDist
Terminal window
$ export PATH="$PWD/libtmux-workspace-cli/build/install/tmux-workspace/bin:$PATH"

Keep the distribution’s bin and lib directories together. Set JAVA_HOME to the JDK if Java is not already on PATH.

Terminal window
$ tmux-workspace --help

Create the input

Keep this shell open. Create a temporary working directory on a filesystem that supports Unix sockets, then enter it:

Terminal window
$ WORKSPACE_TMP="$(mktemp -d)"
Terminal window
$ cd "$WORKSPACE_TMP"

Save this as workspace.yaml:

workspace.yaml
session_name: workspace-guide
windows:
- window_name: editor
layout: even-horizontal
panes: [null, null]

Load and inspect

Terminal window
$ tmux-workspace load \
-S "$WORKSPACE_TMP/tmux.sock" \
-f /dev/null \
-d \
--json \
workspace.yaml

-d leaves the session detached. Inspect its panes using the same socket:

Terminal window
$ tmux -S "$WORKSPACE_TMP/tmux.sock" list-panes -t '=workspace-guide:editor'

Attach interactively with tmux -S "$WORKSPACE_TMP/tmux.sock" attach-session -t '=workspace-guide'. Detach with your tmux detach binding before continuing.

Capture and clean up

Terminal window
$ tmux-workspace freeze -S "$WORKSPACE_TMP/tmux.sock" --json workspace-guide

Try export and reload before cleanup. Capture cannot recover original scripts, command history or application state.

Remove only the session created by this walkthrough when finished:

Terminal window
$ tmux -S "$WORKSPACE_TMP/tmux.sock" kill-session -t '=workspace-guide'

The configuration remains in the temporary directory. Keep the session running when following guides that continue this example.

Continue

Configuration describes execution fields; discovery finds saved files. Read the load reference and automation for attachment, output and failure handling.

CLI source.

Esc

Type to search.

Reference previewOpen reference