Skip to content

Commit 5305b4a

Browse files
committed
Window(feat[split,split_window]): Add StrPath type support for start_directory
why: Standardize path handling to accept both str and PathLike objects what: - Import StrPath from libtmux._internal.types - Update start_directory parameter type annotations to StrPath | None - Update docstring to reflect str or PathLike support
1 parent 66ccd3f commit 5305b4a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/libtmux/window.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import warnings
1515

1616
from libtmux._internal.query_list import QueryList
17+
from libtmux._internal.types import StrPath
1718
from libtmux.common import has_gte_version, tmux_cmd
1819
from libtmux.constants import (
1920
RESIZE_ADJUSTMENT_DIRECTION_FLAG_MAP,
@@ -258,7 +259,7 @@ def split(
258259
self,
259260
/,
260261
target: int | str | None = None,
261-
start_directory: str | None = None,
262+
start_directory: StrPath | None = None,
262263
attach: bool = False,
263264
direction: PaneDirection | None = None,
264265
full_window_split: bool | None = None,
@@ -274,7 +275,7 @@ def split(
274275
attach : bool, optional
275276
make new window the current window after creating it, default
276277
True.
277-
start_directory : str, optional
278+
start_directory : str or PathLike, optional
278279
specifies the working directory in which the new window is created.
279280
direction : PaneDirection, optional
280281
split in direction. If none is specified, assume down.
@@ -864,7 +865,7 @@ def width(self) -> str | None:
864865
def split_window(
865866
self,
866867
target: int | str | None = None,
867-
start_directory: str | None = None,
868+
start_directory: StrPath | None = None,
868869
attach: bool = False,
869870
vertical: bool = True,
870871
shell: str | None = None,

0 commit comments

Comments
 (0)