| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
why: Land the experimental ChainWorkspaceBuilder from #1054 on the new builder package. It builds the window/pane tree via libtmux's chain API (libtmux#685), which is unreleased and absent from published libtmux, so the scaffold must import cleanly and fail with an actionable error rather than crash on import. what: - Add src/tmuxp/workspace/builder/chain.py: ChainWorkspaceBuilder subclasses ClassicWorkspaceBuilder; guard the experimental import behind _HAVE_CHAIN so the module imports without the API - build() raises exc.WorkspaceBuilderImportError when the chain API is absent; when present, port #1054's single-ForwardPlan build - Register the `chain` entry point in tmuxp.workspace_builders - Export ChainWorkspaceBuilder from the builder package - Add tests: test_builder_chain.py importorskips the chain API; the new test_builder_chain_unavailable.py asserts selecting `chain` without the API resolves the class yet raises on build()
why: Build the experimental ChainWorkspaceBuilder against the in-progress
libtmux._experimental.chain API on the sibling libtmux worktree.
what:
- Add [tool.uv.sources] libtmux = { path = "../libtmux", editable = true }
- Relock against the local editable checkout
why: Showcase libtmux's experimental chain API downstream: build a whole workspace's window/pane tree in the minimum tmux invocations instead of one subprocess per new-window / split-window. what: - Add ChainWorkspaceBuilder (subclass of WorkspaceBuilder): one ForwardPlan seeded from the session builds every window and pane, reusing the session's default window as window 1 (no orphan) via initial_window / initial_pane - send_keys_mode: readiness (default, classic per-pane shell-ready delivery) or batched (folded into the plan) - Reuse parent helpers (_wait_for_pane_ready, config_after_window, focus, plugins, before_script, options) - Tests: two/three-pane structure, focus, readiness commands land, batched
why: Make the experimental ChainWorkspaceBuilder selectable from the CLI
without replacing the default builder.
what:
- Add --builder={default,chain} to `tmuxp load` (Env: TMUXP_BUILDER),
threaded through command_load -> load_workspace as builder_name
- Select ChainWorkspaceBuilder when chosen; default builder otherwise
- Test the flag parsing (smoke-verified `tmuxp load --builder=chain`
builds the expected window/pane tree)
| Back | FazBrowse Home | New Git URL |
Summary
Changes by area
src/tmuxp/workspace/chain_builder.py (new)
ChainWorkspaceBuilder, a subclass of WorkspaceBuilder, overriding build(): the session is created, then every window and pane is described in one ForwardPlan seeded from the session and resolved via ServerPlanRunner. Reuses the parent's helpers (_wait_for_pane_ready, config_after_window, focus handling, plugin hooks, before_script, session options).
src/tmuxp/cli/load.py
Adds --builder={default,chain} (Env TMUXP_BUILDER), threaded through command_load → load_workspace as builder_name, selecting the builder class. The rest of the load path is unchanged because the subclass mirrors the constructor, .session, and event hooks.
pyproject.toml
[tool.uv.sources] pins libtmux to the sibling ../libtmux worktree so the experimental chain API is importable.
Design decisions
Test plan
Companion PR
Depends on the libtmux experimental chain API: tmux-python/libtmux#685.