# cmd_new_window_exec

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

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

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

## Parameters

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

## Calls

- [`args_first_value`](/en/tmux/latest/reference/c-function-args_first_value/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L127)
- [`args_get`](/en/tmux/latest/reference/c-function-args_get/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L73)
- [`args_has`](/en/tmux/latest/reference/c-function-args_has/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L84)
- [`args_next_value`](/en/tmux/latest/reference/c-function-args_next_value/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L130)
- [`args_to_vector`](/en/tmux/latest/reference/c-function-args_to_vector/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L124)
- [`check_name`](/en/tmux/latest/reference/c-function-check_name/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L76)
- [`clean_name`](/en/tmux/latest/reference/c-function-clean_name/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L81)
- [`cmd_find_from_winlink`](/en/tmux/latest/reference/c-function-cmd_find_from_winlink/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L148)
- [`cmd_free_argv`](/en/tmux/latest/reference/c-function-cmd_free_argv/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L166)
- [`cmd_get_args`](/en/tmux/latest/reference/c-function-cmd_get_args/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L55)
- [`cmdq_error`](/en/tmux/latest/reference/c-function-cmdq_error/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L77)
- [`cmdq_get_client`](/en/tmux/latest/reference/c-function-cmdq_get_client/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L56)
- [`cmdq_get_current`](/en/tmux/latest/reference/c-function-cmdq_get_current/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L57)
- [`cmdq_get_target`](/en/tmux/latest/reference/c-function-cmdq_get_target/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L58)
- [`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-new-window.c#L60)
- [`cmdq_insert_hook`](/en/tmux/latest/reference/c-function-cmdq_insert_hook/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L163)
- [`cmdq_print`](/en/tmux/latest/reference/c-function-cmdq_print/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L158)
- [`environ_create`](/en/tmux/latest/reference/c-function-environ_create/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L125)
- [`environ_free`](/en/tmux/latest/reference/c-function-environ_free/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L167)
- [`environ_put`](/en/tmux/latest/reference/c-function-environ_put/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L129)
- [`format_single`](/en/tmux/latest/reference/c-function-format_single/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L75)
- [`recalculate_sizes`](/en/tmux/latest/reference/c-function-recalculate_sizes/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L107)
- [`server_redraw_session`](/en/tmux/latest/reference/c-function-server_redraw_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L104)
- [`server_redraw_session_group`](/en/tmux/latest/reference/c-function-server_redraw_session_group/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L149)
- [`server_status_session_group`](/en/tmux/latest/reference/c-function-server_status_session_group/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L151)
- [`session_set_current`](/en/tmux/latest/reference/c-function-session_set_current/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L103)
- [`winlink_shuffle_up`](/en/tmux/latest/reference/c-function-winlink_shuffle_up/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-window.c#L114)

## Other function references

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

## Referenced by

- [`cmd_new_window_entry`](/en/tmux/latest/reference/c-variable-cmd_new_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_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_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)
- [`session.curw`](/en/tmux/latest/reference/c-struct-session-curw/) (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)
- [`spawn_context.flags`](/en/tmux/latest/reference/c-struct-spawn_context-flags/) (attribute)
- [`cmd_find_state.idx`](/en/tmux/latest/reference/c-struct-cmd_find_state-idx/) (attribute)
- [`spawn_context.idx`](/en/tmux/latest/reference/c-struct-spawn_context-idx/) (attribute)
- [`winlink.idx`](/en/tmux/latest/reference/c-struct-winlink-idx/) (attribute)
- [`spawn_context.item`](/en/tmux/latest/reference/c-struct-spawn_context-item/) (attribute)
- [`window.latest`](/en/tmux/latest/reference/c-struct-window-latest/) (attribute)
- [`spawn_context.name`](/en/tmux/latest/reference/c-struct-spawn_context-name/) (attribute)
- [`window.name`](/en/tmux/latest/reference/c-struct-window-name/) (attribute)
- [`NEW_WINDOW_TEMPLATE`](/en/tmux/latest/reference/c-define-cmd-new-window-c-new_window_template/) (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)
- [`client.session`](/en/tmux/latest/reference/c-struct-client-session/) (attribute)
- [`SPAWN_DETACHED`](/en/tmux/latest/reference/c-define-tmux-h-spawn_detached/) (constant)
- [`SPAWN_KILL`](/en/tmux/latest/reference/c-define-tmux-h-spawn_kill/) (constant)
- [`spawn_context.tc`](/en/tmux/latest/reference/c-struct-spawn_context-tc/) (attribute)
- [`winlink.window`](/en/tmux/latest/reference/c-struct-winlink-window/) (attribute)
- [`session.windows`](/en/tmux/latest/reference/c-struct-session-windows/) (attribute)
- [`cmd_find_state.wl`](/en/tmux/latest/reference/c-struct-cmd_find_state-wl/) (attribute)
