@@ -496,8 +496,6 @@ def split(
496
496
shell : t .Optional [str ] = None ,
497
497
size : t .Optional [t .Union [str , int ]] = None ,
498
498
environment : t .Optional [t .Dict [str , str ]] = None ,
499
- percent : t .Optional [int ] = None , # deprecated
500
- vertical : t .Optional [bool ] = None , # deprecated
501
499
) -> "Pane" :
502
500
"""Split window and return :class:`Pane`, by default beneath current pane.
503
501
@@ -521,60 +519,15 @@ def split(
521
519
window upon completion is desired.
522
520
size: int, optional
523
521
Cell/row or percentage to occupy with respect to current window.
524
- percent: int, optional
525
- Deprecated in favor of size. Percentage to occupy with respect to current
526
- window.
527
522
environment: dict, optional
528
523
Environmental variables for new pane. tmux 3.0+ only. Passthrough to ``-e``.
529
- vertical : bool, optional
530
- split vertically, deprecated by ``direction``.
531
-
532
- Notes
533
- -----
534
- :term:`tmux(1)` will move window to the new pane if the
535
- ``split-window`` target is off screen. tmux handles the ``-d`` the
536
- same way as ``new-window`` and ``attach`` in
537
- :class:`Session.new_window`.
538
-
539
- By default, this will make the window the pane is created in
540
- active. To remain on the same window and split the pane in another
541
- target window, pass in ``attach=False``.
542
-
543
- .. deprecated:: 0.33.0
544
-
545
- ``vertical=True`` deprecated in favor of
546
- ``direction=PaneDirection.Below``.
547
-
548
- .. versionchanged:: 0.28.0
549
-
550
- ``attach`` default changed from ``True`` to ``False``.
551
-
552
- .. deprecated:: 0.28.0
553
-
554
- ``percent=25`` deprecated in favor of ``size="25%"``.
555
524
"""
556
525
tmux_formats = ["#{pane_id}" + FORMAT_SEPARATOR ]
557
526
558
527
tmux_args : t .Tuple [str , ...] = ()
559
528
560
529
if direction :
561
530
tmux_args += tuple (PANE_DIRECTION_FLAG_MAP [direction ])
562
- if vertical is not None :
563
- warnings .warn (
564
- "vertical is not required to pass with direction." ,
565
- category = DeprecationWarning ,
566
- stacklevel = 2 ,
567
- )
568
- elif vertical is not None :
569
- warnings .warn (
570
- "vertical is deprecated in favor of direction." ,
571
- category = DeprecationWarning ,
572
- stacklevel = 2 ,
573
- )
574
- if vertical :
575
- tmux_args += ("-v" ,)
576
- else :
577
- tmux_args += ("-h" ,)
578
531
else :
579
532
tmux_args += tuple (PANE_DIRECTION_FLAG_MAP [PaneDirection .Below ])
580
533
@@ -593,16 +546,6 @@ def split(
593
546
if full_window_split :
594
547
tmux_args += ("-f" ,)
595
548
596
- if percent is not None :
597
- # Deprecated in 3.1 in favor of -l
598
- warnings .warn (
599
- f'Deprecated in favor of size="{ str (percent ).rstrip ("%" )} %" '
600
- + ' ("-l" flag) in tmux 3.1+.' ,
601
- category = DeprecationWarning ,
602
- stacklevel = 2 ,
603
- )
604
- tmux_args += (f"-p{ percent } " ,)
605
-
606
549
tmux_args += ("-P" , "-F%s" % "" .join (tmux_formats )) # output
607
550
608
551
if start_directory is not None :
@@ -789,13 +732,14 @@ def split_window(
789
732
category = DeprecationWarning ,
790
733
stacklevel = 2 ,
791
734
)
735
+ if size is None and percent is not None :
736
+ size = f'{ str (percent ).rstrip ("%" )} %'
792
737
return self .split (
793
738
attach = attach ,
794
739
start_directory = start_directory ,
795
- vertical = vertical ,
740
+ direction = PaneDirection . Below if vertical else PaneDirection . Right ,
796
741
shell = shell ,
797
742
size = size ,
798
- percent = percent ,
799
743
environment = environment ,
800
744
)
801
745
0 commit comments