# client_main

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L232
- **Page:** https://libtmux.org/en/tmux/3.7c/reference/c-function-client_main/

```c
int client_main(struct event_base *base, int argc, char **argv, uint64_t flags, int feat)
```

## Parameters

- `base` (`struct event_base *`)
- `argc` (`int`)
- `argv` (`char **`)
- `flags` (`uint64_t`)
- `feat` (`int`)

## Calls

- [`args_free_values`](/en/tmux/3.7c/reference/c-function-args_free_values/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L271)
- [`args_from_vector`](/en/tmux/3.7c/reference/c-function-args_from_vector/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L263)
- [`client_connect`](/en/tmux/3.7c/reference/c-function-client-c-client_connect/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L290)
- [`client_exec`](/en/tmux/3.7c/reference/c-function-client-c-client_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L407)
- [`client_send_identify`](/en/tmux/3.7c/reference/c-function-client-c-client_send_identify/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L365)
- [`cmd_list_free`](/en/tmux/3.7c/reference/c-function-cmd_list_free/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L268)
- [`cmd_pack_argv`](/en/tmux/3.7c/reference/c-function-cmd_pack_argv/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L383)
- [`cmd_parse_from_arguments`](/en/tmux/3.7c/reference/c-function-cmd_parse_from_arguments/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L264)
- [`environ_free`](/en/tmux/3.7c/reference/c-function-environ_free/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L341)
- [`fatal`](/en/tmux/3.7c/reference/c-function-fatal/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L323)
- [`log_debug`](/en/tmux/3.7c/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L281)
- [`options_free`](/en/tmux/3.7c/reference/c-function-options_free/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L338)
- [`proc_add_peer`](/en/tmux/3.7c/reference/c-function-proc_add_peer/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L301)
- [`proc_flush_peer`](/en/tmux/3.7c/reference/c-function-proc_flush_peer/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L367)
- [`proc_loop`](/en/tmux/3.7c/reference/c-function-proc_loop/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L401)
- [`proc_send`](/en/tmux/3.7c/reference/c-function-proc_send/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L391)
- [`proc_set_signals`](/en/tmux/3.7c/reference/c-function-proc_set_signals/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L277)
- [`proc_start`](/en/tmux/3.7c/reference/c-function-proc_start/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L276)
- [`server_start`](/en/tmux/3.7c/reference/c-function-server_start/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L287)
- [`setblocking`](/en/tmux/3.7c/reference/c-function-setblocking/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L411)
- [`tty_term_free_list`](/en/tmux/3.7c/reference/c-function-tty_term_free_list/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L366)
- [`xmalloc`](/en/tmux/3.7c/reference/c-function-xmalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/client.c#L379)

## Other function references

- [`client_dispatch`](/en/tmux/3.7c/reference/c-function-client-c-client_dispatch/) (function)
- [`client_exit_message`](/en/tmux/3.7c/reference/c-function-client-c-client_exit_message/) (function)
- [`client_signal`](/en/tmux/3.7c/reference/c-function-client-c-client_signal/) (function)
- [`cmd_list_any_have`](/en/tmux/3.7c/reference/c-function-cmd_list_any_have/) (function)
- [`find_cwd`](/en/tmux/3.7c/reference/c-function-find_cwd/) (function)
- [`find_home`](/en/tmux/3.7c/reference/c-function-find_home/) (function)
- [`tty_term_read_list`](/en/tmux/3.7c/reference/c-function-tty_term_read_list/) (function)

## Referenced by

- [`main`](/en/tmux/3.7c/reference/c-function-main/) (function)

## Referenced declarations

- [`msg_command.argc`](/en/tmux/3.7c/reference/c-struct-msg_command-argc/) (attribute)
- [`client_attached`](/en/tmux/3.7c/reference/c-variable-client-c-client_attached/) (attribute)
- [`CLIENT_CONTROL`](/en/tmux/3.7c/reference/c-define-tmux-h-client_control/) (constant)
- [`CLIENT_CONTROL_WAITEXIT`](/en/tmux/3.7c/reference/c-define-tmux-h-client_control_waitexit/) (constant)
- [`CLIENT_CONTROLCONTROL`](/en/tmux/3.7c/reference/c-define-tmux-h-client_controlcontrol/) (constant)
- [`client_execcmd`](/en/tmux/3.7c/reference/c-variable-client-c-client_execcmd/) (attribute)
- [`client_execshell`](/en/tmux/3.7c/reference/c-variable-client-c-client_execshell/) (attribute)
- [`CLIENT_EXIT_NONE`](/en/tmux/3.7c/reference/c-enum-client-c-312251056026170022174140061020115020145225126374-client_exit_none/) (constant)
- [`client_exitreason`](/en/tmux/3.7c/reference/c-variable-client-c-client_exitreason/) (attribute)
- [`client_exittype`](/en/tmux/3.7c/reference/c-variable-client-c-client_exittype/) (attribute)
- [`client_exitval`](/en/tmux/3.7c/reference/c-variable-client-c-client_exitval/) (attribute)
- [`client_flags`](/en/tmux/3.7c/reference/c-variable-client-c-client_flags/) (attribute)
- [`client_peer`](/en/tmux/3.7c/reference/c-variable-client-c-client_peer/) (attribute)
- [`client_proc`](/en/tmux/3.7c/reference/c-variable-client-c-client_proc/) (attribute)
- [`CLIENT_STARTSERVER`](/en/tmux/3.7c/reference/c-define-tmux-h-client_startserver/) (constant)
- [`CMD_PARSE_SUCCESS`](/en/tmux/3.7c/reference/c-enum-cmd_parse_status-cmd_parse_success/) (constant)
- [`CMD_STARTSERVER`](/en/tmux/3.7c/reference/c-define-tmux-h-cmd_startserver/) (constant)
- [`cmd_parse_result.cmdlist`](/en/tmux/3.7c/reference/c-struct-cmd_parse_result-cmdlist/) (attribute)
- [`cmd_parse_result.error`](/en/tmux/3.7c/reference/c-struct-cmd_parse_result-error/) (attribute)
- [`global_environ`](/en/tmux/3.7c/reference/c-variable-global_environ/) (attribute)
- [`global_options`](/en/tmux/3.7c/reference/c-variable-global_options/) (attribute)
- [`global_s_options`](/en/tmux/3.7c/reference/c-variable-global_s_options/) (attribute)
- [`global_w_options`](/en/tmux/3.7c/reference/c-variable-global_w_options/) (attribute)
- [`MSG_COMMAND`](/en/tmux/3.7c/reference/c-enum-msgtype-msg_command/) (constant)
- [`MSG_DETACHKILL`](/en/tmux/3.7c/reference/c-enum-msgtype-msg_detachkill/) (constant)
- [`MSG_EXEC`](/en/tmux/3.7c/reference/c-enum-msgtype-msg_exec/) (constant)
- [`MSG_SHELL`](/en/tmux/3.7c/reference/c-enum-msgtype-msg_shell/) (constant)
- [`pledge`](/en/tmux/3.7c/reference/c-define-compat-h-pledge/) (constant)
- [`ptm_fd`](/en/tmux/3.7c/reference/c-variable-ptm_fd/) (attribute)
- [`shell_command`](/en/tmux/3.7c/reference/c-variable-shell_command/) (attribute)
- [`socket_path`](/en/tmux/3.7c/reference/c-variable-socket_path/) (attribute)
- [`cmd_parse_result.status`](/en/tmux/3.7c/reference/c-struct-cmd_parse_result-status/) (attribute)
