Repository navigation
Description
Summary
A caller of libtmux-lua cannot ask the library, in code, which tmux release a named feature needs or whether it is available on the connected tmux. The feature-to-release map exists only as an internal registry, the generated capabilities.json and a docs table. Expose it through the public API so a caller can query it.
Motivation
To decide whether a call will work, a caller has the snapshot's capabilities field, which holds the observed version string and, per entity kind, a table of format field names to booleans. That answers which fields this tmux reports. It does not answer whether a library feature such as Server:observe or JSON layouts is available. A refusal does carry the release it needed (required), but only after the call fails. Server has no version accessor of its own.
The registry already holds the answer: each entry has a stable id, the first release that has the feature (since), what the library does below it, and the public APIs and tmux commands involved. Its lookups, since(id) and workaround(id), sit in libtmux._internal, so a caller has no supported way to reach them.
Current state on trunk:
- The registry:
M.capabilitiesand its lookupsM.sinceandM.workaround, in the internallibtmux._internal.support.capabilitiesmodule. - The generated manifest, kept equal to the registry by a unit test:
capabilities.json. - The docs table: "Optional features" in
docs/compatibility.md. - The partial public surface:
snapshot.capabilities, documented ascapabilities.fields.
References
-
libtmux-raku and libtmux-erlang already expose their maps.
LibTmux::Capabilitiesanswersstatusandsupportsfor one feature and lists them all withfeatures, for an observed daemon version.tmux_capabilityexportsdescribe/1andrequire/2.method supports(Str:D $id --> Bool:D) { self.status($id).supported }
-
The same request is tracked in libtmux-ts#209, libtmux-go#170 and libtmux-java#164.
-
tmux records what each release changed in
CHANGES, whose newest section is 3.8.
Activity