Skip to content

Expose the capability map through the public API #104

Open

Description

@tony

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:

References

  • libtmux-raku and libtmux-erlang already expose their maps. LibTmux::Capabilities answers status and supports for one feature and lists them all with features, for an observed daemon version. tmux_capability exports describe/1 and require/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

  1. added
    enhancement
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions