René's URL Explorer Experiment


Title: Wait for a window's panes concurrently to speed up loads by tony · Pull Request #1056 · tmux-python/tmuxp · GitHub

Open Graph Title: Wait for a window's panes concurrently to speed up loads by tony · Pull Request #1056 · tmux-python/tmuxp

X Title: Wait for a window's panes concurrently to speed up loads by tony · Pull Request #1056 · tmux-python/tmuxp

Description: Summary Fix slow workspace loads (#1053): the per-pane readiness wait added in #1018 ran serially, so a window's load time grew with its pane count even though tmux warms every pane's shell concurrently. Replace the serial per-pane wait with a single concurrent barrier (_wait_for_panes_ready) that polls all of a window's default-shell panes together under one shared timeout. Preserve config-order semantics: each window is still built and finished before the next begins, so a later window can rely on a directory or side effect created by an earlier window's commands. Preserve the #365 zsh partial-line % fix: no pane is resized before its shell has drawn its prompt; select_layout runs once per window, after that window's barrier. Update the load progress display and before_script handling to match the new build-event ordering (see Follow-on changes). No config or YAML changes — same workspaces, faster loads. Motivation #1018 fixed the long-standing zsh % marker (#365) by waiting for each pane's shell to draw its prompt before applying its layout. That wait ran serially: pane N+1 wasn't split until pane N was ready. Because tmux starts a pane's shell the moment the pane is split, the shells in a window already warm up concurrently — only the observation of readiness was serial. With a heavy interactive rc file, a window's load cost became panes × shell-init, the regression reported in #1053. Design decisions Concurrent barrier per window. A window's panes are all split first, so their shells initialize together; a single barrier then waits for every default-shell pane in that window under one shared timeout. Readiness becomes one observation pass over all the panes instead of one blocking wait per pane. Per-window, not whole-session. Windows are built one at a time: create panes → barrier → lay out → dispatch commands → finish → next window. A window's commands run before the next window is created, so a later window can depend on side effects of an earlier one (e.g. a start_directory whose directory an earlier command created). The readiness wait is collapsed within a window; window-to-window ordering is unchanged. Split the newest pane; defer layout until after the barrier. A split resizes the pane it targets, and the build only ever splits the newest pane — created microseconds earlier and still sourcing its rc, which is safe to resize. The window's single select_layout is deferred until after its barrier, when every shell in the window is past its prompt. Why not keep a per-split select_layout? That call also resizes the older panes; if one is mid-prompt, the resize races zsh's prompt redraw and resurrects the % marker. Adaptive space reclaim. Without a per-split layout, a window with many panes can run out of room for the next split. _split_pane_reclaiming_space handles this: on a no-space failure it first waits for the window's existing panes (so they are safe to resize), runs select_layout to redistribute, then retries. Reclaim never resizes a not-ready pane, and a genuinely-too-small window still raises as before (#800). Internal and always-on. No new YAML keys or tunables; the barrier just makes the existing readiness behavior cheap. Follow-on changes Building a window's panes together (rather than one-ready-then-next) changes the grouping and ordering of build events, so two adjacent areas needed updates: Progress display (src/tmuxp/cli/_progress.py): window_done events now carry window identity, and the default progress bar tracks created vs. finished windows so the bar and the window label stay in sync as panes are created. before_script streaming (src/tmuxp/cli/load.py, src/tmuxp/util.py): before_script inherits the terminal's stdio by default so TTY-aware tools run interactively, the spinner starts only after before_script finishes, and its output is captured into the panel only when a nonzero --progress-lines is requested. synchronize-panes restore (src/tmuxp/workspace/builder.py): the temporary synchronize-panes disable is isolated to pane-command dispatch and skips targets for panes that exited during startup. Before / After Readiness wait for a window with N default-shell panes: Before: N serial waits (pane N+1 not split until pane N is ready) After: 1 concurrent barrier over all N panes (shells already warming together) Test plan Builder / readiness: test_wait_for_panes_ready_all_ready, test_wait_for_panes_ready_mixed — the barrier reports each pane ready and times out only non-prompt panes test_wait_for_pane_ready_returns_true, test_wait_for_pane_ready_timeout — the one-pane wrapper test_pane_readiness_waits_for_default_shell_panes — only default-shell panes enter the barrier (custom shell/window_shell skipped) test_build_waits_for_each_window_before_dispatch — a window's panes are awaited together before its commands run test_select_layout_called_once_per_window, test_layout_runs_after_readiness_barrier — the #365 invariant: select_layout runs once per window, after that window's barrier test_split_target_refreshes_without_readiness_wait — splitting no longer blocks on a per-pane prompt wait test_build_dispatches_window_commands_before_later_start_directory — a later window can depend on an earlier window's command side effects test_issue_800_default_size_many_windows — reclaim still re-raises when a window is genuinely too small (#800) test_synchronize_panes_disabled_during_pane_commands, test_synchronize_panes_ignores_exited_targets — sync isolation and skipping exited targets test_plugin_hook_order — on_window_create / after_window_finished order across windows Progress / before_script: test_builder_window_done_events_include_window_identity — completion events carry window identity test_spinner_default_progress_tracks_started_window_in_phase_one, test_spinner_default_progress_tracks_completed_window_in_phase_two — bar and label stay in sync test_load_workspace_pauses_spinner_for_before_script — spinner starts after before_script test_load_workspace_handles_explicit_before_script_progress_lines — before_script output captured into the panel only on explicit --progress-lines Suite / quality: uv run py.test — full suite green uv run mypy — strict, clean uv run ruff check . && uv run ruff format . — clean uv run py.test --doctest-modules src/tmuxp/workspace/builder.py — doctests for the readiness helpers

Open Graph Description: Summary Fix slow workspace loads (#1053): the per-pane readiness wait added in #1018 ran serially, so a window's load time grew with its pane count even though tmux warms every pane's shel...

X Description: Summary Fix slow workspace loads (#1053): the per-pane readiness wait added in #1018 ran serially, so a window's load time grew with its pane count even though tmux warms every pane&#3...

Opengraph URL: https://github.com/tmux-python/tmuxp/pull/1056

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:4e842195-3ff1-2836-3eec-a5ada338b9b7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8D1A:180C56:44F4D8:600DF2:6B007019
html-safe-noncef57dafb67ef51defc519263bf1fe7cc2d79bdd4737445dbe6429f31d621989ef
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDFBOjE4MEM1Njo0NEY0RDg6NjAwREYyOjZCMDA3MDE5IiwidmlzaXRvcl9pZCI6IjI5Njc2NjM4NDE3Mjg1NTcwODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac2fd9bac58b6662f504db74be2db1d90602de7e5700a8282e12e8403f1492fd8d
hovercard-subject-tagpull_request:3938968386
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/tmux-python/tmuxp/pull/1056/files
twitter:imagehttps://avatars.githubusercontent.com/u/26336?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/26336?s=400&v=4
og:image:altSummary Fix slow workspace loads (#1053): the per-pane readiness wait added in #1018 ran serially, so a window's load time grew with its pane count even though tmux warms every pane's shel...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None6527e91c60c0b29d16606ff32ac5df8ecdc37a2a62205ea057a14d7762c870fa
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/tmux-python/tmuxp git https://github.com/tmux-python/tmuxp.git
octolytics-dimension-user_id37234308
octolytics-dimension-user_logintmux-python
octolytics-dimension-repository_id12398170
octolytics-dimension-repository_nwotmux-python/tmuxp
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id12398170
octolytics-dimension-repository_network_root_nwotmux-python/tmuxp
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release46f1cd2ae3cd8ae1a81019b5d619742e76f13bbd
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/tmux-python/tmuxp/pull/1056/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftmux-python%2Ftmuxp%2Fpull%2F1056%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftmux-python%2Ftmuxp%2Fpull%2F1056%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=tmux-python%2Ftmuxp
Reloadhttps://github.com/tmux-python/tmuxp/pull/1056/files
Reloadhttps://github.com/tmux-python/tmuxp/pull/1056/files
Reloadhttps://github.com/tmux-python/tmuxp/pull/1056/files
tmux-pythonhttps://github.com/tmux-python
tmuxphttps://github.com/tmux-python/tmuxp
Codehttps://github.com/tmux-python/tmuxp
Issues113 (113)https://github.com/tmux-python/tmuxp/issues
Pull requests29 (29)https://github.com/tmux-python/tmuxp/pulls
Discussionshttps://github.com/tmux-python/tmuxp/discussions
Actionshttps://github.com/tmux-python/tmuxp/actions
Security and qualityhttps://github.com/tmux-python/tmuxp/security
Insightshttps://github.com/tmux-python/tmuxp/insights
Sign up for GitHub https://github.com/signup?return_to=%2Ftmux-python%2Ftmuxp%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftmux-python%2Ftmuxp%2Fissues%2Fnew%2Fchoose
tonyhttps://github.com/tony
masterhttps://github.com/tmux-python/tmuxp/tree/master
tmuxp-laghttps://github.com/tmux-python/tmuxp/tree/tmuxp-lag
Conversation 3 https://github.com/tmux-python/tmuxp/pull/1056
Commits 1 https://github.com/tmux-python/tmuxp/pull/1056/commits
Checks 14 https://github.com/tmux-python/tmuxp/pull/1056/checks
Files changed https://github.com/tmux-python/tmuxp/pull/1056/files
Please reload this pagehttps://github.com/tmux-python/tmuxp/pull/1056/files
Wait for a window's panes concurrently to speed up loads https://github.com/tmux-python/tmuxp/pull/1056/files#top
Show all changes 1 commit https://github.com/tmux-python/tmuxp/pull/1056/files
4af9146 Workspace(perf[readiness]): Concurrent per-window pane setup tony Jul 4, 2026 https://github.com/tmux-python/tmuxp/pull/1056/commits/4af91466f81ae342c9c936669ddc0d2e1a96b0a5
Clear filters https://github.com/tmux-python/tmuxp/pull/1056/files
Please reload this pagehttps://github.com/tmux-python/tmuxp/pull/1056/files
Please reload this pagehttps://github.com/tmux-python/tmuxp/pull/1056/files
CHANGES https://github.com/tmux-python/tmuxp/pull/1056/files#diff-aac07aefec754086f5c344e2c233862f6a611c739b5647fd456c1b77d3577c79
load.md https://github.com/tmux-python/tmuxp/pull/1056/files#diff-3e715a026c3eaba1be5b80065ae2197ec5994b2a88a40925260d37ba80005fc0
environmental-variables.md https://github.com/tmux-python/tmuxp/pull/1056/files#diff-8daf9857fcac18ca4fdf343d35ba63459bc8cd3f6eb0fc4f49ea40a85992da72
index.md https://github.com/tmux-python/tmuxp/pull/1056/files#diff-cfe25b1c4ee4e15ad002a1854dbc8a15c356942be87cc90a8e5609294f9786f2
loading-workspaces.md https://github.com/tmux-python/tmuxp/pull/1056/files#diff-5a15f27e358f15049c0bdaf5ce00bf5057ba340331385cf973de1091cd899727
_progress.py https://github.com/tmux-python/tmuxp/pull/1056/files#diff-8b742c4f9d6cae77da12a69fd16bedc3a89b574d3994a1aa4f561b75c905ce20
load.py https://github.com/tmux-python/tmuxp/pull/1056/files#diff-5a6cefe222da9d8e8c0fc10b55805661c46f32e982551da24a26d1ec0674828c
util.py https://github.com/tmux-python/tmuxp/pull/1056/files#diff-739f601f96ef21aae4bcd6bd64b003a1ff7e3cfcf9bd207bca94e4b5e1aac28c
classic.py https://github.com/tmux-python/tmuxp/pull/1056/files#diff-6d34c9f88755e22a5827e2403cc74c6d34551da12dd661d0fc3b855eab913c72
test_load.py https://github.com/tmux-python/tmuxp/pull/1056/files#diff-25edff86abd5d543cf800c3a03e13234d96a3532578f618dbc6cabd5b074426d
test_progress.py https://github.com/tmux-python/tmuxp/pull/1056/files#diff-e8161ef6e2f07691227f0f6f6e984ffff04852b59968948511462b114d82d798
test_util.py https://github.com/tmux-python/tmuxp/pull/1056/files#diff-0dcbadaa6c70afb6fea041dec04bb89c3cc7fe201fb7c3185a669efa49769f28
test_builder.py https://github.com/tmux-python/tmuxp/pull/1056/files#diff-4b7111dc0aa90ef0112f07fb34db324d25e8d33fc521b2a375aa5a9847c030e8
test_progress.py https://github.com/tmux-python/tmuxp/pull/1056/files#diff-7bbfc8a17a146ff14bef9ba82ace3d65ba7be3becdc06131961f8dfe6de4d477
CHANGEShttps://github.com/tmux-python/tmuxp/pull/1056/files#diff-aac07aefec754086f5c344e2c233862f6a611c739b5647fd456c1b77d3577c79
View file https://github.com/tmux-python/tmuxp/blob/4af91466f81ae342c9c936669ddc0d2e1a96b0a5/CHANGES
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/tmux-python/tmuxp/pull/1056/{{ revealButtonHref }}
https://github.com/tmux-python/tmuxp/pull/1056/files#diff-aac07aefec754086f5c344e2c233862f6a611c739b5647fd456c1b77d3577c79
https://github.com/tmux-python/tmuxp/pull/1056/files#diff-aac07aefec754086f5c344e2c233862f6a611c739b5647fd456c1b77d3577c79
docs/cli/load.mdhttps://github.com/tmux-python/tmuxp/pull/1056/files#diff-3e715a026c3eaba1be5b80065ae2197ec5994b2a88a40925260d37ba80005fc0
View file https://github.com/tmux-python/tmuxp/blob/4af91466f81ae342c9c936669ddc0d2e1a96b0a5/docs/cli/load.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/tmux-python/tmuxp/pull/1056/{{ revealButtonHref }}
https://github.com/tmux-python/tmuxp/pull/1056/files#diff-3e715a026c3eaba1be5b80065ae2197ec5994b2a88a40925260d37ba80005fc0
https://github.com/tmux-python/tmuxp/pull/1056/files#diff-3e715a026c3eaba1be5b80065ae2197ec5994b2a88a40925260d37ba80005fc0
https://github.com/tmux-python/tmuxp/pull/1056/files#diff-3e715a026c3eaba1be5b80065ae2197ec5994b2a88a40925260d37ba80005fc0
https://github.com/tmux-python/tmuxp/pull/1056/files#diff-3e715a026c3eaba1be5b80065ae2197ec5994b2a88a40925260d37ba80005fc0
https://github.com/tmux-python/tmuxp/pull/1056/files#diff-3e715a026c3eaba1be5b80065ae2197ec5994b2a88a40925260d37ba80005fc0
docs/configuration/environmental-variables.mdhttps://github.com/tmux-python/tmuxp/pull/1056/files#diff-8daf9857fcac18ca4fdf343d35ba63459bc8cd3f6eb0fc4f49ea40a85992da72
View file https://github.com/tmux-python/tmuxp/blob/4af91466f81ae342c9c936669ddc0d2e1a96b0a5/docs/configuration/environmental-variables.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/tmux-python/tmuxp/pull/1056/{{ revealButtonHref }}
https://github.com/tmux-python/tmuxp/pull/1056/files#diff-8daf9857fcac18ca4fdf343d35ba63459bc8cd3f6eb0fc4f49ea40a85992da72
https://github.com/tmux-python/tmuxp/pull/1056/files#diff-8daf9857fcac18ca4fdf343d35ba63459bc8cd3f6eb0fc4f49ea40a85992da72
docs/topics/index.mdhttps://github.com/tmux-python/tmuxp/pull/1056/files#diff-cfe25b1c4ee4e15ad002a1854dbc8a15c356942be87cc90a8e5609294f9786f2
View file https://github.com/tmux-python/tmuxp/blob/4af91466f81ae342c9c936669ddc0d2e1a96b0a5/docs/topics/index.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/tmux-python/tmuxp/pull/1056/{{ revealButtonHref }}
https://github.com/tmux-python/tmuxp/pull/1056/files#diff-cfe25b1c4ee4e15ad002a1854dbc8a15c356942be87cc90a8e5609294f9786f2
https://github.com/tmux-python/tmuxp/pull/1056/files#diff-cfe25b1c4ee4e15ad002a1854dbc8a15c356942be87cc90a8e5609294f9786f2
https://github.com/tmux-python/tmuxp/pull/1056/files#diff-cfe25b1c4ee4e15ad002a1854dbc8a15c356942be87cc90a8e5609294f9786f2
https://github.com/tmux-python/tmuxp/pull/1056/files#diff-cfe25b1c4ee4e15ad002a1854dbc8a15c356942be87cc90a8e5609294f9786f2
docs/topics/loading-workspaces.mdhttps://github.com/tmux-python/tmuxp/pull/1056/files#diff-5a15f27e358f15049c0bdaf5ce00bf5057ba340331385cf973de1091cd899727
View file https://github.com/tmux-python/tmuxp/blob/4af91466f81ae342c9c936669ddc0d2e1a96b0a5/docs/topics/loading-workspaces.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/tmux-python/tmuxp/pull/1056/{{ revealButtonHref }}
Please reload this pagehttps://github.com/tmux-python/tmuxp/pull/1056/files
Please reload this pagehttps://github.com/tmux-python/tmuxp/pull/1056/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.