Repository navigation
core(fix): Keep hook output out of pane and option reads - #196
Merged
Merged
Conversation
This was referenced Dec 5, 2026
why: A printing after-show-options hook shared stdout with the native read. A missing option looked configured, and a stored string could acquire extra lines. what: - Check the applicable hook in the ordinary client's command queue. - Admit native wait-for synchronization and report unqualified hooks. - Preserve multiline, indexed, inherited and empty-server reads.
why: A hook could print a receipt the pane never showed. Both capture modes returned those bytes as screen data, so a caller waiting for an application could proceed too early. what: - Use the shared read-hook check in preflight and same-client capture. - Keep identity, screen byte limits and timeout evidence independent. - Exercise a printing hook and a silent native synchronization hook.
why: Capture now applies its own byte limit. The ordinary command runner still received an option list that it never read. what: - Pass the command and deadline from all three one-shot callers.
why: The option reader resolves a tmux target along with the native flags. Its helper name still described only the flags. what: - Call the local, effective and inherited scope resolver read_scope.
why: A missing pane lost its native error evidence. A silent hook can also fail after tmux has already written the requested screen. what: - Preserve empty and qualified stdout up to the caller’s byte limit. - Keep unverified bytes out of same-client and noisy-hook errors. - Compare capture and wait failures with the native command result.
why: A descriptor can fit a plain option read but exceed the native frame limit after the hook check is added. The encoder exception escaped the public option API. what: - Prepare settings commands through the bounded Server interface. - Check the tagged failure on a descriptor whose plain read succeeds. - Change the hook between indexed reads and verify the second response.
tony
force-pushed
the
qualified-read-hooks
branch
from
December 6, 2026 01:08
7c024e4 to
861bfdb
Compare
tony
added a commit
that referenced
this pull request
Dec 6, 2026
why: A tmux hook could add output to a pane or option read. A large MCP reply could hide an operation outcome or advance a cursor before the client received the page. what: - Fit the Program listener to the server socket path, wake waiters on exit, and retry pane removal after a lost reply (#191, #192, #193). - Keep MCP operation outcomes readable and size pages before advancing their cursors. Show the STDIO client reading a result (#194, #195). - Keep hook output out of pane captures and option reads. Use `Pane.wait_for_text/4` in the notebook (#196, #197). - Check root exit separately from trace delivery in cold-start tests (#198). - Document checkout dependencies, inherited sockets and capability APIs (#199, #200, #201).
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.
Closes #183.
What changed, and why
A configured read hook can write to the same tmux client as an option lookup or pane capture. The shared server probe now qualifies the applicable hook before callers accept those bytes. Option and pane reads report
:unqualified_hookfor ambiguous output. The supported silent synchronization forms keep working.Checks run
Settings and pane-wait integration tests ran against pristine tmux 3.3 and upstream 3.8, including a real printing hook, a silent synchronization hook and a pane that never produced the expected text.
Review evidence
The daemon probe owns one-shot read qualification. Option lookups and pane captures call it on the client that reads the value. The public callers retain their own return and error contracts.
With the topic tests and the runtime code from
15ee04c78, the focused check failed. The configured hook text was returned as option or pane data. An indexed option also reported an empty value as evidence. The table gives the running time of each complete command on Linux.861bfdbddOn
fdec3da3, the follow-up tests failed because a clean capture error lost stdout and a padded option read raisedArgumentError. The original error now retains empty or qualified stdout up to the caller’s byte limit. A noisy hook cannot supply diagnostic screen bytes. A 32 KiB overflow returns:invalid_commandwith:no_write. Bypassing only the second hook check made an indexed lookup accept a fabricated empty value. The corrected 32-case suite passed on tmux 3.3 in 7.09 s and 3.8 in 6.98 s.An independent reviewer recorded
NO FINDINGSon7c024e447.Merge stack
This PR follows #195 in the tested merge order. The comparison shows this PR’s own changes. Stack #206 · Changes in this PR
All six required Linux jobs passed on
861bfdbdd. GitHub records the stack merge at15b285de9. CI run · Merged commitTool use
Codex extracted this change from #169 and ran the checks above on the topic branch. A separate Codex reviewer checked the component boundaries and the two corrected test fixtures.