# libtmux.Window.split_window

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/window.py#L1709
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-window-split_window/

```
libtmux.Window.split_window(
    self,
    target: int | str | None = None,
    start_directory: StrPath | None = None,
    attach: bool = False,
    vertical: bool = True,
    shell: str | None = None,
    size: str | int | None = None,
    percent: int | None = None,
    # deprecated,
    environment: dict[str, str] | None = None,
) -> Pane
```

Split window and return the created :class:`Pane`.

## Deprecated

0.33.0 — Deprecated in favor of :meth:`.split()`.

0.28.0 — ``percent=25`` deprecated in favor of ``size="25%"``.

## Changed

0.28.0 — ``attach`` default changed from ``True`` to ``False``.

## Parameters

- `target` (`int | str | None`)
- `start_directory` (`StrPath | None`)
- `attach` (`bool`)
- `vertical` (`bool`)
- `shell` (`str | None`)
- `size` (`str | int | None`)
- `percent` (`int | None`)
- `# deprecated`
- `environment` (`dict[str, str] | None`)
