Require coordinated optional tmux operation guards by tony · Pull Request #1093 · tmux-python/tmuxp · GitHub
Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGES
12 changes: 12 additions & 0 deletions MIGRATION
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ This release requires libtmux 0.63 or newer. Until libtmux 0.63 is released,
install a checkout with `uv sync --locked`.
Help, diagnostics, and configuration conversion do not require tmux.

### Optional tmux operations

Custom builders, plugins, and `tmuxp shell` use libtmux's command policy.
Control clients require tmux 3.7+, exact named-buffer deletion and renaming
require 3.4+, and captured foreground shell output requires 3.5+. On exact tmux
3.7, provide a window name to `Pane.break_pane`; unnamed and raw breaks refuse
before dispatch. Ordinary tmux 3.3a workspace operations remain available.
Percentage splits use the portable spelling. On tmux 3.3a, malformed literal
layouts refuse before dispatch; valid built-in names and serialized layouts
remain available. A libtmux without `libtmux._internal.support.require_commands` is
refused.

## tmuxp 1.18.0 (2022-10-30)

**Restructuring** (#840)
Expand Down
26 changes: 23 additions & 3 deletions docs/project/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,32 @@ version differs from the version checked for that command.
`--help`, `--version`, `debug-info`, and workspace conversion remain available
without a running server or an installed tmux executable.

## Optional operations

Plugins, custom builders, and `tmuxp shell` receive libtmux objects. Their
optional operations have individual tmux requirements:

| Operation | Requirement |
| --- | --- |
| Acquire a control-mode client | Stable tmux 3.7+ and a natively compatible client |
| Preserve exact named-buffer identity when deleting, renaming, or aborting cleanup | tmux 3.4+ |
| Return foreground `run-shell` stdout | tmux 3.5+ |
| Break a pane on exact tmux 3.7 | Supply a window name; the wrapper repairs the native name handling. Unnamed and raw calls refuse. |
| Split by percentage | Available on tmux 3.3a+ through the portable `-l N%` spelling |
| Select a literal layout on tmux 3.3a | Use a unique built-in layout name or a serialized layout. Malformed headers refuse before the native 3.3a error path. |

An unavailable operation refuses before its native command runs. An
ordinary workspace still builds, splits, captures, and freezes on tmux
3.3a. Background shell jobs and jobs directed to a pane keep their separate
execution-only contract.

## Installing this checkout

This branch requires libtmux 0.63 or newer, the first release that carries
the daemon version check, and `pyproject.toml` says so (`libtmux~=0.63.0`).
Until that release exists, `uv.lock` pins an exact development revision.
Install the checkout with its lockfile:
the daemon version check and its `require_commands` policy, and
`pyproject.toml` says so (`libtmux~=0.63.0`). Until that release exists,
`uv.lock` pins an exact development revision. Install the checkout with its
lockfile:

```console
$ uv sync --locked
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ exclude = [
]

[tool.uv.sources]
libtmux = { git = "https://github.com/tmux-python/libtmux.git", rev = "f6e4630a15f342382487a60e1e1477abcd52294d" }
libtmux = { git = "https://github.com/tmux-python/libtmux.git", rev = "5df9cb3e89647577b7dd8484f844ffe1053129bb" }

[tool.uv.exclude-newer-package]
# git-pull packages release in lockstep with their workspaces, so a
Expand Down
2 changes: 1 addition & 1 deletion src/tmuxp/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _require_backend() -> t.Any:
raise exc.LibtmuxCompatibilityError(message) from error
if not all(
callable(getattr(support, name, None))
for name in ("require_version", "server_version")
for name in ("require_version", "server_version", "require_commands")
) or not isinstance(getattr(support, "MINIMUM", None), str):
raise exc.LibtmuxCompatibilityError(message)
support.require_version(support.MINIMUM, minimum="3.3a")
Expand Down
274 changes: 274 additions & 0 deletions tests/test_feature_policy.py
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading