# LibTmux::Async::Server#switch_client

- **Module:** LibTmux::Async
- **Package:** libtmux-async
- **Language:** Ruby
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ruby/blob/da7b6191b9439e3c84fa1c9eeaa9168263ee7af4/gems/libtmux/lib/libtmux/terminal.rb#L34
- **Public owner:** LibTmux::Server#switch_client
- **Page:** https://libtmux.org/en/ruby/v0.1.1/reference/libtmux-async-server-switch_client/

```
def switch_client: (
  client: ::String,
  session: ::LibTmux::EntityRef,
  ?timeout: ::Numeric,
  ?cancel: untyped
) -> ::LibTmux::CommandResult
```

Resolves the literal selector at dispatch; it is not a client reference.

Behavior contract: Client switching.

## Parameters

- `client` (`::String`)
- `session` (`::LibTmux::EntityRef`)
- `timeout` (`::Numeric`)
- `cancel` (`untyped`)

## tmux command

The tmux commands behind `switch_client`.

- [`switch-client`](/en/tmux/latest/manual/switch-client/)
- [`list-commands`](/en/tmux/latest/manual/list-commands/)
- [`show-options`](/en/tmux/latest/manual/show-options/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_switch_client_entry`](/en/tmux/latest/reference/c-variable-cmd_switch_client_entry/) (attribute)
- [`cmd_switch_client_exec`](/en/tmux/latest/reference/c-function-cmd-switch-client-c-cmd_switch_client_exec/) (function)
- [`cmd_list_commands_entry`](/en/tmux/latest/reference/c-variable-cmd_list_commands_entry/) (attribute)
- [`cmd_list_commands`](/en/tmux/latest/reference/c-function-cmd-list-commands-c-cmd_list_commands/) (function)
- [`cmd_show_options_entry`](/en/tmux/latest/reference/c-variable-cmd_show_options_entry/) (attribute)
- [`cmd_show_options_exec`](/en/tmux/latest/reference/c-function-cmd-show-options-c-cmd_show_options_exec/) (function)
