Skip to content

Add a standalone, CI-run example program for each core capability #61

Open

Description

@tony

Summary

The docs site's Core API showcase (libtmux/docs#243) shows, per capability, a complete example program next to a list of capabilities. It shows a capability for a port only when that port has a program that qualifies, so today this port shows few or none:

  1. Navigate tmux via a typed object graph
  2. Watch for changes
  3. Send keys
  4. Run applications (where the port has a run-to-exit API)
  5. Rename windows
  6. Create windows
  7. Move windows
  8. Set layouts

Motivation

A reader copies the example, so it has to build and run as shown, and its CI run has to prove it. Excerpts of larger files and test helpers do not qualify.

Current state: Not yet audited against the rule below. The read-only audit of 2026-11-01 lists this port's APIs and examples per capability; each candidate needs checking against the rule.

Proposal

For each capability the library supports, add one small program under the repository's examples that:

  • is a whole file with its imports or use lines, its entry point and its own server setup on a private socket, and no helper defined elsewhere in the repository;
  • does one capability and prints or asserts its outcome, for example the captured line after sending keys, or the new window's name after a rename;
  • runs in CI on a supported tmux, failing on a non-zero exit or a missing expected line, and states its tmux floor where the capability needs one;
  • stays under about 150 lines.

The docs site reads each program whole at the pinned revision; a program it cannot verify is left out rather than excerpted.

References

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions