diff --git a/CHANGES b/CHANGES index da5c158a1b..a1146aff9d 100644 --- a/CHANGES +++ b/CHANGES @@ -44,6 +44,23 @@ $ tmuxp@next load yoursession _Notes on the upcoming release will go here._ +### Dependencies + +#### Minimum `libtmux~=0.70.0` (was `~=0.69.0`) (#1114) + +See the +[libtmux 0.70.0 release notes](https://libtmux.git-pull.com/history/#libtmux-0-70-0-2026-11-28). + +### Fixes + +#### `tmuxp shell` suppresses `list-sessions` output and CLI startup catches unusable `tmux` binaries + +`tmuxp shell` no longer writes `tmux list-sessions` lines to standard output +before running `-c` or opening an interactive Python console, and `tmuxp` +prints its `"tmux not found."` message instead of an `OSError` traceback when a +`tmux` file on `PATH` is non-executable or malformed. Both fixes come from +libtmux 0.70.0. + ## tmuxp 1.83.0 (2026-11-28) tmuxp 1.83.0 updates libtmux to 0.69.0. `tmuxp freeze` now writes window `@` @@ -101,10 +118,7 @@ is the latest 3.7 patch release). #### Minimum `libtmux~=0.69.0` (was `~=0.68.0`) (#1113) -Picks up libtmux 0.69.0. `with Server()` leaves a running tmux server alive on -exit unless `Server(..., kill_on_exit=True)` is set, `@` user options stay -strings in `show_option()` and `show_options()`, and empty tmux format fields -hydrate as `""` instead of `None` while unset fields stay `None`. See the +See the [libtmux 0.69.0 release notes](https://libtmux.git-pull.com/history/#libtmux-0-69-0-2026-11-27). ### Development @@ -184,12 +198,7 @@ This comes from libtmux 0.68.0. #### Minimum `libtmux~=0.68.0` (was `~=0.67.1`) (#1112) -Picks up libtmux 0.68.0. Closed panes, windows and sessions raise -`TmuxObjectDoesNotExist` (including from `Pane.capture_pane()` and -`Pane.send_keys()`), `Server.run_shell()` raises `VersionTooLow` on tmux 3.3a -and 3.4 instead of returning `[]`, `Session.new_window(select_existing=True)` -reuses a window by index or target on every tmux, and `expand_formats` is the -one parameter name for tmux's `-F`. See the +See the [libtmux 0.68.0 release notes](https://libtmux.git-pull.com/history/#libtmux-0-68-0-2026-11-24). ## tmuxp 1.81.0 (2026-11-22) @@ -211,32 +220,24 @@ so `#S` became the session name. This comes from libtmux 0.67.0. #### Minimum `libtmux~=0.67.1` (was `~=0.66.0`) (#1111) -Picks up libtmux 0.67.0 and 0.67.1. Names, titles, start directories and -buffer paths passed to libtmux are kept as typed, `libtmux.Format` asks tmux -to expand one value, and `new_session(kill_session=True)` kills only the -exactly named session. 0.67.1 makes `new_window(select_existing=True)` find a -window by its literal name on every tmux. See the -[libtmux 0.67.0](https://libtmux.git-pull.com/history.html#libtmux-0-67-0-2026-11-22) +See the +[libtmux 0.67.0](https://libtmux.git-pull.com/history/#libtmux-0-67-0-2026-11-22) and -[0.67.1](https://github.com/tmux-python/libtmux/releases/tag/v0.67.1) +[0.67.1](https://libtmux.git-pull.com/history/#libtmux-0-67-1-2026-11-22) release notes. ## tmuxp 1.80.0 (2026-11-22) -tmuxp 1.80.0 updates libtmux to 0.66.0. It has no breaking changes of its own: -libtmux 0.66.0's two breaking changes are in APIs tmuxp does not call. A socket -path too long for tmux, passed to `tmuxp load -S` or `tmuxp freeze -S`, now ends -in a `SocketPathTooLong` error that says how far over the limit it is. +tmuxp 1.80.0 updates libtmux to 0.66.0. A socket path too long for tmux, passed +to `tmuxp load -S` or `tmuxp freeze -S`, now ends in a `SocketPathTooLong` error +that says how far over the limit it is. ### Dependencies #### Minimum `libtmux~=0.66.0` (was `~=0.65.0`) (#1110) -Picks up libtmux 0.66.0. Files `save_buffer()` creates are readable by their -owner only, `send_keys(hex_keys=True)` no longer adds Enter, and a socket path -too long for tmux raises `SocketPathTooLong`, including one passed to -`tmuxp load -S` or `tmuxp freeze -S`. See the -[libtmux 0.66.0 release notes](https://libtmux.git-pull.com/history.html#libtmux-0-66-0-2026-11-22). +See the +[libtmux 0.66.0 release notes](https://libtmux.git-pull.com/history/#libtmux-0-66-0-2026-11-22). ## tmuxp 1.79.0 (2026-11-22) @@ -256,9 +257,8 @@ tmux 3.2a is no longer supported, through the libtmux 0.65.0 update; tmuxp #### Minimum `libtmux~=0.65.0` (was `~=0.64.0`) (#1109) -Picks up libtmux 0.65.0, which publishes a capability matrix of the tmux -features it gates by release and requires tmux 3.3a. See the -[libtmux 0.65.0 release notes](https://libtmux.git-pull.com/history.html#libtmux-0-65-0-2026-11-22). +See the +[libtmux 0.65.0 release notes](https://libtmux.git-pull.com/history/#libtmux-0-65-0-2026-11-22). ### Fixes @@ -276,10 +276,10 @@ breaking changes. #### Minimum `libtmux~=0.64.0` (was `~=0.63.0`) (#1106) -Picks up libtmux 0.64.0, a fixes-only release. Commands act on the session, -window or pane they were called on, values that start with `-` or end in `;` -reach tmux as data, and a newline in a pane's path no longer breaks listings. -See the [libtmux 0.64.0 release notes](https://libtmux.git-pull.com/history.html#libtmux-0-64-0-2026-11-21). +Values in workspace names, options, environment variables, and `shell_command` +entries that start with `-` or end in `;` now reach tmux as data, and a newline +in a pane's path no longer breaks listings. See the +[libtmux 0.64.0 release notes](https://libtmux.git-pull.com/history/#libtmux-0-64-0-2026-11-21). ## tmuxp 1.77.0 (2026-11-21) @@ -296,11 +296,8 @@ end of life in October 2026. #### Minimum `libtmux~=0.63.0` (was `~=0.62.0`) (#1105) -Picks up libtmux 0.63.0. {meth}`~libtmux.Pane.break_pane` now returns the -destination window when it moves a window's only pane, and -{meth}`~libtmux.hooks.HooksMixin.show_hook` reads the hooks tmux 3.8 added. -libtmux 0.63.0 requires Python 3.11 or later, the floor tmuxp already has. See -the [libtmux 0.63.0 release notes](https://libtmux.git-pull.com/history.html#libtmux-0-63-0-2026-11-21). +See the +[libtmux 0.63.0 release notes](https://libtmux.git-pull.com/history/#libtmux-0-63-0-2026-11-21). ### Documentation diff --git a/pyproject.toml b/pyproject.toml index 535f8fd30a..7947c8e8bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ include = [ { path = "conftest.py", format = "sdist" }, ] dependencies = [ - "libtmux~=0.69.0", + "libtmux~=0.70.0", "PyYAML>=6.0" ] diff --git a/tests/cli/test_cli.py b/tests/cli/test_cli.py index bd32588ed4..479b5eca02 100644 --- a/tests/cli/test_cli.py +++ b/tests/cli/test_cli.py @@ -49,6 +49,26 @@ def has_minimum_version() -> bool: assert message in capsys.readouterr().out +def test_cli_reports_malformed_tmux_binary_without_traceback( + tmp_path: pathlib.Path, + monkeypatch: pytest.MonkeyPatch, + capsys: pytest.CaptureFixture[str], +) -> None: + """cli() reports a malformed tmux binary instead of raising OSError.""" + broken_tmux = tmp_path / "tmux" + broken_tmux.write_bytes(b"\x7fELF") + broken_tmux.chmod(0o755) + monkeypatch.setenv("PATH", str(tmp_path)) + libtmux.common.get_version.cache_clear() + try: + with pytest.raises(SystemExit): + cli.cli(["ls"]) + finally: + libtmux.common.get_version.cache_clear() + + assert "tmux not found." in capsys.readouterr().out + + class HelpTestFixture(t.NamedTuple): """Test fixture for help command tests.""" diff --git a/tests/cli/test_shell.py b/tests/cli/test_shell.py index da97afb237..43814f914f 100644 --- a/tests/cli/test_shell.py +++ b/tests/cli/test_shell.py @@ -471,3 +471,34 @@ def test_shell_interactive( result = capsys.readouterr() assert message.format(**template_ctx) in result.err + + +def test_shell_command_does_not_leak_list_sessions_output( + server: Server, + session: Session, + tmp_path: pathlib.Path, + monkeypatch: pytest.MonkeyPatch, + capfd: pytest.CaptureFixture[str], +) -> None: + """Verify ``tmuxp shell -c`` writes only the command's output.""" + assert server.socket_name is not None + assert session.name is not None + monkeypatch.setenv("HOME", str(tmp_path)) + monkeypatch.delenv("TMUX_PANE", raising=False) + monkeypatch.delenv("TMUX", raising=False) + monkeypatch.chdir(tmp_path) + capfd.readouterr() + + cli.cli( + [ + "shell", + f"-L{server.socket_name}", + session.name, + "-c", + "print('only-this')", + ] + ) + + captured = capfd.readouterr() + assert captured.out == "only-this\n" + assert captured.err == "" diff --git a/uv.lock b/uv.lock index 6d53305e37..b664f81fd6 100644 --- a/uv.lock +++ b/uv.lock @@ -709,11 +709,11 @@ wheels = [ [[package]] name = "libtmux" -version = "0.69.0" +version = "0.70.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/75/96/f2b02bae053cf269af7296a881cf3dda96789e10d52d6351a141d50e1688/libtmux-0.69.0.tar.gz", hash = "sha256:44ec3c985884aed01351a26db10da4ddcec9ef0ff9dfe2fb55fefc597ac76a59", size = 724881, upload-time = "2026-11-28T00:47:03.346Z" } +sdist = { url = "https://files.pythonhosted.org/packages/51/f1/a44043193fd4c212858cdca04b8e628ce557726bf81f04fdc9765d4c2ac7/libtmux-0.70.0.tar.gz", hash = "sha256:1496d6253aea98321a99b5e414f378154967a570ffd1f5dc9f1effaa01f782c3", size = 1491548, upload-time = "2026-11-28T23:17:25.409Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/17/b6/7d0129ba159838073fea28ffa2155638c37b77254240691aa4983bb7d5e4/libtmux-0.69.0-py3-none-any.whl", hash = "sha256:2179066ceecb45706b3f017e88e5a2c6bbfa52738810f61fbab66e695f4e9fae", size = 165059, upload-time = "2026-11-28T00:47:02.039Z" }, + { url = "https://files.pythonhosted.org/packages/c9/f6/9273ce6bba65485ad2c6d95eb287798913b463cfddd6c7737a01fb7587f6/libtmux-0.70.0-py3-none-any.whl", hash = "sha256:9fcdccc64bb354ca6e243e942484b58f4f950b4a14ff4a324ae2dc4005afe1b2", size = 188971, upload-time = "2026-11-28T23:17:23.977Z" }, ] [[package]] @@ -1630,7 +1630,7 @@ testing = [ [package.metadata] requires-dist = [ - { name = "libtmux", specifier = "~=0.69.0" }, + { name = "libtmux", specifier = "~=0.70.0" }, { name = "pyyaml", specifier = ">=6.0" }, ]