Workspace builder: bulk set-option helper + 10ms readiness polling#1070
Open
tony wants to merge 1 commit into
Open
Workspace builder: bulk set-option helper + 10ms readiness polling#1070tony wants to merge 1 commit into
set-option helper + 10ms readiness polling#1070tony wants to merge 1 commit into
Conversation
why: Workspace loads wait on shell prompt readiness with a 50ms poll, coarser than tmux's 50-150ms shell-ready band, so readiness is noticed late. Separately, the classic builder fires one set-option per loop iteration across four hot loops (session options, global_options, per-window options, options_after) with no shared seam for a future batched dispatch. what: - Tighten _wait_for_pane_ready interval default from 0.05 to 0.01 so prompt readiness is detected sooner (same condition). - Add ClassicWorkspaceBuilder._bulk_set_options(items, *, target, scope_flag): mirrors set_option's True/False -> on/off normalization and propagates errors via handle_option_error. - Route the four set-option loops through the helper: session (-s, session_id), global (-g, None), per-window (-w, window_id), options_after (-w, window_id). - Add tests/workspace/test_builder_bulk_options.py covering scope application, on/off normalization, empty no-op, and OptionError propagation. Salvaged from PR #1040, adapted from the pre-refactor single-file builder.py onto the builder package's classic.py. The helper body issues N round-trips today; the batch-shaped API defers the perf gain to a future libtmux batching API.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1070 +/- ##
==========================================
+ Coverage 82.56% 82.64% +0.08%
==========================================
Files 31 31
Lines 2770 2783 +13
Branches 518 520 +2
==========================================
+ Hits 2287 2300 +13
Misses 346 346
Partials 137 137 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
set-option helper + 10ms readiness polling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ClassicWorkspaceBuilder._bulk_set_options, a batch-shaped helper routing the fourset-optionloops (session, global, per-window, options_after) through one entry point._wait_for_pane_readypolling interval 50ms → 10ms.Note
The helper is forward-compat plumbing: today it is a plain loop producing identical tmux commands; the batch speedup lands once libtmux exposes a batch API. The polling tweak is the only current perf change.
Changes
workspace/builder/classic.py, tests, CHANGES.Supersedes #1040, rebased onto the
builder/classic.pypackage.Test plan