|
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 |
13 | 12 | from libtmux.pane import Pane |
14 | 13 | from libtmux.server import Server |
15 | 14 | from libtmux.session import Session |
@@ -253,10 +252,7 @@ def build(self, session: Session | None = None, append: bool = False) -> None: |
253 | 252 | "start_directory" |
254 | 253 | ] |
255 | 254 |
|
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": |
260 | 256 | terminal_size = shutil.get_terminal_size( |
261 | 257 | fallback=(get_default_columns(), get_default_rows()), |
262 | 258 | ) |
@@ -406,25 +402,6 @@ def iter_create_windows( |
406 | 402 | pass |
407 | 403 |
|
408 | 404 | 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 | 405 |
|
429 | 406 | window = session.new_window( |
430 | 407 | window_name=window_name, |
@@ -513,16 +490,6 @@ def get_pane_shell( |
513 | 490 | "environment", |
514 | 491 | window_config.get("environment"), |
515 | 492 | ) |
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 | 493 |
|
527 | 494 | assert pane is not None |
528 | 495 |
|
|
0 commit comments