# cmd_if_shell_exec

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L62
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-cmd-if-shell-c-cmd_if_shell_exec/

tmux command: [`if-shell`](/en/tmux/3.2a/manual/if-shell/)

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

## Parameters

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

## Calls

- [`args_has`](/en/tmux/3.2a/reference/c-function-args_has/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L76)
- [`cmd_find_copy_state`](/en/tmux/3.2a/reference/c-function-cmd_find_copy_state/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L91)
- [`cmd_get_args`](/en/tmux/3.2a/reference/c-function-cmd_get_args/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L64)
- [`cmd_get_source`](/en/tmux/3.2a/reference/c-function-cmd_get_source/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L88)
- [`cmd_parse_and_insert`](/en/tmux/3.2a/reference/c-function-cmd_parse_and_insert/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L93)
- [`cmdq_error`](/en/tmux/3.2a/reference/c-function-cmdq_error/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L95)
- [`cmdq_get_client`](/en/tmux/3.2a/reference/c-function-cmdq_get_client/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L111)
- [`cmdq_get_state`](/en/tmux/3.2a/reference/c-function-cmdq_get_state/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L66)
- [`cmdq_get_target`](/en/tmux/3.2a/reference/c-function-cmdq_get_target/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L65)
- [`cmdq_get_target_client`](/en/tmux/3.2a/reference/c-function-cmdq_get_target_client/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L70)
- [`format_single_from_target`](/en/tmux/3.2a/reference/c-function-format_single_from_target/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L75)
- [`job_run`](/en/tmux/3.2a/reference/c-function-job_run/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L131)
- [`xcalloc`](/en/tmux/3.2a/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L102)
- [`xstrdup`](/en/tmux/3.2a/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-if-shell.c#L104)

## Other function references

- [`cmd_if_shell_callback`](/en/tmux/3.2a/reference/c-function-cmd-if-shell-c-cmd_if_shell_callback/) (function)
- [`cmd_if_shell_free`](/en/tmux/3.2a/reference/c-function-cmd-if-shell-c-cmd_if_shell_free/) (function)
- [`server_client_get_cwd`](/en/tmux/3.2a/reference/c-function-server_client_get_cwd/) (function)

## Referenced by

- [`cmd_if_shell_entry`](/en/tmux/3.2a/reference/c-variable-cmd_if_shell_entry/) (attribute)

## Referenced declarations

- [`args.argc`](/en/tmux/3.2a/reference/c-struct-args-argc/) (attribute)
- [`args.argv`](/en/tmux/3.2a/reference/c-struct-args-argv/) (attribute)
- [`cmd_parse_input.c`](/en/tmux/3.2a/reference/c-struct-cmd_parse_input-c/) (attribute)
- [`cmd_if_shell_data.client`](/en/tmux/3.2a/reference/c-struct-cmd_if_shell_data-client/) (attribute)
- [`cmd`](/en/tmux/3.2a/reference/c-struct-cmd/) (struct)
- [`cmd_if_shell_data.cmd_else`](/en/tmux/3.2a/reference/c-struct-cmd_if_shell_data-cmd_else/) (attribute)
- [`cmd_if_shell_data.cmd_if`](/en/tmux/3.2a/reference/c-struct-cmd_if_shell_data-cmd_if/) (attribute)
- [`CMD_PARSE_ERROR`](/en/tmux/3.2a/reference/c-enum-cmd_parse_status-cmd_parse_error/) (constant)
- [`CMD_RETURN_ERROR`](/en/tmux/3.2a/reference/c-enum-cmd_retval-cmd_return_error/) (constant)
- [`CMD_RETURN_NORMAL`](/en/tmux/3.2a/reference/c-enum-cmd_retval-cmd_return_normal/) (constant)
- [`CMD_RETURN_WAIT`](/en/tmux/3.2a/reference/c-enum-cmd_retval-cmd_return_wait/) (constant)
- [`cmd_retval`](/en/tmux/3.2a/reference/c-enum-cmd_retval/) (enum)
- [`cmdq_item`](/en/tmux/3.2a/reference/c-struct-cmdq_item/) (struct)
- [`cmd_parse_input.file`](/en/tmux/3.2a/reference/c-struct-cmd_parse_input-file/) (attribute)
- [`cmd_parse_input.fs`](/en/tmux/3.2a/reference/c-struct-cmd_parse_input-fs/) (attribute)
- [`cmd_if_shell_data.input`](/en/tmux/3.2a/reference/c-struct-cmd_if_shell_data-input/) (attribute)
- [`cmd_if_shell_data.item`](/en/tmux/3.2a/reference/c-struct-cmd_if_shell_data-item/) (attribute)
- [`cmd_parse_input.item`](/en/tmux/3.2a/reference/c-struct-cmd_parse_input-item/) (attribute)
- [`cmd_parse_input.line`](/en/tmux/3.2a/reference/c-struct-cmd_parse_input-line/) (attribute)
- [`client.references`](/en/tmux/3.2a/reference/c-struct-client-references/) (attribute)
- [`cmd_find_state.s`](/en/tmux/3.2a/reference/c-struct-cmd_find_state-s/) (attribute)
