# tmux new-pane

Source: https://libtmux.org/en/tmux/latest/manual/new-pane/

> Create a new pane.

Create a new pane.

## Syntax

```tmux-usage
tmux new-pane [-bdefhIklPvZ] [-c start-directory] [-e environment] [-F format] [-l size] [-m message] [-p percentage] [-s style] [-S active-border-style] [-R inactive-border-style] [-x width] [-y height] [-X x-position] [-Y y-position] [-t target-pane] [shell-command [argument ...]]
```

Alias: `newp`.

## Behavior

Create a new pane. The new pane is created by splitting `target-pane`. If `-d` is given, the session does not make the new pane the current pane. `-Z` zooms if the window is not zoomed, or keeps it zoomed if already zoomed. `-s` sets the style for the pane content. `-S` sets the border style when the pane is active and `-R` sets the border style when the pane is inactive (see [STYLES](https://libtmux.org/en/tmux/latest/manual/full/#STYLES)).

`-h` does a horizontal split and `-v` a vertical split; if neither is specified, `-v` is assumed. The `-l` option specifies the size of the new pane in lines (for vertical split) or in columns (for horizontal split); `size` may be followed by ‘`%`’ to specify a percentage of the available space. `-p` is a shorthand option for this. The `-b` option causes the new pane to be created to the left of or above `target-pane`. The `-f` option creates a new pane spanning the full window height (with `-h`) or full window width (with `-v`), instead of splitting the active pane.

`-k` keeps the pane open after the optional `shell-command` exits and waits for a key to be pressed before closing it. The message shown is controlled by the `remain-on-exit-format` option. `-m` `message` is equivalent to `-k` but also sets the `remain-on-exit-format` option for this pane to `message`.

`-E`, or an empty `shell-command`, ('') will create an empty pane with no command running in it; [`display-message`](https://libtmux.org/en/tmux/latest/manual/display-message/) `-I` can write to an empty pane. The `-I` flag will create an empty pane and forward any output from stdin to it. For example:

```console
$ make 2>&1|tmux splitw -dI &
```

All other options have the same meaning as for the [`new-window`](https://libtmux.org/en/tmux/latest/manual/new-window/) command.

## C implementation

Internal declarations in tmux 3.7c:

* [`cmd_new_pane_entry`](https://libtmux.org/en/tmux/latest/reference/c-variable-cmd_new_pane_entry/)
* [`cmd_split_window_exec`](https://libtmux.org/en/tmux/latest/reference/c-function-cmd-split-window-c-cmd_split_window_exec/)

tmux sources and license

Syntax comes from `tmux 3.7c list-commands`. See the [global options](https://libtmux.org/en/tmux/latest/manual/full/#DESCRIPTION) for sockets and configuration, and [command syntax and targets](https://libtmux.org/en/tmux/latest/manual/full/#COMMANDS).

Behavior is taken from the [tmux 3.7c manual](https://github.com/tmux/tmux/blob/79072dd1a9f5fb437a5859e362a496fd57ec0981/tmux.1).

[Command declaration](https://github.com/tmux/tmux/blob/79072dd1a9f5fb437a5859e362a496fd57ec0981/cmd-split-window.c#L38)

```
Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
```
