# tmux.ControlClient.Reconnect

- **Module:** tmux.ControlClient
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/control_lifecycle.go#L76
- **Page:** https://libtmux.org/en/go/latest/reference/tmux-controlclient-reconnect/

```
tmux.ControlClient.Reconnect(ctx: context.Context) -> (*ControlClient, error)
```

Reconnect registers a replacement on the last attached session observed at a reply boundary, then closes the receiver. Failed replacement setup does not initiate receiver shutdown. If shutdown fails, Reconnect returns the live replacement with that error; the caller owns every non-nil result. A receiver whose stream ended cleanly can recover from its last observation. Commands are never replayed.
