Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
builder(feat[concurrent]): Add ConcurrentWorkspaceBuilder
why: Loading a workspace waited on each pane's shell prompt one at a
time, so a window with several panes paid the prompt-startup cost
serially even though tmux warms every pane's shell concurrently.

what:
- Add ConcurrentWorkspaceBuilder, an opt-in builder that creates a
  window's panes up front, waits for their prompts in one shared
  barrier, lays out once, then dispatches each pane's commands
- Port _pane_has_drawn_prompt and _wait_for_panes_ready (one
  shared-timeout polling loop, 10ms interval) from the source change
- Port _split_pane_reclaiming_space (reclaim layout space only on a
  no-space split failure) and the sequential fallback for panes whose
  start_directory depends on an earlier pane's command
- Respect workspace_builder_options.pane_readiness via the classic
  _pane_readiness_wait resolution; skip the barrier under never
- Register the `concurrent` entry point and export the class
- Register the module's doctests with the tmux-fixture set in conftest
- Add functional tests: multi-window/pane build, command dispatch,
  single-pass layout, readiness policy, space reclaim, sequential
  start_directory fallback
  • Loading branch information
tony committed Jul 4, 2026
commit 61b07469838c0d0879b3674509fc6f50825f07dd
1 change: 1 addition & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def socket_name(request: pytest.FixtureRequest) -> str:
# Modules that actually need tmux fixtures in their doctests
DOCTEST_NEEDS_TMUX = {
"tmuxp.workspace.builder.classic",
"tmuxp.workspace.builder.concurrent",
}


Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ tmuxp = 'tmuxp:cli.cli'

[project.entry-points."tmuxp.workspace_builders"]
classic = "tmuxp.workspace.builder.classic:ClassicWorkspaceBuilder"
concurrent = "tmuxp.workspace.builder.concurrent:ConcurrentWorkspaceBuilder"

[dependency-groups]
dev = [
Expand Down
2 changes: 2 additions & 0 deletions src/tmuxp/workspace/builder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
get_default_columns,
get_default_rows,
)
from tmuxp.workspace.builder.concurrent import ConcurrentWorkspaceBuilder
from tmuxp.workspace.builder.protocol import WorkspaceBuilderProtocol
from tmuxp.workspace.builder.registry import (
WORKSPACE_BUILDERS_GROUP,
Expand All @@ -32,6 +33,7 @@
__all__ = [
"WORKSPACE_BUILDERS_GROUP",
"ClassicWorkspaceBuilder",
"ConcurrentWorkspaceBuilder",
"WorkspaceBuilder",
"WorkspaceBuilderProtocol",
"available_builders",
Expand Down
Loading