Skip to content

Commit 417e96c

Browse files
committed
builder! Remove tmux < 3.0 environment variable warning
Remove dead code that warned users about environment variable support requiring tmux 3.0+. Since tmux 3.2+ is now the minimum version, environment variables are always supported. - Remove warning blocks for windows and panes - Remove unused has_lt_version import
1 parent 1e1765b commit 417e96c

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

src/tmuxp/workspace/builder.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
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
12+
from libtmux.common import has_gte_version
1313
from libtmux.pane import Pane
1414
from libtmux.server import Server
1515
from libtmux.session import Session
@@ -406,25 +406,6 @@ def iter_create_windows(
406406
pass
407407

408408
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
428409

429410
window = session.new_window(
430411
window_name=window_name,
@@ -513,16 +494,6 @@ def get_pane_shell(
513494
"environment",
514495
window_config.get("environment"),
515496
)
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
526497

527498
assert pane is not None
528499

0 commit comments

Comments
 (0)