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.

Public capability lookup on PR 114

With Lua 5.5.1 on the tested head of PR 114 (96ff603c0), server:capabilities():await().features["control-mode"] reported the minimum release as 3.7 in all three runs. The reported support flag was false on tmux 3.3a and true on 3.7 and 3.8. A real server:observe(session):await() on each private server agreed with its flag. This gives the PR a public caller and a below-floor control. Control-mode registry entry on master

Activity

  1. added
    enhancement
    on Nov 14, 2026
  2. added
    p2
    area:core
    topic:api
    topic:compatibility
    lua
    on Dec 3, 2026
  3. tony commented on Dec 5, 2026

    @tony
    ContributorAuthor

    The updated capability PR reports the tmux generation verified at connection, using the same Request API in standalone Lua and Neovim. For explicit socket paths the program checks the pinned socket identity. For named and default endpoints, the report describes the generation the runtime last verified. The local outer suite passed on tmux 3.8, with focused checks on tmux 3.3a. Updated capability PR.

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

    area:coreenhancementluap2topic:apitopic:compatibility

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions