# cmd_split_window_exec

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

tmux command: [`new-pane`](/en/tmux/latest/manual/new-pane/)

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

```c
static enum cmd_retval cmd_split_window_exec(struct cmd *, struct cmdq_item *)
```

## Parameters

- `self` (`struct cmd *`)
- `item` (`struct cmdq_item *`)

## Paths through the source

Arrows name source relationships, not a runtime execution order.

### 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/)

## Calls

- [`args_count`](/en/tmux/latest/reference/c-function-args_count/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L90)
- [`args_first_value`](/en/tmux/latest/reference/c-function-args_first_value/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L137)
- [`args_get`](/en/tmux/latest/reference/c-function-args_get/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L144)
- [`args_has`](/en/tmux/latest/reference/c-function-args_has/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L98)
- [`args_next_value`](/en/tmux/latest/reference/c-function-args_next_value/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L140)
- [`args_to_vector`](/en/tmux/latest/reference/c-function-args_to_vector/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L134)
- [`cmd_find_from_winlink_pane`](/en/tmux/latest/reference/c-function-cmd_find_from_winlink_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L218)
- [`cmd_free_argv`](/en/tmux/latest/reference/c-function-cmd_free_argv/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L156)
- [`cmd_get_args`](/en/tmux/latest/reference/c-function-cmd_get_args/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L75)
- [`cmd_get_entry`](/en/tmux/latest/reference/c-function-cmd_get_entry/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L92)
- [`cmdq_error`](/en/tmux/latest/reference/c-function-cmdq_error/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L111)
- [`cmdq_get_current`](/en/tmux/latest/reference/c-function-cmdq_get_current/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L76)
- [`cmdq_get_target`](/en/tmux/latest/reference/c-function-cmdq_get_target/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L77)
- [`cmdq_get_target_client`](/en/tmux/latest/reference/c-function-cmdq_get_target_client/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L79)
- [`cmdq_insert_hook`](/en/tmux/latest/reference/c-function-cmdq_insert_hook/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L235)
- [`cmdq_print`](/en/tmux/latest/reference/c-function-cmdq_print/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L230)
- [`environ_create`](/en/tmux/latest/reference/c-function-environ_create/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L135)
- [`environ_free`](/en/tmux/latest/reference/c-function-environ_free/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L157)
- [`environ_put`](/en/tmux/latest/reference/c-function-environ_put/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L139)
- [`format_single`](/en/tmux/latest/reference/c-function-format_single/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L229)
- [`layout_close_pane`](/en/tmux/latest/reference/c-function-layout_close_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L204)
- [`layout_get_floating_cell`](/en/tmux/latest/reference/c-function-layout_get_floating_cell/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L118)
- [`layout_get_tiled_cell`](/en/tmux/latest/reference/c-function-layout_get_tiled_cell/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L120)
- [`options_set_number`](/en/tmux/latest/reference/c-function-options_set_number/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L191)
- [`options_set_string`](/en/tmux/latest/reference/c-function-options_set_string/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L163)
- [`server_client_remove_pane`](/en/tmux/latest/reference/c-function-server_client_remove_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L202)
- [`server_redraw_session`](/en/tmux/latest/reference/c-function-server_redraw_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L224)
- [`server_redraw_window`](/en/tmux/latest/reference/c-function-server_redraw_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L222)
- [`window_pane_start_input`](/en/tmux/latest/reference/c-function-window_pane_start_input/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L200)
- [`window_pop_zoom`](/en/tmux/latest/reference/c-function-window_pop_zoom/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L221)
- [`window_remove_pane`](/en/tmux/latest/reference/c-function-window_remove_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-split-window.c#L205)

## Other function references

- [`args_string`](/en/tmux/latest/reference/c-function-args_string/) (function)
- [`spawn_pane`](/en/tmux/latest/reference/c-function-spawn_pane/) (function)

## Referenced by

- [`cmd_new_pane_entry`](/en/tmux/latest/reference/c-variable-cmd_new_pane_entry/) (attribute)
- [`cmd_split_window_entry`](/en/tmux/latest/reference/c-variable-cmd_split_window_entry/) (attribute)

## Referenced declarations

- [`spawn_context.argc`](/en/tmux/latest/reference/c-struct-spawn_context-argc/) (attribute)
- [`spawn_context.argv`](/en/tmux/latest/reference/c-struct-spawn_context-argv/) (attribute)
- [`cmd`](/en/tmux/latest/reference/c-struct-cmd/) (struct)
- [`cmd_new_pane_entry`](/en/tmux/latest/reference/c-variable-cmd_new_pane_entry/) (attribute)
- [`CMD_RETURN_ERROR`](/en/tmux/latest/reference/c-enum-cmd_retval-cmd_return_error/) (constant)
- [`CMD_RETURN_NORMAL`](/en/tmux/latest/reference/c-enum-cmd_retval-cmd_return_normal/) (constant)
- [`CMD_RETURN_WAIT`](/en/tmux/latest/reference/c-enum-cmd_retval-cmd_return_wait/) (constant)
- [`cmd_retval`](/en/tmux/latest/reference/c-enum-cmd_retval/) (enum)
- [`cmdq_item`](/en/tmux/latest/reference/c-struct-cmdq_item/) (struct)
- [`cmd_find_state.current`](/en/tmux/latest/reference/c-struct-cmd_find_state-current/) (attribute)
- [`spawn_context.cwd`](/en/tmux/latest/reference/c-struct-spawn_context-cwd/) (attribute)
- [`spawn_context.environ`](/en/tmux/latest/reference/c-struct-spawn_context-environ/) (attribute)
- [`cmd_find_state.flags`](/en/tmux/latest/reference/c-struct-cmd_find_state-flags/) (attribute)
- [`spawn_context.flags`](/en/tmux/latest/reference/c-struct-spawn_context-flags/) (attribute)
- [`spawn_context.idx`](/en/tmux/latest/reference/c-struct-spawn_context-idx/) (attribute)
- [`spawn_context.item`](/en/tmux/latest/reference/c-struct-spawn_context-item/) (attribute)
- [`spawn_context.lc`](/en/tmux/latest/reference/c-struct-spawn_context-lc/) (attribute)
- [`PANE_REDRAW`](/en/tmux/latest/reference/c-define-tmux-h-pane_redraw/) (constant)
- [`PANE_STYLECHANGED`](/en/tmux/latest/reference/c-define-tmux-h-pane_stylechanged/) (constant)
- [`PANE_THEMECHANGED`](/en/tmux/latest/reference/c-define-tmux-h-pane_themechanged/) (constant)
- [`cmd_find_state.s`](/en/tmux/latest/reference/c-struct-cmd_find_state-s/) (attribute)
- [`spawn_context.s`](/en/tmux/latest/reference/c-struct-spawn_context-s/) (attribute)
- [`SPAWN_BEFORE`](/en/tmux/latest/reference/c-define-tmux-h-spawn_before/) (constant)
- [`SPAWN_DETACHED`](/en/tmux/latest/reference/c-define-tmux-h-spawn_detached/) (constant)
- [`SPAWN_EMPTY`](/en/tmux/latest/reference/c-define-tmux-h-spawn_empty/) (constant)
- [`SPAWN_FLOATING`](/en/tmux/latest/reference/c-define-tmux-h-spawn_floating/) (constant)
- [`SPAWN_FULLSIZE`](/en/tmux/latest/reference/c-define-tmux-h-spawn_fullsize/) (constant)
- [`SPAWN_ZOOM`](/en/tmux/latest/reference/c-define-tmux-h-spawn_zoom/) (constant)
- [`SPLIT_WINDOW_TEMPLATE`](/en/tmux/latest/reference/c-define-cmd-split-window-c-split_window_template/) (constant)
- [`cmd_find_state.w`](/en/tmux/latest/reference/c-struct-cmd_find_state-w/) (attribute)
- [`window_pane.window`](/en/tmux/latest/reference/c-struct-window_pane-window/) (attribute)
- [`winlink.window`](/en/tmux/latest/reference/c-struct-winlink-window/) (attribute)
- [`cmd_find_state.wl`](/en/tmux/latest/reference/c-struct-cmd_find_state-wl/) (attribute)
- [`spawn_context.wl`](/en/tmux/latest/reference/c-struct-spawn_context-wl/) (attribute)
- [`cmd_find_state.wp`](/en/tmux/latest/reference/c-struct-cmd_find_state-wp/) (attribute)
- [`spawn_context.wp0`](/en/tmux/latest/reference/c-struct-spawn_context-wp0/) (attribute)
