# cmd_switch_client_exec

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

tmux command: [`switch-client`](/en/tmux/3.7c/manual/switch-client/)

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

## Parameters

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

## Calls

- [`args_get`](/en/tmux/3.7c/reference/c-function-args_get/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L54)
- [`args_has`](/en/tmux/3.7c/reference/c-function-args_has/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L82)
- [`cmd_find_from_session`](/en/tmux/3.7c/reference/c-function-cmd_find_from_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L151)
- [`cmd_find_target`](/en/tmux/3.7c/reference/c-function-cmd_find_target/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L76)
- [`cmd_get_args`](/en/tmux/3.7c/reference/c-function-cmd_get_args/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L51)
- [`cmdq_error`](/en/tmux/3.7c/reference/c-function-cmdq_error/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L86)
- [`cmdq_get_client`](/en/tmux/3.7c/reference/c-function-cmdq_get_client/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L57)
- [`cmdq_get_current`](/en/tmux/3.7c/reference/c-function-cmdq_get_current/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L52)
- [`cmdq_get_target_client`](/en/tmux/3.7c/reference/c-function-cmdq_get_target_client/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L58)
- [`environ_update`](/en/tmux/3.7c/reference/c-function-environ_update/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L156)
- [`key_bindings_get_table`](/en/tmux/3.7c/reference/c-function-key_bindings_get_table/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L98)
- [`key_bindings_unref_table`](/en/tmux/3.7c/reference/c-function-key_bindings_unref_table/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L104)
- [`proc_get_peer_uid`](/en/tmux/3.7c/reference/c-function-proc_get_peer_uid/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L84)
- [`server_client_set_key_table`](/en/tmux/3.7c/reference/c-function-server_client_set_key_table/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L160)
- [`server_client_set_session`](/en/tmux/3.7c/reference/c-function-server_client_set_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L158)
- [`server_redraw_window`](/en/tmux/3.7c/reference/c-function-server_redraw_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L143)
- [`session_next_session`](/en/tmux/3.7c/reference/c-function-session_next_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L117)
- [`session_previous_session`](/en/tmux/3.7c/reference/c-function-session_previous_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L123)
- [`session_set_current`](/en/tmux/3.7c/reference/c-function-session_set_current/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L150)
- [`sort_order_from_string`](/en/tmux/3.7c/reference/c-function-sort_order_from_string/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L109)
- [`window_pop_zoom`](/en/tmux/3.7c/reference/c-function-window_pop_zoom/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L146)
- [`window_push_zoom`](/en/tmux/3.7c/reference/c-function-window_push_zoom/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L142)
- [`window_redraw_active_switch`](/en/tmux/3.7c/reference/c-function-window_redraw_active_switch/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L144)
- [`window_set_active_pane`](/en/tmux/3.7c/reference/c-function-window_set_active_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L145)

## Other function references

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

## Referenced by

- [`cmd_switch_client_entry`](/en/tmux/3.7c/reference/c-variable-cmd_switch_client_entry/) (attribute)

## Referenced declarations

- [`window.active`](/en/tmux/3.7c/reference/c-struct-window-active/) (attribute)
- [`CLIENT_IGNORESIZE`](/en/tmux/3.7c/reference/c-define-tmux-h-client_ignoresize/) (constant)
- [`CLIENT_READONLY`](/en/tmux/3.7c/reference/c-define-tmux-h-client_readonly/) (constant)
- [`cmd`](/en/tmux/3.7c/reference/c-struct-cmd/) (struct)
- [`CMD_FIND_PANE`](/en/tmux/3.7c/reference/c-enum-cmd_find_type-cmd_find_pane/) (constant)
- [`CMD_FIND_PREFER_UNATTACHED`](/en/tmux/3.7c/reference/c-define-tmux-h-cmd_find_prefer_unattached/) (constant)
- [`CMD_FIND_SESSION`](/en/tmux/3.7c/reference/c-enum-cmd_find_type-cmd_find_session/) (constant)
- [`CMD_RETURN_ERROR`](/en/tmux/3.7c/reference/c-enum-cmd_retval-cmd_return_error/) (constant)
- [`CMD_RETURN_NORMAL`](/en/tmux/3.7c/reference/c-enum-cmd_retval-cmd_return_normal/) (constant)
- [`cmd_retval`](/en/tmux/3.7c/reference/c-enum-cmd_retval/) (enum)
- [`cmdq_item`](/en/tmux/3.7c/reference/c-struct-cmdq_item/) (struct)
- [`CMDQ_STATE_REPEAT`](/en/tmux/3.7c/reference/c-define-tmux-h-cmdq_state_repeat/) (constant)
- [`cmd_find_state.current`](/en/tmux/3.7c/reference/c-struct-cmd_find_state-current/) (attribute)
- [`client.environ`](/en/tmux/3.7c/reference/c-struct-client-environ/) (attribute)
- [`session.environ`](/en/tmux/3.7c/reference/c-struct-session-environ/) (attribute)
- [`client.flags`](/en/tmux/3.7c/reference/c-struct-client-flags/) (attribute)
- [`cmd_find_state.flags`](/en/tmux/3.7c/reference/c-struct-cmd_find_state-flags/) (attribute)
- [`client.keytable`](/en/tmux/3.7c/reference/c-struct-client-keytable/) (attribute)
- [`client.last_session`](/en/tmux/3.7c/reference/c-struct-client-last_session/) (attribute)
- [`session.options`](/en/tmux/3.7c/reference/c-struct-session-options/) (attribute)
- [`sort_criteria.order`](/en/tmux/3.7c/reference/c-struct-sort_criteria-order/) (attribute)
- [`client.peer`](/en/tmux/3.7c/reference/c-struct-client-peer/) (attribute)
- [`key_table.references`](/en/tmux/3.7c/reference/c-struct-key_table-references/) (attribute)
- [`sort_criteria.reversed`](/en/tmux/3.7c/reference/c-struct-sort_criteria-reversed/) (attribute)
- [`cmd_find_state.s`](/en/tmux/3.7c/reference/c-struct-cmd_find_state-s/) (attribute)
- [`client.session`](/en/tmux/3.7c/reference/c-struct-client-session/) (attribute)
- [`SORT_END`](/en/tmux/3.7c/reference/c-enum-sort_order-sort_end/) (constant)
- [`winlink.window`](/en/tmux/3.7c/reference/c-struct-winlink-window/) (attribute)
- [`cmd_find_state.wl`](/en/tmux/3.7c/reference/c-struct-cmd_find_state-wl/) (attribute)
- [`cmd_find_state.wp`](/en/tmux/3.7c/reference/c-struct-cmd_find_state-wp/) (attribute)
