Skip to content

Commit bcefd68

Browse files
authored
Drop support for tmux versions < 3.2 (#993)
Remove old tmux version references (< 3.2) Clean up all references to tmux versions older than 3.2 now that the minimum version has been bumped to tmux 3.2+ (via libtmux 0.48.0). Documentation updates: - docs(README) Update minimum tmux version to 3.2+ - docs(about) Update minimum tmux version to 3.2+ - docs(about_tmux) Update tmux version requirement to 3.2+ - docs(quickstart) Update minimum tmux version to 3.2+ - docs(quickstart) Python 3.7 -> 3.9 - docs(AGENTS) Update minimum tmux version to 3.2+ - docs(examples) Remove tmux 3.0 version note for environment variables - docs(CHANGES) Note PR #993 Code cleanup: - plugin(TMUX_MIN_VERSION) Update to 3.2 - builder! Remove tmux < 3.0 environment variable warning - builder! Remove tmux 2.6 version check for terminal size - cli(load) Remove outdated tmux 2.6 docstring note Test cleanup: - tests(test_load) Remove tmux 2.1 skip marker - tests(test_builder) Remove tmux < 3.0 skip and delete obsolete test - tests(test_builder) Remove tmux 2.3 conditionals - tests(test_builder) Remove tmux 3.2a skip marker - tests(test_builder) Remove tmux 2.9 skip markers and cleanup imports
2 parents 4caac8e + 818b24a commit bcefd68

File tree

12 files changed

+14
-143
lines changed

12 files changed

+14
-143
lines changed

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,4 @@ windows:
121121
- **Doctest format**: Use narrative descriptions with blank lines between sections
122122
- **Complex examples**: Move to `tests/examples/<path>/test_<example>.py`
123123
- **Minimum Python**: 3.9+ (as per README)
124-
- **Minimum tmux**: 1.8+ (as per README)
124+
- **Minimum tmux**: 3.2+ (as per README)

CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ _Future release notes will be placed here_
3535

3636
### Breaking changes
3737

38-
#### Minimum tmux version bumped to 3.2+ (#992)
38+
#### Minimum tmux version bumped to 3.2+ (#992, #993)
3939

4040
tmux versions below 3.2a are now disabled (via libtmux v0.49.0).
4141

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ See donation options at <https://tony.sh/support.html>.
293293

294294
# Project details
295295

296-
- tmux support: 1.8+
296+
- tmux support: 3.2+
297297
- python support: >= 3.10, pypy, pypy3
298298
- Source: <https://github.com/tmux-python/tmuxp>
299299
- Docs: <https://tmuxp.git-pull.com>

docs/about.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ well tested and adopted.
4141

4242
### Missing
4343

44-
**Version support** tmuxp only supports `tmux >= 1.8`. Teamocil and
44+
**Version support** tmuxp only supports `tmux >= 3.2`. Teamocil and
4545
tmuxinator may have support for earlier versions.
4646

4747
### Differences
@@ -64,7 +64,7 @@ format [^id4]. See {ref}`cli-freeze`.
6464

6565
**JSON config** JSON config support. See {ref}`Examples`.
6666

67-
**ORM-based API** via [libtmux] - Utilizes tmux >= 1.8's unique ID's for
67+
**ORM-based API** via [libtmux] - Utilizes tmux's unique IDs for
6868
panes, windows and sessions to create an object relational view of the tmux
6969
{class}`~libtmux.Server`, its {class}`~libtmux.Session`,
7070
{class}`~libtmux.Window`, and {class}`~libtmux.Pane`.

docs/about_tmux.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ For the freshest results on how to get tmux installed on your system,
222222
"How to install tmux on \<my distro>" will do, as directions change and
223223
are slightly different between distributions.
224224

225-
This documentation is written for version **1.8**. It's important that
226-
you have the latest stable release of tmux. The latest stable version is
227-
viewable on the [tmux homepage](http://tmux.sourceforge.net/).
225+
tmuxp requires tmux **3.2 or newer**. The latest stable version is
226+
viewable on the [tmux homepage](https://github.com/tmux/tmux).
228227

229228
**Mac OS X** users may install the latest stable version of tmux
230229
through [MacPorts](http://www.macports.org/),

docs/configuration/examples.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ tmuxp will set session, window and pane environment variables.
266266

267267
```{note}
268268
269-
Setting environment variables for windows and panes requires tmuxp 1.19 or
270-
newer and tmux 3.0 or newer.
269+
Setting environment variables for windows and panes requires tmuxp 1.19 or newer.
271270
```
272271

273272
````{tab} YAML

docs/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Installation
66

7-
Ensure you have at least tmux **>= 1.8** and python **>= 3.7**.
7+
Ensure you have at least tmux **>= 3.2** and python **>= 3.9**.
88

99
```console
1010
$ pip install --user tmuxp

src/tmuxp/cli/load.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -275,27 +275,6 @@ def load_workspace(
275275
prompt to cleanup (``$ tmux kill-session``) the session on the user's
276276
behalf. An exception raised during this process means it's not easy to
277277
predict how broken the session is.
278-
279-
.. versionchanged:: tmux 2.6+
280-
281-
In tmux 2.6, the way layout and proportion's work when interfacing
282-
with tmux in a detached state (outside of a client) changed. Since
283-
tmuxp builds workspaces in a detached state, the WorkspaceBuilder isn't
284-
able to rely on functionality requiring awarness of session geometry,
285-
e.g. ``set-layout``.
286-
287-
Thankfully, tmux is able to defer commands to run after the user
288-
performs certain actions, such as loading a client via
289-
``attach-session`` or ``switch-client``.
290-
291-
Upon client switch, ``client-session-changed`` is triggered [1]_.
292-
293-
References
294-
----------
295-
.. [1] cmd-switch-client.c hook. GitHub repo for tmux.
296-
297-
https://github.com/tmux/tmux/blob/2.6/cmd-switch-client.c#L132.
298-
Accessed April 8th, 2018.
299278
"""
300279
# get the canonical path, eliminating any symlinks
301280
if isinstance(workspace_file, (str, os.PathLike)):

src/tmuxp/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
from .__about__ import __version__
1212
from .exc import TmuxpPluginException
1313

14-
#: Minimum version of tmux required to run libtmux
15-
TMUX_MIN_VERSION = "1.8"
14+
#: Minimum version of tmux required to run tmuxp
15+
TMUX_MIN_VERSION = "3.2"
1616

1717
#: Most recent version of tmux supported
1818
TMUX_MAX_VERSION = None

src/tmuxp/workspace/builder.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import typing as t
1010

1111
from libtmux._internal.query_list import ObjectDoesNotExist
12-
from libtmux.common import has_gte_version, has_lt_version
1312
from libtmux.pane import Pane
1413
from libtmux.server import Server
1514
from libtmux.session import Session
@@ -253,10 +252,7 @@ def build(self, session: Session | None = None, append: bool = False) -> None:
253252
"start_directory"
254253
]
255254

256-
if (
257-
has_gte_version("2.6")
258-
and os.getenv("TMUXP_DETECT_TERMINAL_SIZE", "1") == "1"
259-
):
255+
if os.getenv("TMUXP_DETECT_TERMINAL_SIZE", "1") == "1":
260256
terminal_size = shutil.get_terminal_size(
261257
fallback=(get_default_columns(), get_default_rows()),
262258
)
@@ -406,25 +402,6 @@ def iter_create_windows(
406402
pass
407403

408404
environment = panes[0].get("environment", window_config.get("environment"))
409-
if environment and has_lt_version("3.0"):
410-
# Falling back to use the environment of the first pane for the window
411-
# creation is nice but yields misleading error messages.
412-
pane_env = panes[0].get("environment")
413-
win_env = window_config.get("environment")
414-
if pane_env and win_env:
415-
target = "panes and windows"
416-
elif pane_env:
417-
target = "panes"
418-
else:
419-
target = "windows"
420-
logger.warning(
421-
(
422-
"Cannot set environment for new %s. "
423-
"You need tmux 3.0 or newer for this."
424-
),
425-
target,
426-
)
427-
environment = None
428405

429406
window = session.new_window(
430407
window_name=window_name,
@@ -513,16 +490,6 @@ def get_pane_shell(
513490
"environment",
514491
window_config.get("environment"),
515492
)
516-
if environment and has_lt_version("3.0"):
517-
# Just issue a warning when the environment comes from the pane
518-
# configuration as a warning for the window was already issued when
519-
# the window was created.
520-
if pane_config.get("environment"):
521-
logger.warning(
522-
"Cannot set environment for new panes. "
523-
"You need tmux 3.0 or newer for this.",
524-
)
525-
environment = None
526493

527494
assert pane is not None
528495

0 commit comments

Comments
 (0)