Repository navigation
fix(tmux): one status process per tick instead of a Node job per placeholder per window - #1096
Merged
Merged
Conversation
…eholder per window Placeholders now read window/session options written by a single hidden publisher job in status-right. tmux keys jobs by window inside the window list but by client outside it, so the job runs once per client per tick. Legacy expansions are rewritten on reload; uninstall removes the job. Fixes #1095
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.
Fixes #1095.
What changes
Placeholders no longer start a process each. They expand to plain option reads (
#{@pi_window_state},@pi_window_name,@pi_window_unread,@pi_window_count,@pi_window_summary,@pi_session_summary). One hidden job,#(#{@pi_query} env publish), is appended tostatus-rightwhen any placeholder is in use. Each tick it:tmuxcall,psliveness check,set-optioncall. An unchanged tick writes nothing, so nothing redraws.The job lives in
status-righton purpose. tmux keys#()jobs by window inside the window list, but by client outside it.0in windows without Pi, so#{?#{pi_count},…}keeps working.status-right.status.ts SOCKET publishis new. The per-target query modes are unchanged.Evidence
Measured on a live tmux server with an attached client and
status-interval 1, counting job runs over 6 s with 4 windows:Before the fix, on my laptop with 10 windows, 3 placeholders and
status-interval 5, the status bar used about 0.65 of a core and showed up to 15 Node processes at once.Tests
plugin.test.ts(updated, isolated tmux):#(status-rightgets exactly one publisher job, and reloading is idempotent0before the first publishset-option -stargets the server, not the session.pnpm testintmux/: 31 passed, plus the publishernode --test.tsc --noEmit, oxlint andlint:agent-standardsare clean.