|
9 | 9 | import typing as t |
10 | 10 |
|
11 | 11 | 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 |
13 | 13 | from libtmux.pane import Pane |
14 | 14 | from libtmux.server import Server |
15 | 15 | from libtmux.session import Session |
@@ -406,25 +406,6 @@ def iter_create_windows( |
406 | 406 | pass |
407 | 407 |
|
408 | 408 | 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 |
428 | 409 |
|
429 | 410 | window = session.new_window( |
430 | 411 | window_name=window_name, |
@@ -513,16 +494,6 @@ def get_pane_shell( |
513 | 494 | "environment", |
514 | 495 | window_config.get("environment"), |
515 | 496 | ) |
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 |
526 | 497 |
|
527 | 498 | assert pane is not None |
528 | 499 |
|
|
0 commit comments