Skip to content

Commit 1704f5d

Browse files
committed
docs(refactor): Remove outdated tmux version references (#608)
why: Clean up docstrings/comments referencing old tmux versions now that 3.2a is minimum what: - common.py: Update error message, simplify handle_option_error docstring - server.py: Remove "tmux 2.1 and up only" from exact param, remove 1.9-dev comment - session.py: Remove "(tmux 3.2+)" from direction param, remove 1.9-dev comment - window.py: Remove "tmux 3.0+ only" from environment param, update deprecation msg - pane.py: Remove "tmux 3.0+ only" from environment params, remove 1.9-dev comment - neo.py: Remove QUIRK_TMUX_3_1_X_0001 documentation (no longer applicable) - Update test assertions for new error message
1 parent 0147bce commit 1704f5d

File tree

8 files changed

+9
-31
lines changed

8 files changed

+9
-31
lines changed

src/libtmux/common.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def get_version() -> LooseVersion:
288288
return LooseVersion(f"{TMUX_MAX_VERSION}-openbsd")
289289
msg = (
290290
f"libtmux supports tmux {TMUX_MIN_VERSION} and greater. This system"
291-
" is running tmux 1.3 or earlier."
291+
" does not meet the minimum tmux version requirement."
292292
)
293293
raise exc.LibTmuxException(
294294
msg,
@@ -456,17 +456,12 @@ def session_check_name(session_name: str | None) -> None:
456456
def handle_option_error(error: str) -> type[exc.OptionError]:
457457
"""Raise exception if error in option command found.
458458
459-
In tmux 3.0, show-option and show-window-option return invalid option instead of
460-
unknown option. See https://github.com/tmux/tmux/blob/3.0/cmd-show-options.c.
461-
462-
In tmux >2.4, there are 3 different types of option errors:
459+
There are 3 different types of option errors:
463460
464461
- unknown option
465462
- invalid option
466463
- ambiguous option
467464
468-
In tmux <2.4, unknown option was the only option.
469-
470465
All errors raised will have the base error of :exc:`exc.OptionError`. So to
471466
catch any option error, use ``except exc.OptionError``.
472467

src/libtmux/neo.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@
2424
OutputsRaw = list[OutputRaw]
2525

2626

27-
"""
28-
Quirks:
29-
30-
QUIRK_TMUX_3_1_X_0001:
31-
32-
- tmux 3.1 and 3.1a:
33-
- server crash with list-panes w/ buffer_created, client_activity, client_created
34-
"""
35-
36-
3727
@dataclasses.dataclass()
3828
class Obj:
3929
"""Dataclass of generic tmux object."""
@@ -43,14 +33,11 @@ class Obj:
4333
active_window_index: str | None = None
4434
alternate_saved_x: str | None = None
4535
alternate_saved_y: str | None = None
46-
# See QUIRK_TMUX_3_1_X_0001
4736
buffer_name: str | None = None
4837
buffer_sample: str | None = None
4938
buffer_size: str | None = None
50-
# See QUIRK_TMUX_3_1_X_0001
5139
client_cell_height: str | None = None
5240
client_cell_width: str | None = None
53-
# See QUIRK_TMUX_3_1_X_0001
5441
client_discarded: str | None = None
5542
client_flags: str | None = None
5643
client_height: str | None = None

src/libtmux/pane.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ def split(
586586
size: int, optional
587587
Cell/row or percentage to occupy with respect to current window.
588588
environment: dict, optional
589-
Environmental variables for new pane. tmux 3.0+ only. Passthrough to ``-e``.
589+
Environmental variables for new pane. Passthrough to ``-e``.
590590
591591
Examples
592592
--------
@@ -662,7 +662,6 @@ def split(
662662
tmux_args += ("-P", "-F{}".format("".join(tmux_formats))) # output
663663

664664
if start_directory:
665-
# as of 2014-02-08 tmux 1.9-dev doesn't expand ~ in new-window -c.
666665
start_path = pathlib.Path(start_directory).expanduser()
667666
tmux_args += (f"-c{start_path}",)
668667

@@ -880,7 +879,7 @@ def split_window(
880879
percent: int, optional
881880
percentage to occupy with respect to current pane
882881
environment: dict, optional
883-
Environmental variables for new pane. tmux 3.0+ only. Passthrough to ``-e``.
882+
Environmental variables for new pane. Passthrough to ``-e``.
884883
885884
Notes
886885
-----

src/libtmux/server.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ def has_session(self, target_session: str, exact: bool = True) -> bool:
324324
exact : bool
325325
match the session name exactly. tmux uses fnmatch by default.
326326
Internally prepends ``=`` to the session in ``$ tmux has-session``.
327-
tmux 2.1 and up only.
328327
329328
Raises
330329
------
@@ -540,7 +539,6 @@ def new_session(
540539
tmux_args += ("-d",)
541540

542541
if start_directory:
543-
# as of 2014-02-08 tmux 1.9-dev doesn't expand ~ in new-session -c.
544542
start_directory = pathlib.Path(start_directory).expanduser()
545543
tmux_args += ("-c", str(start_directory))
546544

src/libtmux/session.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ def new_window(
610610
window upon completion is desired.
611611
612612
direction : WindowDirection, optional
613-
Insert window before or after target window (tmux 3.2+).
613+
Insert window before or after target window.
614614
615615
target_window : str, optional
616616
Used by :meth:`Window.new_window` to specify the target window.
@@ -664,7 +664,6 @@ def new_window(
664664

665665
# Catch empty string and default (`None`)
666666
if start_directory:
667-
# as of 2014-02-08 tmux 1.9-dev doesn't expand ~ in new-window -c.
668667
start_directory = pathlib.Path(start_directory).expanduser()
669668
window_args += (f"-c{start_directory}",)
670669

src/libtmux/window.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def split(
294294
size: int, optional
295295
Cell/row or percentage to occupy with respect to current window.
296296
environment: dict, optional
297-
Environmental variables for new pane. tmux 3.0+ only. Passthrough to ``-e``.
297+
Environmental variables for new pane. Passthrough to ``-e``.
298298
"""
299299
active_pane = self.active_pane or self.panes[0]
300300
return active_pane.split(
@@ -891,7 +891,7 @@ def split_window(
891891
# Deprecated in 3.1 in favor of -l
892892
warnings.warn(
893893
f'Deprecated in favor of size="{str(percent).rstrip("%")}%" '
894-
' ("-l" flag) in tmux 3.1+.',
894+
'(using the "-l" flag).',
895895
category=DeprecationWarning,
896896
stacklevel=2,
897897
)

tests/legacy_api/test_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def mock_tmux_cmd(*args: t.Any, **kwargs: t.Any) -> Hi:
102102
monkeypatch.setattr(libtmux.common, "tmux_cmd", mock_tmux_cmd)
103103
with pytest.raises(LibTmuxException) as exc_info:
104104
get_version()
105-
exc_info.match("is running tmux 1.3 or earlier")
105+
exc_info.match("does not meet the minimum tmux version requirement")
106106

107107

108108
def test_ignores_letter_versions(monkeypatch: pytest.MonkeyPatch) -> None:

tests/test_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ class VersionParsingFixture(t.NamedTuple):
321321
mock_platform=None,
322322
expected_version=None,
323323
raises=True,
324-
exc_msg_regex="is running tmux 1.3 or earlier",
324+
exc_msg_regex="does not meet the minimum tmux version requirement",
325325
),
326326
]
327327

0 commit comments

Comments
 (0)