# cmd_run_shell_exec

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

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

```c
static enum cmd_retval cmd_run_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-run-shell.c#L132)
- [`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-run-shell.c#L129)
- [`cmd_get_args`](/en/tmux/3.2a/reference/c-function-cmd_get_args/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-run-shell.c#L97)
- [`cmd_get_source`](/en/tmux/3.2a/reference/c-function-cmd_get_source/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-run-shell.c#L125)
- [`cmdq_error`](/en/tmux/3.2a/reference/c-function-cmdq_error/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-run-shell.c#L112)
- [`cmdq_get_client`](/en/tmux/3.2a/reference/c-function-cmdq_get_client/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-run-shell.c#L138)
- [`cmdq_get_target`](/en/tmux/3.2a/reference/c-function-cmdq_get_target/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-run-shell.c#L98)
- [`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-run-shell.c#L100)
- [`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-run-shell.c#L120)
- [`session_add_ref`](/en/tmux/3.2a/reference/c-function-session_add_ref/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-run-shell.c#L151)
- [`xcalloc`](/en/tmux/3.2a/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-run-shell.c#L118)
- [`xstrdup`](/en/tmux/3.2a/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-run-shell.c#L147)

## Other function references

- [`args_get`](/en/tmux/3.2a/reference/c-function-args_get/) (function)
- [`cmd_run_shell_timer`](/en/tmux/3.2a/reference/c-function-cmd-run-shell-c-cmd_run_shell_timer/) (function)
- [`server_client_get_cwd`](/en/tmux/3.2a/reference/c-function-server_client_get_cwd/) (function)

## Referenced by

- [`cmd_run_shell_entry`](/en/tmux/3.2a/reference/c-variable-cmd_run_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_run_shell_data.client`](/en/tmux/3.2a/reference/c-struct-cmd_run_shell_data-client/) (attribute)
- [`cmd`](/en/tmux/3.2a/reference/c-struct-cmd/) (struct)
- [`cmd_run_shell_data.cmd`](/en/tmux/3.2a/reference/c-struct-cmd_run_shell_data-cmd/) (attribute)
- [`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_run_shell_data.cwd`](/en/tmux/3.2a/reference/c-struct-cmd_run_shell_data-cwd/) (attribute)
- [`cmd_parse_input.file`](/en/tmux/3.2a/reference/c-struct-cmd_parse_input-file/) (attribute)
- [`cmd_run_shell_data.flags`](/en/tmux/3.2a/reference/c-struct-cmd_run_shell_data-flags/) (attribute)
- [`cmd_parse_input.fs`](/en/tmux/3.2a/reference/c-struct-cmd_parse_input-fs/) (attribute)
- [`window_pane.id`](/en/tmux/3.2a/reference/c-struct-window_pane-id/) (attribute)
- [`cmd_parse_input.item`](/en/tmux/3.2a/reference/c-struct-cmd_parse_input-item/) (attribute)
- [`cmd_run_shell_data.item`](/en/tmux/3.2a/reference/c-struct-cmd_run_shell_data-item/) (attribute)
- [`JOB_NOWAIT`](/en/tmux/3.2a/reference/c-define-tmux-h-job_nowait/) (constant)
- [`cmd_parse_input.line`](/en/tmux/3.2a/reference/c-struct-cmd_parse_input-line/) (attribute)
- [`cmd_run_shell_data.pi`](/en/tmux/3.2a/reference/c-struct-cmd_run_shell_data-pi/) (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)
- [`cmd_run_shell_data.s`](/en/tmux/3.2a/reference/c-struct-cmd_run_shell_data-s/) (attribute)
- [`cmd_run_shell_data.shell`](/en/tmux/3.2a/reference/c-struct-cmd_run_shell_data-shell/) (attribute)
- [`cmd_run_shell_data.timer`](/en/tmux/3.2a/reference/c-struct-cmd_run_shell_data-timer/) (attribute)
- [`cmd_find_state.wp`](/en/tmux/3.2a/reference/c-struct-cmd_find_state-wp/) (attribute)
- [`cmd_run_shell_data.wp_id`](/en/tmux/3.2a/reference/c-struct-cmd_run_shell_data-wp_id/) (attribute)
