Repository navigation
Count votes in a tmux pane from Lua control mode - #181
Merged
Merged
Conversation
This was referenced Dec 5, 2026
tony
force-pushed
the
vote-counter-demo
branch
from
December 6, 2026 02:38
5353a14 to
c48d1e5
Compare
why: A Lua caller can send several votes and read the result through a live control-mode watch. what: - Add the runnable vote counter to the installed examples and check its final count.
tony
force-pushed
the
path-discovery-current
branch
from
December 6, 2026 14:22
0eb59ce to
7651143
Compare
tony
force-pushed
the
vote-counter-demo
branch
from
December 6, 2026 14:22
c48d1e5 to
d7f3165
Compare
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
Run
lua examples/api/vote_counter.lua no yes nowith tmux 3.7 or newer onPATH. The program sends each vote to anawkprocess in its own pane and reads each complete tally through a live control-mode watch.The example shares one five-second deadline across each vote’s send and reply and bounds the bytes it reads. The installed example check verifies the output for the default votes.
Run the demo
Build the checkout rock and install the standalone
luvadapter dependency. Example setup.To choose a particular tmux build, set
TMUX_BINto the executable’s absolute path. Runtime PATH support.I also installed the released
0.1.1-1rock from LuaRocks and ran the vote loop on tmux 3.7 and 3.8. For the release, I usedruntime:connectwith the private socket from the release’s example launcher. Both runs read the three tallies fromawk. This branch creates its private server withruntime:start_server. Published package · Release launcher.Test plan
TMUX_BINunset on Lua 5.1.5 with tmux 3.7 and Lua 5.5.1 with tmux 3.8. Both printed the tallies above.PATH.luajit scripts/support/run_tests.lua scripts/docs/tests/test_api_examples.luaand verify that the default votes end atyes=2 no=1.Hosted checks.
Related to #84.