@@ -491,6 +491,7 @@ def select_pane(self) -> "Pane":
491
491
def split (
492
492
self ,
493
493
/ ,
494
+ target : t .Optional [t .Union [int , str ]] = None ,
494
495
start_directory : t .Optional [str ] = None ,
495
496
attach : bool = False ,
496
497
direction : t .Optional [PaneDirection ] = None ,
@@ -504,6 +505,8 @@ def split(
504
505
505
506
Parameters
506
507
----------
508
+ target : optional
509
+ Optional, custom *target-pane*, used by :meth:`Window.split`.
507
510
attach : bool, optional
508
511
make new window the current window after creating it, default
509
512
True.
@@ -617,6 +620,9 @@ def split(
617
620
if not attach :
618
621
tmux_args += ("-d" ,)
619
622
623
+ if target is not None :
624
+ tmux_args += (f"-t{ target } " ,)
625
+
620
626
if environment :
621
627
if has_gte_version ("3.0" ):
622
628
for k , v in environment .items ():
@@ -807,6 +813,7 @@ def at_right(self) -> bool:
807
813
#
808
814
def split_window (
809
815
self ,
816
+ target : t .Optional [t .Union [int , str ]] = None ,
810
817
attach : bool = False ,
811
818
start_directory : t .Optional [str ] = None ,
812
819
vertical : bool = True ,
@@ -844,6 +851,7 @@ def split_window(
844
851
if size is None and percent is not None :
845
852
size = f'{ str (percent ).rstrip ("%" )} %'
846
853
return self .split (
854
+ target = target ,
847
855
attach = attach ,
848
856
start_directory = start_directory ,
849
857
direction = PaneDirection .Below if vertical else PaneDirection .Right ,
0 commit comments