# libtmux:split-pane

- **Package:** libtmux
- **Language:** Common Lisp
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-lisp/blob/c2e5fc4ed3befda21f45dfa5d5868c38fd138311/src/creation.lisp#L45
- **Public owner:** libtmux
- **Page:** https://libtmux.org/en/lisp/latest/reference/libtmux-split-pane/

```
(split-pane client pane &key (direction :vertical) size percent before full-size cwd environment (detached t) (command nil command-p) (shell-command nil shell-command-p) cancel-token timeout output-limit)
```

Split captured PANE and return a COMMAND-OUTCOME with the created pane.
DIRECTION is :HORIZONTAL (left/right) or :VERTICAL (top/bottom). SIZE is a
positive cell count; PERCENT is 1 through 100, mutually exclusive with SIZE.
BEFORE places the pane before its target; FULL-SIZE spans the whole window.
DETACHED defaults true. CWD, ENVIRONMENT, COMMAND and SHELL-COMMAND follow
NEW-WINDOW. Failed acquisition after successful creation is retained separately.
Signals STALE-TARGET or an operational condition; never retries the mutation.

## Parameters

- `client`
- `pane`
- `direction?`
- `size?`
- `percent?`
- `before?`
- `full-size?`
- `cwd?`
- `environment?`
- `detached?`
- `command?`
- `shell-command?`
- `cancel-token?`
- `timeout?`
- `output-limit?`

## tmux command

The tmux commands behind `split-pane`.

- [`split-window`](/en/tmux/latest/manual/split-window/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_split_window_entry`](/en/tmux/latest/reference/c-variable-cmd_split_window_entry/) (attribute)
- [`cmd_split_window_exec`](/en/tmux/latest/reference/c-function-cmd-split-window-c-cmd_split_window_exec/) (function)

Each path starts at a function a command runs, which is degree 1. The degree counts steps from there along the path, and each step is a call or a reference: degree 2 is reached from that function, degree 3 from the next, and so on.

### Split a window

1. [`cmd_split_window_exec`](/en/tmux/latest/reference/c-function-cmd-split-window-c-cmd_split_window_exec/) (function)
2. references → [`spawn_pane`](/en/tmux/latest/reference/c-function-spawn_pane/) (function)
3. calls → [`window_add_pane`](/en/tmux/latest/reference/c-function-window_add_pane/) (function)
4. calls → [`window_pane_create`](/en/tmux/latest/reference/c-function-window-c-window_pane_create/) (function)

## Guides

Pages that discuss `split-pane`.

- [Explicit operations](/en/lisp/latest/guides/operations/)
