# Server.splitWindow(_:direction:size:startDirectory:)

- **Module:** Server
- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-swift/blob/f02a4668570e1cc5198c941413750e021f42c214/Sources/LibTmux/Creation.swift#L188
- **Page:** https://libtmux.org/reference/swift/server-splitwindow(_-direction-size-startdirectory-)/

```
Server.splitWindow(_:direction:size:startDirectory:)(window: Window, direction: PaneDirection, size: PaneSize?, startDirectory: String?) -> Pane
```

Splits a window's active pane, returning the pane that appeared.

- Parameters:
  - window: the window to split. tmux splits whichever of its panes is
    active; name a pane instead with ``split(_:direction:size:startDirectory:)``.
  - direction: which side of that pane the new one takes. Defaults to
    ``PaneDirection/below``, so that this and `tmux split-window` with
    no flags do the same thing.
  - size: how much of the pane being split to give the new one. Omitted,
    tmux halves it.
  - startDirectory: where the new pane starts. Omitted, tmux uses
    the pane's own.

## Raises

- `TmuxError`
