Skip to content

Commit 84f1b5f

Browse files
committed
fix(split): Passthrough target correctly
1 parent fe27280 commit 84f1b5f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/libtmux/pane.py

+7
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,8 @@ def select_pane(self) -> "Pane":
489489

490490
def split(
491491
self,
492+
/,
493+
target: t.Optional[t.Union[int, str]] = None,
492494
start_directory: t.Optional[str] = None,
493495
attach: bool = False,
494496
direction: t.Optional[PaneDirection] = None,
@@ -615,6 +617,9 @@ def split(
615617
if not attach:
616618
tmux_args += ("-d",)
617619

620+
if target is not None:
621+
tmux_args += (f"-t{target}",)
622+
618623
if environment:
619624
if has_gte_version("3.0"):
620625
for k, v in environment.items():
@@ -805,6 +810,7 @@ def at_right(self) -> bool:
805810
#
806811
def split_window(
807812
self,
813+
target: t.Optional[t.Union[int, str]] = None,
808814
attach: bool = False,
809815
start_directory: t.Optional[str] = None,
810816
vertical: bool = True,
@@ -842,6 +848,7 @@ def split_window(
842848
if size is None and percent is not None:
843849
size = f'{str(percent).rstrip("%")}%'
844850
return self.split(
851+
target=target,
845852
attach=attach,
846853
start_directory=start_directory,
847854
direction=PaneDirection.Below if vertical else PaneDirection.Right,

src/libtmux/window.py

+2
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def select_pane(self, target_pane: t.Union[str, int]) -> t.Optional["Pane"]:
199199

200200
def split(
201201
self,
202+
/,
202203
target: t.Optional[t.Union[int, str]] = None,
203204
start_directory: t.Optional[str] = None,
204205
attach: bool = False,
@@ -238,6 +239,7 @@ def split(
238239
"""
239240
active_pane = self.active_pane or self.panes[0]
240241
return active_pane.split(
242+
target=target,
241243
start_directory=start_directory,
242244
attach=attach,
243245
direction=direction,

0 commit comments

Comments
 (0)