# cmd_switch_client_exec

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L48
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-cmd-switch-client-c-cmd_switch_client_exec/

tmux command: [`switch-client`](/en/tmux/3.2a/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

- [`alerts_check_session`](/en/tmux/3.2a/reference/c-function-alerts_check_session/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L153)
- [`args_get`](/en/tmux/3.2a/reference/c-function-args_get/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L53)
- [`args_has`](/en/tmux/3.2a/reference/c-function-args_has/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L77)
- [`cmd_find_from_session`](/en/tmux/3.2a/reference/c-function-cmd_find_from_session/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L130)
- [`cmd_find_target`](/en/tmux/3.2a/reference/c-function-cmd_find_target/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L71)
- [`cmd_get_args`](/en/tmux/3.2a/reference/c-function-cmd_get_args/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L50)
- [`cmdq_error`](/en/tmux/3.2a/reference/c-function-cmdq_error/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L88)
- [`cmdq_get_client`](/en/tmux/3.2a/reference/c-function-cmdq_get_client/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L117)
- [`cmdq_get_current`](/en/tmux/3.2a/reference/c-function-cmdq_get_current/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L51)
- [`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-switch-client.c#L56)
- [`environ_update`](/en/tmux/3.2a/reference/c-function-environ_update/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L135)
- [`key_bindings_get_table`](/en/tmux/3.2a/reference/c-function-key_bindings_get_table/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L86)
- [`key_bindings_unref_table`](/en/tmux/3.2a/reference/c-function-key_bindings_unref_table/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L92)
- [`notify_client`](/en/tmux/3.2a/reference/c-function-notify_client/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L144)
- [`recalculate_sizes`](/en/tmux/3.2a/reference/c-function-recalculate_sizes/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L152)
- [`server_check_unattached`](/en/tmux/3.2a/reference/c-function-server_check_unattached/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L148)
- [`server_client_set_key_table`](/en/tmux/3.2a/reference/c-function-server_client_set_key_table/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L141)
- [`server_redraw_client`](/en/tmux/3.2a/reference/c-function-server_redraw_client/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L149)
- [`server_redraw_window`](/en/tmux/3.2a/reference/c-function-server_redraw_window/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L122)
- [`session_set_current`](/en/tmux/3.2a/reference/c-function-session_set_current/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L129)
- [`session_update_activity`](/en/tmux/3.2a/reference/c-function-session_update_activity/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L145)
- [`status_timer_start`](/en/tmux/3.2a/reference/c-function-status_timer_start/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L143)
- [`tty_update_client_offset`](/en/tmux/3.2a/reference/c-function-tty_update_client_offset/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L142)
- [`window_pop_zoom`](/en/tmux/3.2a/reference/c-function-window_pop_zoom/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L125)
- [`window_push_zoom`](/en/tmux/3.2a/reference/c-function-window_push_zoom/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L121)
- [`window_redraw_active_switch`](/en/tmux/3.2a/reference/c-function-window_redraw_active_switch/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L123)
- [`window_set_active_pane`](/en/tmux/3.2a/reference/c-function-window_set_active_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L124)

## Other function references

- [`cmdq_get_flags`](/en/tmux/3.2a/reference/c-function-cmdq_get_flags/) (function)
- [`session_alive`](/en/tmux/3.2a/reference/c-function-session_alive/) (function)
- [`session_next_session`](/en/tmux/3.2a/reference/c-function-session_next_session/) (function)
- [`session_previous_session`](/en/tmux/3.2a/reference/c-function-session_previous_session/) (function)

## Referenced by

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

## Referenced declarations

- [`window.active`](/en/tmux/3.2a/reference/c-struct-window-active/) (attribute)
- [`CLIENT_IGNORESIZE`](/en/tmux/3.2a/reference/c-define-tmux-h-client_ignoresize/) (constant)
- [`CLIENT_READONLY`](/en/tmux/3.2a/reference/c-define-tmux-h-client_readonly/) (constant)
- [`cmd`](/en/tmux/3.2a/reference/c-struct-cmd/) (struct)
- [`CMD_FIND_PANE`](/en/tmux/3.2a/reference/c-enum-cmd_find_type-cmd_find_pane/) (constant)
- [`CMD_FIND_PREFER_UNATTACHED`](/en/tmux/3.2a/reference/c-define-tmux-h-cmd_find_prefer_unattached/) (constant)
- [`CMD_FIND_SESSION`](/en/tmux/3.2a/reference/c-enum-cmd_find_type-cmd_find_session/) (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_retval`](/en/tmux/3.2a/reference/c-enum-cmd_retval/) (enum)
- [`cmdq_item`](/en/tmux/3.2a/reference/c-struct-cmdq_item/) (struct)
- [`CMDQ_STATE_REPEAT`](/en/tmux/3.2a/reference/c-define-tmux-h-cmdq_state_repeat/) (constant)
- [`cmd_find_state.current`](/en/tmux/3.2a/reference/c-struct-cmd_find_state-current/) (attribute)
- [`session.curw`](/en/tmux/3.2a/reference/c-struct-session-curw/) (attribute)
- [`client.environ`](/en/tmux/3.2a/reference/c-struct-client-environ/) (attribute)
- [`session.environ`](/en/tmux/3.2a/reference/c-struct-session-environ/) (attribute)
- [`client.flags`](/en/tmux/3.2a/reference/c-struct-client-flags/) (attribute)
- [`cmd_find_state.flags`](/en/tmux/3.2a/reference/c-struct-cmd_find_state-flags/) (attribute)
- [`winlink.flags`](/en/tmux/3.2a/reference/c-struct-winlink-flags/) (attribute)
- [`client.keytable`](/en/tmux/3.2a/reference/c-struct-client-keytable/) (attribute)
- [`session.last_attached_time`](/en/tmux/3.2a/reference/c-struct-session-last_attached_time/) (attribute)
- [`client.last_session`](/en/tmux/3.2a/reference/c-struct-client-last_session/) (attribute)
- [`window.latest`](/en/tmux/3.2a/reference/c-struct-window-latest/) (attribute)
- [`session.options`](/en/tmux/3.2a/reference/c-struct-session-options/) (attribute)
- [`key_table.references`](/en/tmux/3.2a/reference/c-struct-key_table-references/) (attribute)
- [`cmd_find_state.s`](/en/tmux/3.2a/reference/c-struct-cmd_find_state-s/) (attribute)
- [`client.session`](/en/tmux/3.2a/reference/c-struct-client-session/) (attribute)
- [`winlink.window`](/en/tmux/3.2a/reference/c-struct-winlink-window/) (attribute)
- [`WINLINK_ALERTFLAGS`](/en/tmux/3.2a/reference/c-define-tmux-h-winlink_alertflags/) (constant)
- [`cmd_find_state.wl`](/en/tmux/3.2a/reference/c-struct-cmd_find_state-wl/) (attribute)
- [`cmd_find_state.wp`](/en/tmux/3.2a/reference/c-struct-cmd_find_state-wp/) (attribute)
