# libtmux.Server.switch_client

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/server.py#L2162
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-server-switch_client/

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

```
libtmux.Server.switch_client(
    self, target_session: str
) -> None
```

Switch tmux client.

## Parameters

- `target_session` (`str`): name of the session. fnmatch(3) works.

## Raises

- [`exc.BadSessionName`](/en/py/stable/reference/libtmux-exc-badsessionname/)

## In other ports

### Switch a client to another session

- Go: [`tmux.Server.SwitchClient`](/en/go/latest/reference/tmux-server-switchclient/) (method)
- C#: [`LibTmux.Server.SwitchClientAsync`](/en/csharp/latest/reference/libtmux-server-switchclientasync/) (method)
