Read client_control_mode, not client_control - #10
Open
tony wants to merge 1 commit into
Open
Conversation
why: IsControlClient read "client_control", which is not a tmux format token on any supported version -- it renders exactly like a token that does not exist. The lookup missed, so the property was false for every client, including one attached with `tmux -C`. Checked against a live control client on 3.2a through 3.7b. The same spelling sat in the query field catalog, the published JSON schema and three READMEs. Python libtmux, which this port tracks, records client_control_mode. The schema enum is corrected in place rather than versioned: the package documents itself as alpha that can change between prereleases, and its PublicAPI.Shipped.txt is still empty. what: - Read client_control_mode, the only client-control field FormatCatalog ever asks tmux for - Rename it in the field catalog generator, the query translator's example, and the three libtmux-query-v1 schema enums - Correct the three READMEs that published the old spelling - Assert a real control client reads back as one; the suite only asserted the false case, which a broken read also satisfies
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.
Client.IsControlClientwas unconditionallyfalse— for every client, on every supported tmux version. Found while auditing comments in #8; investigated separately because it is a code defect, not a comment one.The bug
ReadSnapshotis an exactTryGetValueagainst the snapshot dictionary. That dictionary is keyed by the wire namesFormatCatalogrequests, and the only client-control field it ever asks tmux for isclient_control_mode. The lookup missed, returnednull, andnull == "1"isfalse.client_controlis not a tmux format token at all. Against a live control-mode client:$ tmux list-clients -F 'control_mode=[#{client_control_mode}] client_control=[#{client_control}] invented=[#{zz_not_a_token}]'The suspect renders identically to a token invented for the comparison. Repeated across every build in the compatibility matrix — 3.2a, 3.3a, 3.4, 3.5, 3.6, 3.7, 3.7a, 3.7b — with the same result on all eight.
Python libtmux, which this port tracks, records
libtmux.neo:Obj.client_control_modeindocs/parity/python-public-api.json.Why it survived
Two tests asserted on the property and both asserted
false:ClientAdministrationTestsandComponent13ParityTests, each against a PTY-attached client, for whichfalseis correct whether or not the field resolves. A property that can only return one value is invisible to tests that never assert the other.QuerySemanticsTestsasserted the literal"client_control"under the comment "The one that a naming rule would never produce." The odd spelling was read as deliberate evidence against the naming convention rather than as a typo, so it was locked in rather than questioned.ControlModeClientScope— the test helper that finds a control client — has used#{client_control_mode}correctly all along. The right spelling was already in the repository.The regression test
Control_client_reads_back_as_oneattaches a real control client and assertsIsControlClientistrue. Verified it fails without the fix and passes with it:With the one-line fix reverted
Scope
The query surface carried the same wrong name but was not independently broken:
QueryInterpreter.ReadMemberresolves fields by CLR reflection, so a LINQ query inherited the broken property rather than adding a second fault. The exposure was to a third-party interpreter built against the published schema, which would send#{client_control}to tmux and get silent empty results.The schema enum is corrected in place rather than versioned.
src/LibTmux.Query.Json/README.mdstates the package is alpha and can change between prereleases without notice, and itsPublicAPI.Shipped.txtis empty — nothing has crossed into shipped.docs/decisions/evidence/0003/aot/libtmux-query-v1.schema.jsonis deliberately left alone: decision records quote what was run at the time and are not edited, perCONTRIBUTING.md.Verification
dotnet build --warnaserrorverify_public_api.pyverify_capabilities.pyverify_workflows.pysync_snippets.py --checkdump_tools.py --checkClientAdministrationTestsComponent13ParityTestspytest eng