Repository navigation
Concept: Tell whether a build passed after its pane closes - #154
Merged
Merged
Conversation
This was referenced Dec 5, 2026
tony
force-pushed
the
concept-program-exit
branch
from
December 5, 2026 23:54
fde768a to
d6986a0
Compare
tony
force-pushed
the
concept-program-exit
branch
from
December 6, 2026 01:17
d6986a0 to
d66efdc
Compare
why: A build can exit before Lua reads its last line. Two builds can leave the same screen and still return different exit codes. what: - Send the direct child’s exit result back to a standalone Lua caller. - Run the commands in real panes and test early exits and replacement. - Show how to use a retained screen sample when one is available.
why: An application exit result and final terminal output must survive the pane lifecycle. Standalone Lua and Neovim need the same ownership contract. what: - Start an interactive Program or run it to completion with a Request. - Retain the application exit, terminal bytes, final screen and cleanup. - Test input, deadlines, explicit stop and externally closed sessions.
why: Readers need the entry points for running and interacting with an owned application in tmux. what: - Summarize run_program and start_program under Unreleased.
tony
force-pushed
the
concept-read-pane-line
branch
from
December 6, 2026 14:35
48b0380 to
751fee9
Compare
tony
force-pushed
the
concept-program-exit
branch
from
December 6, 2026 14:35
d66efdc to
f0681c8
Compare
tony
marked this pull request as ready for review
December 6, 2026 14:53
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
Build the checkout rock and run the Program example in standalone Lua or Neovim. It reports a calculator's reply and exit 7, a stopped interactive program's signal 15, and a run that reaches its deadline and cleans up its pane. Program guide
What the example proves
Server:run_program(argv)returns a Request for the application's exit or signal, a bounded prefix of terminal bytes, the captured viewport and the cleanup result.Server:start_program(argv)returns a Request for a Program whose input, screen, wait and stop operations can run in the same runtime scope. The Program keeps its confirmed status after its pane closes.The Linux supervisor qualifies process-tree cleanup with pidfds and a subreaper. A launch can require that scope before the application starts. Other configurations report direct-child cleanup. macOS process-tree cleanup and recovery when the Lua process exits before it can save a receipt remain open in #107. The separate test in #208 runs two programs whose final screens look the same. It reads their different exit codes and fails if the wrong code is returned.
If Lua or Neovim exits after starting a program, its temporary socket directory has already been removed. The live connections still carry the application's output and exit status.
If the runtime closes during
start_programorrun_program, inspect the Request’s error after it retires. It still reportscancelled. When libtmux cannot confirm removal of the pane,err.cleanup_errordescribes the cleanup failure anderr.program_nameidentifies the session to inspect on the same tmux server. The session may already have closed. Startup cleanup evidence.Test plan
/bin/caton a private tmux 3.8 server, then exit Lua or Neovim. The app and its pane go away, the earlier tmux session stays open, and the temporary Program directory is gone. Reproduction in #107.start_programandrun_program. The in-process Server test checks the cleanup error and the exact tmux session name, before and after the supervisor connects. On Lua 5.1.5 and 5.5.1, the previous numbered candidate failed at the missing cleanup error and the corrected private0.1.2-1install passed both launch methods.Refs #107, #150 and #27.
Selecting tmux
The checkout-only syntax-check example in
examples/concepts/program_exitfell back to/usr/bin/tmuxeven when the user had another tmux on PATH. After #179, the staged launcher and guide let the runtime choose the executable. Both syntax checks used the selected tmux on 3.3a and 3.8 and retained their expected exit results. An explicit TMUX_BIN took precedence. Runtime PATH support.