# LibTmux.Control.reconnect!/2

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/5bacf40788b43a5af27bb3656e727a921ba2db40/lib/libtmux/control.ex#L513
- **Page:** https://libtmux.org/en/elixir/pr-173/reference/libtmux-control-reconnect-bang-2/

```
reconnect!(control, options \\ [])
@spec reconnect!(t(), [call_option()]) :: t()
```

Obtains the ready epoch or raises the same structured error.

See the [worked example](supervised-control.html).

## Parameters

- `control` (`t()`)
- `options` (`[call_option()]`)
  Default: `[]`.

## tmux command

The tmux commands behind `reconnect!/2`.

- [`attach-session`](/en/tmux/latest/manual/attach-session/) (the connection is closed)
- [`display-message`](/en/tmux/latest/manual/display-message/) (the connection is closed)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_attach_session_entry`](/en/tmux/latest/reference/c-variable-cmd_attach_session_entry/) (attribute)
- [`cmd_attach_session_exec`](/en/tmux/latest/reference/c-function-cmd-attach-session-c-cmd_attach_session_exec/) (function)
- [`cmd_display_message_entry`](/en/tmux/latest/reference/c-variable-cmd_display_message_entry/) (attribute)
- [`cmd_display_message_exec`](/en/tmux/latest/reference/c-function-cmd-display-message-c-cmd_display_message_exec/) (function)
