# tmux.Server.SwitchClient

- **Module:** tmux.Server
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/server_clients.go#L274
- **Page:** https://libtmux.org/en/go/latest/reference/tmux-server-switchclient/

```
tmux.Server.SwitchClient(ctx: context.Context, targetSession: string) -> error
```

SwitchClient switches tmux's current client to targetSession. TargetSession is a validated session name rather than a stable identity; cancellation does not prove the switch did not occur.
