Repository navigation
Concept: Try a calculator in tmux from Lua or Neovim - #151
Merged
Merged
Conversation
This was referenced Dec 5, 2026
This was referenced Dec 5, 2026
tony
force-pushed
the
concept-calculator-quickstart
branch
from
December 5, 2026 23:13
2a1733d to
26801f4
Compare
why: Typing into a pane can produce a terminal echo before the program reads the input. Readers need an answer they can verify. what: - Show how to run the calculator from standalone Lua and Neovim. - Check the answer under one deadline and exercise failure and cleanup.
why: The first live example now starts an interactive program in tmux. what: - Note how standalone Lua and Neovim can try the calculator.
why: The checkout examples require owned servers, and the package controls need to exercise the program the reader actually runs. what: - Build the SCM rock in the quick start and keep a published-rock query. - Run the checkout examples against an isolated SCM installation. - Drive wrong and silent replies without editing the example source.
tony
force-pushed
the
concept-calculator-quickstart
branch
from
December 6, 2026 14:35
26801f4 to
ae13fa5
Compare
tony
marked this pull request as ready for review
December 6, 2026 14:52
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.
Try it
A Lua example opens a private tmux pane, types
19 + 23, and waits for the calculator to answer. Run it in Neovim with7 + 8to see7 + 8 = 15in:messages.$ git clone --branch concept-calculator-quickstart https://github.com/libtmux/libtmux-lua.gitFrom that checkout, follow the shell or Neovim instructions at the top of the README. The shell recipe builds the SCM rock with
Runtime:start_server. The calculator uses live pane output and needs tmux 3.7 or newer. The README also gives a screen-reading example for tmux 3.3a through 3.6b and a pure query for the published rock. Quick startStandalone Lua uses the
luvmodule. The README names the build tools for Debian, Ubuntu, Fedora and macOS. If you switch to Ubuntu or Debian’s Lua and itslua-luvpackage, a new terminal and matching LuaRocks setup let the calculator load that module.What changed
The calculator waits for the complete answer line and validates the arithmetic. Both sends and the reply share a five-second deadline. The package gate runs the installed example with incorrect and silent workers and checks private-server cleanup.
The original watch example could accept its own terminal echo. The earlier package fixture also failed when the worker's Lua variable was renamed without changing the example's behavior. The updated fixture supplies a worker through the test process's private
PATH.Test plan
lua-luvpackage. The installed example prints19 + 23 = 42on tmux 3.8.0.1.2-1candidate and run the calculator in Lua and Neovim. Ubuntu’s Lua 5.4 with itslua-luvpackage also printed19 + 23 = 42from that candidate.Refs #108, #84 and #51.