Repository navigation
Capabilities(feat): Gate tmux features from one table - #887
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #887 +/- ##
==========================================
+ Coverage 53.18% 55.32% +2.14%
==========================================
Files 26 28 +2
Lines 3845 4110 +265
Branches 774 817 +43
==========================================
+ Hits 2045 2274 +229
- Misses 1496 1523 +27
- Partials 304 313 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tony
added a commit
that referenced
this pull request
Nov 21, 2026
why: capabilities.json is a new published file that tooling and the shared documentation read. what: - Add a Development entry describing the manifest and how to regenerate it
This was referenced Nov 21, 2026
why: The release each gate compares against was a literal at its call site, so nothing listed what libtmux gates or published it. The other libtmux ports publish a generated capability manifest keyed by shared ids. what: - Add an internal capability table with the nine shared ids whose tmux command, flag and release match an existing gate - Read the release for those eleven gates from the table, through the existing has_gte_version helper, so behaviour is unchanged - Generate capabilities.json from the table, with a recipe to rebuild it and a test that fails when the file drifts - Test that each routed gate falls back or refuses when its table release is raised
why: Five hook methods skipped the -w and -p scope flags on tmux older than 3.2. libtmux supports 3.2a and newer, so the branch ran only on a tmux it does not support. what: - Pass the scope flag unconditionally in run_hook, set_hook, unset_hook, show_hooks and _show_hook - Remove the private _tmux_bin helper that only those gates read
why: capabilities.json is a new published file that tooling and the shared documentation read. what: - Add a Development entry describing the manifest and how to regenerate it
why: The ports' shared naming puts version checks at support.versions and optional features at support.capabilities. what: - Move the capability table to libtmux._internal.support.capabilities - Add the support package with a module docstring - Update the gates, the tests and the build-capabilities recipe
tony
force-pushed
the
capabilities-table
branch
from
November 22, 2026 00:54
2a1e253 to
e42a97d
Compare
why: Python, tmux, and platform compatibility sits alongside the
changelog and migration notes rather than contributor workflow guides
under Project.
what:
- Move docs/project/compatibility.md to docs/compatibility.md and place
it beneath Migration notes in the root toctree
- Redirect project/compatibility.md and api/compatibility.md to
compatibility.md
- Update internal {doc} and grid-card links across docs/
why: The compatibility page stated only the minimum tmux version, while libtmux._internal.support.capabilities already lists each gated feature, its release threshold, and the Python APIs and refusal errors it concerns. what: - Add the docs._ext.tmux_capabilities Sphinx extension and the tmux-capabilities directive backed by sphinx-ux-badges - Link each entry's APIs and refusal exception through Python-domain cross-references that warn when unresolved - Render the capability matrix across tmux 3.2a through 3.8 on docs/compatibility.md - Type-check docs/_ext under mypy and add directive, cross-reference, option, workaround, and text-builder tests
why: Readers scanning release notes can find the relocated compatibility page and its tmux capability matrix. what: - Add a Documentation entry linking /compatibility and /migration
why: Comparing only parsed JSON skipped capabilities.render(), the serializer just build-capabilities writes to capabilities.json. what: - Assert MANIFEST_PATH.read_text() equals capabilities.render() in test_manifest_matches_table
why: docs/project/compatibility.md moved to docs/compatibility.md. what: - List compatibility.md alongside project/ in the repository map
why: Changelog deliverable headings carry their (#NN) pull request reference. what: - Add (#887) to the capability matrix heading in CHANGES
This was referenced Nov 22, 2026
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
libtmux._internal.support.capabilities) for tmux features gated by release.ServerandPaneversion gates with matching cross-port IDs through the table with no change in runtime behaviour.capabilities.json(libtmux-capabilities/1), generated from the table viajust build-capabilitiesand guarded by a drift test.3.2a–3.8on/compatibility(moved to the top-level sidebar beneath Migration notes) via a newtmux-capabilitiesSphinx directive.< 3.2hook-scope gates below the3.2acompatibility floor.The release each gate compares against was a literal at its call site, so nothing listed what libtmux gates. The other ports publish a generated manifest keyed by shared capability ids; this gives Python the same table, starting with the ids whose tmux command, flag and release already match an existing gate, and renders it directly in the Sphinx documentation.
Changes
Capability table
src/libtmux/_internal/support/capabilities.py:CapabilityandCommanddataclasses, theCAPABILITIEStable,capability_since()for gates, andmanifest()/render()for the published file.capabilities.json: the generated manifest (schemalibtmux-capabilities/1,portpy, floor3.2a).justfile:build-capabilitiesregenerates the manifest.Gates that now read the table
sincerun-shell-start-directoryServer.run_shellrun-shell -c-crun-shell-show-stderrServer.run_shellrun-shell -E-Erun-shell-argsServer.run_shellrun-shellargumentslist-keys-formatServer.list_keyslist-keys -F-Fcapture-trim-blank-cellsPane.capture_panecapture-pane -T-Tcapture-mode-screenPane.capture_panecapture-pane -M-Mcapture-line-flagsPane.capture_panecapture-pane -F,-H,-Lpaste-buffer-no-visPane.paste_bufferpaste-buffer -S-Sfloating-panePane.new_panenew-paneLibTmuxExceptionDocumentation
docs/_ext/tmux_capabilities.pyanddocs/_ext/_static/css/tmux_capabilities.css:tmux-capabilitiesSphinx directive rendering capabilities and workarounds across tmux releases withsphinx-ux-badgesstatus pills andpy:objcross-references (refwarn=True) for every API and refusal exception.docs/compatibility.md,docs/index.md,docs/project/index.md,docs/redirects.txt: move Compatibility out ofProjectto the top-level sidebar beneath Migration notes, render the capability matrix, and redirect bothproject/compatibility.mdandapi/compatibility.md.Hooks
src/libtmux/hooks.py:run_hook,set_hook,unset_hook,show_hooksand_show_hookpass the-w/-pscope flag unconditionally; removeHooksMixin._tmux_bin, which had no other callers.Design decisions
has_gte_version()and take only the release from the table. The suite replaces that helper by module attribute inlibtmux.serverandlibtmux.pane, so a gate that stopped calling it would stop seeing those replacements.refresh-client -lstays on its literal. libtmux gates it at 3.7 and the sharedclipboard-queryid says 3.6a; the table should not publish an id with a release the vocabulary does not give it.libtmux._internal.support, the package name Support(feat): Verify connected tmux daemon meets the 3.3a minimum #779 introduces for version support. No public accessor is added until a caller outside the package needs one.tmux-capabilitiessetsrefwarn=Trueon every generatedpy:objcross-reference so a normaljust build-docsbuild warns immediately if any published API or refusal exception lacks a documented target.Verification
Verify no
< 3.2version gates or_tmux_binreferences remain inhooks.py:$ rg 'has_.*version|_tmux_bin' src/libtmux/hooks.pyVerify no stale
project/compatibilityreferences remain outsidedocs/redirects.txt:$ rg 'project/compatibility' docs CHANGESTest plan
test_manifest_matches_table: committedcapabilities.jsonmatches bothcapabilities.manifest()andcapabilities.render()(fails onsinceedits and formatting drift)test_gate_reads_its_release_from_the_table: every routed gate warns and omits its flag, or raisesLibTmuxException, when its tablesinceis raised above the running tmuxtest_published_names_resolve: every API and error dotted path in the manifest importstest_docs_capabilities.py:tmux-capabilitieslinks documented APIs and refusal errors, warns on unresolvedpy:objtargets (refwarn=Truemutation proven), supports:api:,:versions:,:group-releases:,:no-legend:, workarounds, and thetextbuilderruff check,ruff format --check,mypy(includingdocs/_ext)just build-docsandjust -f docs/justfile checkbuild(includingredirafferedirects for/project/compatibility/and/api/compatibility/)3.2athrough3.8andmaster)Related issues and companion PRs
capabilities.jsonin distributions and exposeServer.capabilities()#871 — ships the rootcapabilities.json(libtmux-capabilities/1) manifest, internal registry, and Sphinx matrix; publicServer.capabilities()and wheel/sdist bundling remain open in Packagecapabilities.jsonin distributions and exposeServer.capabilities()#871.tmuxdaemon meets the3.3aminimum before dispatch #777) raise the minimum tmux to3.3aand remove the samesrc/libtmux/hooks.pyscope gates; Support(feat): Verify connected tmux daemon meets the 3.3a minimum #779 also addslibtmux._internal.support. Whichever of Capabilities(feat): Gate tmux features from one table #887 and tmux(feat[minimum]): Require tmux 3.3a #888/Support(feat): Verify connected tmux daemon meets the 3.3a minimum #779 merges second should runjust build-capabilitiessofloor.minimumincapabilities.jsonmatchesTMUX_MIN_VERSION.