@@ -149,6 +149,7 @@ def cmd(self, cmd: str, *args: t.Any) -> tmux_cmd:
149149
150150 def resize (
151151 self ,
152+ / ,
152153 # Adjustments
153154 adjustment_direction : t .Optional [ResizeAdjustmentDirection ] = None ,
154155 adjustment : t .Optional [int ] = None ,
@@ -489,6 +490,8 @@ def select_pane(self) -> "Pane":
489490
490491 def split (
491492 self ,
493+ / ,
494+ target : t .Optional [t .Union [int , str ]] = None ,
492495 start_directory : t .Optional [str ] = None ,
493496 attach : bool = False ,
494497 direction : t .Optional [PaneDirection ] = None ,
@@ -502,6 +505,8 @@ def split(
502505
503506 Parameters
504507 ----------
508+ target : optional
509+ Optional, custom *target-pane*, used by :meth:`Window.split`.
505510 attach : bool, optional
506511 make new window the current window after creating it, default
507512 True.
@@ -615,6 +620,9 @@ def split(
615620 if not attach :
616621 tmux_args += ("-d" ,)
617622
623+ if target is not None :
624+ tmux_args += (f"-t{ target } " ,)
625+
618626 if environment :
619627 if has_gte_version ("3.0" ):
620628 for k , v in environment .items ():
@@ -805,6 +813,7 @@ def at_right(self) -> bool:
805813 #
806814 def split_window (
807815 self ,
816+ target : t .Optional [t .Union [int , str ]] = None ,
808817 attach : bool = False ,
809818 start_directory : t .Optional [str ] = None ,
810819 vertical : bool = True ,
@@ -842,6 +851,7 @@ def split_window(
842851 if size is None and percent is not None :
843852 size = f'{ str (percent ).rstrip ("%" )} %'
844853 return self .split (
854+ target = target ,
845855 attach = attach ,
846856 start_directory = start_directory ,
847857 direction = PaneDirection .Below if vertical else PaneDirection .Right ,
0 commit comments