File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 10
10
from libtmux import exc
11
11
from libtmux ._internal .query_list import ObjectDoesNotExist
12
12
from libtmux .common import has_gte_version , has_lt_version
13
- from libtmux .constants import ResizeAdjustmentDirection
13
+ from libtmux .constants import NewWindowDirection , ResizeAdjustmentDirection
14
14
from libtmux .pane import Pane
15
15
from libtmux .server import Server
16
16
from libtmux .session import Session
@@ -510,3 +510,29 @@ def test_resize(
510
510
)
511
511
window_height_expanded = int (window .window_height )
512
512
assert window_height_before < window_height_expanded
513
+
514
+
515
+ @pytest .mark .skipif (
516
+ has_gte_version ("3.1" ),
517
+ reason = "Only 3.1 has the -a and -b flag on new-window" ,
518
+ )
519
+ def test_new_window_with_direction_logs_warning_for_old_tmux (
520
+ session : Session ,
521
+ caplog : pytest .LogCaptureFixture ,
522
+ ) -> None :
523
+ """Verify new window with direction create a warning if tmux is too old."""
524
+ window = session .active_window
525
+ window .refresh ()
526
+
527
+ window .new_window (
528
+ window_name = "window_with_direction" ,
529
+ direction = NewWindowDirection .After ,
530
+ )
531
+
532
+ assert any (
533
+ "Window target ignored" in record .msg for record in caplog .records
534
+ ), "Warning missing"
535
+
536
+ assert any (
537
+ "Direction flag ignored" in record .msg for record in caplog .records
538
+ ), "Warning missing"
You can’t perform that action at this time.
0 commit comments