Types(fix): Give each settings operation its own options class - #4
Merged
Merged
Conversation
One `libtmux.SettingOptions` served every option and hook call, and one
`libtmux.EnvironmentOptions` every environment call, so the reference
and hover offered fields the runtime rejects: `run_hook` accepts only
`process`, yet `{ scope = "window" }` type-checked and then failed with
`invalid_options`. The classes now match `settings.lua`'s `prepare()` and
`environment.lua`'s option validation field for field.
- Settings: get (scope, inherit, index), list (scope, inherit), set
(scope, index, append), unset (scope, index), run_hook (process only).
- Environment: get (inherit), list (inherit, include_hidden), set
(hidden), unset and remove (scope and process only).
`libtmux.SettingOptions` and `libtmux.EnvironmentOptions` remain as the
shared bases.
tony
added a commit
to libtmux/docs
that referenced
this pull request
Sep 25, 2026
why: libtmux-lua 294ebba gives each option, hook and environment call its own options class (libtmux/libtmux-lua#4), and the adapter now reads method signatures. what: - Regenerate the Lua model, sidebar, paths and mentions from 294ebba - Move Lua's cross-reference floor to what the assembled tree resolves: signatures add links to every parameter and return type, and the eight fields that linked `Entity` plus a snapshot record now link one class
tony
added a commit
to libtmux/docs
that referenced
this pull request
Sep 26, 2026
why: libtmux-lua 294ebba gives each option, hook and environment call its own options class (libtmux/libtmux-lua#4), and the adapter now reads method signatures. what: - Regenerate the Lua model, sidebar, paths and mentions from 294ebba - Move Lua's cross-reference floor to what the assembled tree resolves: signatures add links to every parameter and return type, and the eight fields that linked `Entity` plus a snapshot record now link one class
tony
added a commit
to libtmux/docs
that referenced
this pull request
Sep 26, 2026
why: libtmux-lua 294ebba gives each option, hook and environment call its own options class (libtmux/libtmux-lua#4), and the adapter now reads method signatures. what: - Regenerate the Lua model, sidebar, paths and mentions from 294ebba - Move Lua's cross-reference floor to what the assembled tree resolves: signatures add links to every parameter and return type, and the eight fields that linked `Entity` plus a snapshot record now link one class
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.
Summary
Every option, hook and environment call shared one options type, so LuaLS hover, signature help and the libtmux.org reference offered fields the runtime rejects with
invalid_options.session:run_hook(name, { scope = "window" })type-checked and failed at runtime.Each operation now has its own class, matching
settings.lua'sprepare()andenvironment.lua's validation:Types only; runtime behaviour is unchanged.
Verification
$ mise exec -- python scripts/check.py mid$ mise exec -- python scripts/check.py typesLuaLS 3.19.1 neither completes nor diagnoses fields inside a table passed to a
fun-typed field, so no editor check can enforce these shapes; the classes were checked field by field against the runtime's allow-lists.