Skip to content

Commit 81ea8b2

Browse files
committed
Window(fix[split]): forward percentage parameter to Pane.split
why: Pane.split() gained a percentage parameter for the -p flag but Window.split() which delegates to it neither accepts nor forwards it. what: - Add percentage parameter to Window.split() signature - Forward percentage to active_pane.split() - Fix size docstring to say "Cell/row count" (not "or percentage")
1 parent 07627b8 commit 81ea8b2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/libtmux/window.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ def split(
278278
zoom: bool | None = None,
279279
shell: str | None = None,
280280
size: str | int | None = None,
281+
percentage: int | None = None,
281282
environment: dict[str, str] | None = None,
282283
) -> Pane:
283284
"""Split window on active pane and return the created :class:`Pane`.
@@ -303,7 +304,12 @@ def split(
303304
is useful for long-running processes where the closing of the
304305
window upon completion is desired.
305306
size : int, optional
306-
Cell/row or percentage to occupy with respect to current window.
307+
Cell/row count to occupy with respect to current window.
308+
percentage : int, optional
309+
Percentage (0-100) of the window to occupy (``-p`` flag).
310+
Mutually exclusive with *size*.
311+
312+
.. versionadded:: 0.45
307313
environment : dict, optional
308314
Environmental variables for new pane. Passthrough to ``-e``.
309315
@@ -322,6 +328,7 @@ def split(
322328
zoom=zoom,
323329
shell=shell,
324330
size=size,
331+
percentage=percentage,
325332
environment=environment,
326333
)
327334

0 commit comments

Comments
 (0)