Skip to content

Commit 6369987

Browse files
committed
server.py(refactor): Remove pre-3.2 version guards
why: tmux >= 3.2a is now required, these version checks are unnecessary what: - Remove has_gte_version("2.1") check in has_session() - always prepend = for exact match - Remove has_gte_version("3.2") check in new_session() - always pass -e environment flags - Remove has_gte_version import (no longer used)
1 parent 6a40f60 commit 6369987

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/libtmux/server.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
PaneDict,
2929
SessionDict,
3030
WindowDict,
31-
has_gte_version,
3231
session_check_name,
3332
)
3433

@@ -337,7 +336,7 @@ def has_session(self, target_session: str, exact: bool = True) -> bool:
337336
"""
338337
session_check_name(target_session)
339338

340-
if exact and has_gte_version("2.1"):
339+
if exact:
341340
target_session = f"={target_session}"
342341

343342
proc = self.cmd("has-session", target=target_session)
@@ -555,13 +554,8 @@ def new_session(
555554
tmux_args += ("-y", y)
556555

557556
if environment:
558-
if has_gte_version("3.2"):
559-
for k, v in environment.items():
560-
tmux_args += (f"-e{k}={v}",)
561-
else:
562-
logger.warning(
563-
"Environment flag ignored, tmux 3.2 or newer required.",
564-
)
557+
for k, v in environment.items():
558+
tmux_args += (f"-e{k}={v}",)
565559

566560
if window_command:
567561
tmux_args += (window_command,)

0 commit comments

Comments
 (0)