# window_pane_create

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L1043
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-window-c-window_pane_create/

```c
static struct window_pane * window_pane_create(struct window *, u_int, u_int, u_int)
```

## Parameters

- `w` (`struct window *`)
- `sx` (`u_int`)
- `sy` (`u_int`)
- `hlimit` (`u_int`)

## Paths through the source

Arrows name source relationships, not a runtime execution order.

### Create a session and its first pane

[`cmd_new_session_exec`](/en/tmux/latest/reference/c-function-cmd-new-session-c-cmd_new_session_exec/) — calls → [`spawn_window`](/en/tmux/latest/reference/c-function-spawn_window/) — calls → [`spawn_pane`](/en/tmux/latest/reference/c-function-spawn_pane/) — calls → [`window_add_pane`](/en/tmux/latest/reference/c-function-window_add_pane/) — calls → [`window_pane_create`](/en/tmux/latest/reference/c-function-window-c-window_pane_create/)

### Split a window

[`cmd_split_window_exec`](/en/tmux/latest/reference/c-function-cmd-split-window-c-cmd_split_window_exec/) — references → [`spawn_pane`](/en/tmux/latest/reference/c-function-spawn_pane/) — calls → [`window_add_pane`](/en/tmux/latest/reference/c-function-window_add_pane/) — calls → [`window_pane_create`](/en/tmux/latest/reference/c-function-window-c-window_pane_create/)

## Called by

- [`window_add_pane`](/en/tmux/latest/reference/c-function-window_add_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L806)

## Calls

- [`colour_palette_from_option`](/en/tmux/latest/reference/c-function-colour_palette_from_option/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L1074)
- [`colour_palette_init`](/en/tmux/latest/reference/c-function-colour_palette_init/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L1073)
- [`options_create`](/en/tmux/latest/reference/c-function-options_create/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L1050)
- [`screen_init`](/en/tmux/latest/reference/c-function-screen_init/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L1076)
- [`screen_set_title`](/en/tmux/latest/reference/c-function-screen_set_title/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L1084)
- [`style_ranges_init`](/en/tmux/latest/reference/c-function-style_ranges_init/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L1081)
- [`style_set_scrollbar_style_from_option`](/en/tmux/latest/reference/c-function-style_set_scrollbar_style_from_option/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L1070)
- [`window_pane_default_cursor`](/en/tmux/latest/reference/c-function-window_pane_default_cursor/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L1078)
- [`xcalloc`](/en/tmux/latest/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window.c#L1048)

## Referenced declarations

- [`all_window_panes`](/en/tmux/latest/reference/c-variable-all_window_panes/) (attribute)
- [`window_pane.base`](/en/tmux/latest/reference/c-struct-window_pane-base/) (attribute)
- [`window_pane.border_status_line`](/en/tmux/latest/reference/c-struct-window_pane-border_status_line/) (attribute)
- [`window_pane.control_bg`](/en/tmux/latest/reference/c-struct-window_pane-control_bg/) (attribute)
- [`window_pane.control_fg`](/en/tmux/latest/reference/c-struct-window_pane-control_fg/) (attribute)
- [`window_pane.fd`](/en/tmux/latest/reference/c-struct-window_pane-fd/) (attribute)
- [`window_pane.flags`](/en/tmux/latest/reference/c-struct-window_pane-flags/) (attribute)
- [`HOST_NAME_MAX`](/en/tmux/latest/reference/c-define-compat-h-host_name_max/) (constant)
- [`window_pane.id`](/en/tmux/latest/reference/c-struct-window_pane-id/) (attribute)
- [`window_pane.modes`](/en/tmux/latest/reference/c-struct-window_pane-modes/) (attribute)
- [`next_window_pane_id`](/en/tmux/latest/reference/c-variable-window-c-next_window_pane_id/) (attribute)
- [`window_pane.options`](/en/tmux/latest/reference/c-struct-window_pane-options/) (attribute)
- [`window.options`](/en/tmux/latest/reference/c-struct-window-options/) (attribute)
- [`window_pane.palette`](/en/tmux/latest/reference/c-struct-window_pane-palette/) (attribute)
- [`PANE_STYLECHANGED`](/en/tmux/latest/reference/c-define-tmux-h-pane_stylechanged/) (constant)
- [`window_pane.pipe_fd`](/en/tmux/latest/reference/c-struct-window_pane-pipe_fd/) (attribute)
- [`style_line_entry.ranges`](/en/tmux/latest/reference/c-struct-style_line_entry-ranges/) (attribute)
- [`window_pane.resize_queue`](/en/tmux/latest/reference/c-struct-window_pane-resize_queue/) (attribute)
- [`window_pane.screen`](/en/tmux/latest/reference/c-struct-window_pane-screen/) (attribute)
- [`window_pane.scrollbar_style`](/en/tmux/latest/reference/c-struct-window_pane-scrollbar_style/) (attribute)
- [`window_pane.status_screen`](/en/tmux/latest/reference/c-struct-window_pane-status_screen/) (attribute)
- [`window_pane.sx`](/en/tmux/latest/reference/c-struct-window_pane-sx/) (attribute)
- [`window_pane.sy`](/en/tmux/latest/reference/c-struct-window_pane-sy/) (attribute)
- [`window`](/en/tmux/latest/reference/c-struct-window/) (struct)
- [`window_pane.window`](/en/tmux/latest/reference/c-struct-window_pane-window/) (attribute)
- [`window_pane`](/en/tmux/latest/reference/c-struct-window_pane/) (struct)
