Skip to content

Commit 962c1ed

Browse files
committed
fix(split): Passthrough target correctly
1 parent f46c423 commit 962c1ed

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/libtmux/pane.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ def select_pane(self) -> "Pane":
490490
def split(
491491
self,
492492
/,
493+
target: t.Optional[t.Union[int, str]] = None,
493494
start_directory: t.Optional[str] = None,
494495
attach: bool = False,
495496
direction: t.Optional[PaneDirection] = None,
@@ -616,6 +617,9 @@ def split(
616617
if not attach:
617618
tmux_args += ("-d",)
618619

620+
if target is not None:
621+
tmux_args += (f"-t{target}",)
622+
619623
if environment:
620624
if has_gte_version("3.0"):
621625
for k, v in environment.items():
@@ -806,6 +810,7 @@ def at_right(self) -> bool:
806810
#
807811
def split_window(
808812
self,
813+
target: t.Optional[t.Union[int, str]] = None,
809814
attach: bool = False,
810815
start_directory: t.Optional[str] = None,
811816
vertical: bool = True,
@@ -843,6 +848,7 @@ def split_window(
843848
if size is None and percent is not None:
844849
size = f'{str(percent).rstrip("%")}%'
845850
return self.split(
851+
target=target,
846852
attach=attach,
847853
start_directory=start_directory,
848854
direction=PaneDirection.Below if vertical else PaneDirection.Right,

src/libtmux/window.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ def split(
239239
"""
240240
active_pane = self.active_pane or self.panes[0]
241241
return active_pane.split(
242+
target=target,
242243
start_directory=start_directory,
243244
attach=attach,
244245
direction=direction,

0 commit comments

Comments
 (0)