Skip to content

Docs(feat[readme]): Show how to read a window, session or pane again - #97

Merged
tony merged 1 commit into
masterfrom
docs-readme-refresh
Nov 7, 2026
Merged

tony merged 1 commit into
masterfrom
docs-readme-refresh

Conversation

@tony

@tony tony commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

What

Adds a "Window#snapshot: read one object again" section to the root README, after the snapshot queries. It says a record from a snapshot is what tmux said when it was read and a change to tmux does not reach it, that Ruby has no in-place refresh like Python libtmux's .refresh(), and that Window#snapshot (also Session#snapshot, Pane#snapshot) reads the object again into a new record while the one you hold stays as it was.

The excerpt is the refresh/main region of a new examples/refresh.rb: it renames a window, then prints the held record's name (editor) and the fresh read's name (build). The program is registered in examples/manifest.json as a program and as a snippet, and scripts/examples --write filled the README block.

Why

The maintainer asked for a plain refresh idiom in each port's README. Sibling PRs: libtmux/libtmux-ts#194, libtmux/libtmux-rs#137. Ruby's real idiom is Entity#snapshot, so the section says so instead of inventing a refresh.

Checks

  • scripts/examples --check: 29 programs, source excerpts current.
  • scripts/check mid: 306 runs, 3874 assertions, 0 failures (includes the README block lint and example manifest tests).
  • scripts/check packaging: 5 runs, 403 assertions, 0 failures (builds the gems and runs the programs from the installed artifacts).
  • Negative check: changing the expected output in examples/refresh.rb made the program fail with unexpected names; restored.
  • Links: libtmux-window-snapshot, libtmux-session-snapshot and libtmux-pane-snapshot reference pages on libtmux.org return 200.
  • No lint tool (standardrb or rubocop) is configured in the bundle, so none was run.

Tool use: Claude Code, directed by the maintainer, wrote the change and ran the checks above.

why: Readers who know Python libtmux look for `.refresh()`. Ruby has no
in-place refresh: a snapshot record is what tmux said when it was read,
and `Entity#snapshot` reads the object again into a new record. The
README did not say so.

what:
- Add a `Window#snapshot` section to the README that says a held record
  does not follow tmux, that Ruby reads again rather than refreshing in
  place, and links `Window#snapshot`, `Session#snapshot` and
  `Pane#snapshot` (`README.md`)
- Add the `refresh` program, which renames a window and prints the held
  record's name and the fresh read's name, and register it with its
  `refresh/main` excerpt (`examples/refresh.rb`, `examples/manifest.json`)
@tony
tony force-pushed the docs-readme-refresh branch from 09efb09 to 97fe1cf Compare November 7, 2026 18:42
@tony
tony merged commit 5a30ad8 into master Nov 7, 2026
14 checks passed
@tony
tony deployed to docs-preview-cleanup November 7, 2026 19:17 — with GitHub Actions Active

This branch was successfully deployed

1 active and 1 inactive deployments
docs-preview-cleanup — 97fe1cf6 Deployed Nov 7, 2026 by tony via cleanup #70
docs-preview — 97fe1cf6 Deployed Nov 7, 2026 by tony via publish (pr-97, pr, false, docs-preview, true) / publish #341
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant