Skip to content

Fix what the verification pass flagged #51

Open

Description

@tony

Summary

A verification pass over v0.1.0alpha3 (26c7bbe) found fixes that no open PR or issue covers. Nested tmux commands bypass the raw-command gate and kill the daemon on exact tmux 3.7, the exact-release option tables refuse every tmux release they do not list, and the release body, the manifest wording and the standalone install path each leave an adopter guessing. These matter because the library's pitch is that refusals fire before dispatch.

Must-have fixes

  • The raw-command gate does not read nested command text, and the limit is described only in prose. docs/commands.md lines 29-34 says the nested copy "reaches tmux unchecked", but not which releases, which commands, or what failure class. Evidence: on exact tmux 3.7 with two panes, server:command({"if-shell","-F","1","break-pane -d"}) and server:command({"run-shell","-C","break-pane -d"}) both returned exit 1 and the daemon was dead afterwards, while plain break-pane -d and breakp -d were refused with unsupported and effect = "not_sent". tmux 3.8 passed the same forms through with the daemon alive. Fix, as the documentation item below: state the limit precisely and pin it with a test. Gating nested text (parsing if-shell, run-shell -C and brace blocks with the command resolver) was researched and is not recommended: it needs a second tokenizer that matches tmux's string grammar (newline separators, escapes, aliases) and still cannot see key bindings or hooks.
  • The public capability manifest distinguishes a refused raw command from a repair made by Pane:break_out. The Lua capability and feature suites passed all 18 tests at 2b12cea8. Merged fix #53 · Generated manifest.
  • Keep option and hook lookup exact for the tmux version the server reports. For a release absent from the catalog, return unsupported_version and tell the caller that its settings are unknown. The 3.8 lookup returned 183 option names in QA. Maintainer decision · Implementation and tests in #184.
  • The October alpha release description lists the tmux 3.3a minimum for libtmux and the tmux 3.7 minimum for live pane output. It links to the changelog for the tagged source.
  • Keep the standalone luv setup instructions when updating the calculator quick start. Master lists the build tools for Debian and Ubuntu, Fedora, and macOS, plus the lua-luv fallback for the distribution’s Lua. The revised Calculator guide keeps those prerequisites. The private numbered rock also ran the calculator with Ubuntu's distribution Lua and lua-luv. The public install is tracked in README quick start calls Runtime:start_server, which the published rock lacks #108. Original setup fix #52 · Calculator PR #151.

Documentation item: the nested-command limit

Document the limit precisely in docs/commands.md and link it from the README Support section.

  • Applies to: a refused command written inside another command's argument, such as if-shell -F 1 'break-pane -d' or run-shell -C 'break-pane -d'. tmux also reads nested text from key bindings and hooks, which the library never sees.
  • Releases and failure class: break-pane without -n on exactly 3.7 kills the daemon (crash); select-layout with an invalid layout string kills 3.3 and 3.3a (crash); refresh-client -l can kill the daemon below 3.6a only when an attached terminal does not answer (crash); delete-buffer -b NAME below 3.4 acts on the newest buffer when the name does not exist (wrong buffer); split-window -p on 3.4 and a : or . in a name on 3.7 get tmux's own error (error).
  • Advice: on exact tmux 3.7, name every break-pane with -n; upgrade to 3.7a, which fixes the crash.
  • Test: pin the limit with a case that uses a nested form tmux accepts, if-shell -F 1 'break-pane -d', not { break-pane }, which tmux rejects with "syntax error". On exact 3.7 the nested form must reach tmux unchecked; on 3.7a the daemon must survive; a plain break-pane -d must still be refused.

Already covered

Covered by #49: the docs/compatibility.md status paragraph, the README note that observation needs tmux 3.7, and the CHANGES.md alpha3 install-pin line. The core polling wait is tracked in #50. The break-pane, split-window -p and 3.7 name refusals are present in the manifest's workarounds array and are not reported as missing.

Needs a decision

  • A published MCP server: packages/mcp is an unpublished scaffold with no tools (packages/mcp/README.md). Shipping one is the largest adoption lever for agent users but is a new package with its own support surface; a dated statement of when it ships is the cheap alternative.
  • Gating nested command text in the library: closes the crash for hand-written nested forms but adds a tokenizer that can disagree with tmux in both directions; the documentation item above is the recommended alternative.

Delivery of the verified items

The exact-release settings lookup and the standalone Calculator setup passed their local checks. The changes remain in the settings PR and the Calculator PR.

Activity

  1. tony commented on Oct 24, 2026

    @tony
    ContributorAuthor

    Left open from the capabilities.json item: the break-pane entry cannot be fixed without cutting a new release.

    The manifest is generated, not hand-written. scripts/emit_capabilities.lua serializes the registry in lua/libtmux/_internal/support/capabilities.lua, where break-pane-misnames-windows has handling = "repair" and commands = { { command = "break-pane" } } (apis lists only libtmux.Pane:break_out). lua/libtmux/_internal/features.lua reads the same entry for its required release, and tests/unit/capabilities.lua checks that the committed JSON equals the registry. So the source of the wrong value is in lua/, and the generator is inside the repository.

    The registry is a packaged module, and that is what makes this harder than predicted. I made the change (the raw command as refuse with the raw command APIs, plus a separate repair entry for Pane:break_out, JSON regenerated, unit tests passing) and CI failed in scripts/package.py: "source rock differs from the tested checkout: libtmux-lua/lua/libtmux/_internal/support/capabilities.lua". Before a release is public, that gate packs the source rock from the v0.1.0alpha3 tag (source_rock in scripts/package.py) and compares every file under lua/ with the checkout, so any change under lua/ fails it until the version changes.

    A fix needs a release decision: a new source version (for example 0.1.0alpha4-1) with the registry change, or a decision to let the package gate compare against the tag only for files the release touched. I dropped the item from the PR and did not push the change.

  2. added
    p1
    bug
    area:core
    topic:compatibility
    lua
    on Dec 3, 2026
  3. tony commented on Dec 5, 2026

    @tony
    ContributorAuthor

    The settings catalog will require an exact tmux release. In the Lua test, 3.8 returned 183 option names. An unlisted 3.8a returned unsupported_version and explained that its settings are unknown. This gives callers a defined result when a new tmux release appears.

    The October alpha release page now gives both requirements. The library needs tmux 3.3a or newer, and live pane output needs tmux 3.7 or newer. v0.1.0alpha3 release notes.

    I installed the published 0.1.0alpha3-1 rock in an empty LuaRocks tree. Connecting to tmux 3.3 returned unsupported_version. On 3.3a the connection and snapshot worked, and requesting live output returned unsupported with required = "3.7". On 3.7 the same request opened and closed the observer on a private server. The 3.3a minimum is recorded under alpha2 in the changelog. The alpha3 section records the newer minimum for live output. Compatibility at the tag · Control mode at the tag.

    The updated calculator PR restores the named build tools for standalone Lua. I also tested the Ubuntu package fallback. A shell configured for Lua 5.5 could not load Ubuntu’s lua-luv after switching to Lua 5.4.6. From a new terminal, installing libtmux and setting the paths with LuaRocks configured for 5.4 let the calculator print 19 + 23 = 42. Tested quick start · Calculator PR #151.

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:corebugluap1topic:compatibility

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions