Repository navigation
Conversation
why: Readers who know Python libtmux look for `.refresh()`. Lua has no in-place refresh: a record is what tmux said when it was read, and `snapshot` on a handle reads the object again into a new record. The README only said to call `Server:snapshot` again. what: - Add a `Window:snapshot` section to the README that says Lua has no `refresh`, links `Window:snapshot`, `Session:snapshot`, `Pane:snapshot` and `Window:rename`, and quotes an excerpt with its console output (`README.md`) - Add the `refresh` example, which renames a window and prints the held and the fresh names, and list it in the API example manifest (`examples/api/refresh.lua`, `examples/api/manifest.json`) - Count the new example and its two targets in the manifest test (`tests/tooling/test_api_examples.py`)
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a "
Window:snapshot: read one object again" section to the root README, after the snapshot and query sections. The old text only said to callServer:snapshotagain. The section now says a record is what tmux said when it was read, that Lua has norefreshthat updates a record in place like Python libtmux's.refresh(), and thatsnapshoton a handle (Window:snapshot, alsoSession:snapshotandPane:snapshot) reads that one object again into a new record while the held record stays as it was.The excerpt is the body of a new
examples/api/refresh.lua: it reads a window, renames it withWindow:rename, reads it again and printseditor build. The program is listed inexamples/api/manifest.jsonwith its stdout, which the README console block is checked against, andtests/tooling/test_api_examples.pycounts it (10 programs) and its two targets.Why
The maintainer asked for a plain refresh idiom in each port's README. Sibling PRs: libtmux/libtmux-ts#194, libtmux/libtmux-rs#137.
Checks
Toolchains were bootstrapped into the ignored
.cache(bootstrap.py dev live,bootstrap_runtimes.py 5.4.9,bootstrap.py lint).scripts/check.py mid: PASS in 5.5 s. That covers the 140 tooling tests, 359 Lua unit tests, StyLuaLua51, luacheck, generated-field drift, README examples andgit diff --check. Its first runs caught a prose block over 240 characters and the missing manifest test update; both fixed.sh examples/api/run.sh examples/api/refresh.luawithTMUX_BINset to tmux 3.3a and to 3.8 builds: printseditor buildon both. With the machine's tmux 3.8a it refuses with "topology operations require a supported exact tmux release", because 3.8a is not in the library's topology version table; that is existing behavior and not part of this PR.editor BROKENmademidfail with "output differs from the manifest for examples/api/refresh.lua"; restored.libtmux-window-snapshot,libtmux-window-rename,libtmux-pane-snapshotandlibtmux-session-snapshotreference pages on libtmux.org return 200.outer(owned-tmux integration, package builds, LuaLS).Tool use: Claude Code, directed by the maintainer, wrote the change and ran the checks above.