@@ -491,6 +491,7 @@ def select_pane(self) -> "Pane":
491491 def split (
492492 self ,
493493 / ,
494+ target : t .Optional [t .Union [int , str ]] = None ,
494495 start_directory : t .Optional [str ] = None ,
495496 attach : bool = False ,
496497 direction : t .Optional [PaneDirection ] = None ,
@@ -504,6 +505,8 @@ def split(
504505
505506 Parameters
506507 ----------
508+ target : optional
509+ Optional, custom *target-pane*, used by :meth:`Window.split`.
507510 attach : bool, optional
508511 make new window the current window after creating it, default
509512 True.
@@ -617,6 +620,9 @@ def split(
617620 if not attach :
618621 tmux_args += ("-d" ,)
619622
623+ if target is not None :
624+ tmux_args += (f"-t{ target } " ,)
625+
620626 if environment :
621627 if has_gte_version ("3.0" ):
622628 for k , v in environment .items ():
@@ -807,6 +813,7 @@ def at_right(self) -> bool:
807813 #
808814 def split_window (
809815 self ,
816+ target : t .Optional [t .Union [int , str ]] = None ,
810817 attach : bool = False ,
811818 start_directory : t .Optional [str ] = None ,
812819 vertical : bool = True ,
@@ -844,6 +851,7 @@ def split_window(
844851 if size is None and percent is not None :
845852 size = f'{ str (percent ).rstrip ("%" )} %'
846853 return self .split (
854+ target = target ,
847855 attach = attach ,
848856 start_directory = start_directory ,
849857 direction = PaneDirection .Below if vertical else PaneDirection .Right ,
0 commit comments