Workspace ManagerGuides

Choose documentation 3

latest

Current version

latest
English

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

Edit this page on GitHub

Automate workspace operations

LibTmux.Workspace 0.0.0-alpha.20 · Source

Give automation an explicit file, endpoint and attachment choice. Continue the installation walkthrough with this detached operation:

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

Check the process exit status, parse its JSON result, then inspect any reported partial effects. A failed later input does not imply that earlier sessions were removed. Keep stderr separate from the result stream.

Follow progress

Use NDJSON when the caller needs records while a load is running:

Terminal window
$ tmux-workspace load \
-S "$WORKSPACE_TMP/tmux.sock" \
-d \
--ndjson \
workspace.yaml

Parse one complete JSON value per line. Treat a closed stream or missing final result as incomplete work. Do not infer success from an earlier creation event.

Make retries deliberate

Use a unique session name for independent jobs. Reusing a name follows the loader’s existing-session policy; it is not a request to reset that session. Capture IDs and retained effects from the result before deciding what to clean up or retry. Remove only sessions the job owns.

Read output and errors for the command’s machine interface. A pane’s process can outlive the CLI and can fail after successful command delivery.

CLI source.

Esc

Type to search.