# libtmux.control:with-reconnection

- **Package:** libtmux/control
- **Language:** Common Lisp
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-lisp/blob/c2e5fc4ed3befda21f45dfa5d5868c38fd138311/src/control.lisp#L247
- **Public owner:** libtmux.control
- **Page:** https://libtmux.org/en/lisp/latest/reference/libtmux-control-with-reconnection/

```
(with-reconnection (name snapshot previous &rest options) &body body)
```

Bind a fresh NAME and SNAPSHOT from explicit RECONNECT; close NAME on exit.
Evaluate PREVIOUS and options once. BODY permits declarations and returns all
values. Rebinding either visible name cannot redirect cleanup. Preserve primary
errors/nonlocal exits and record secondary cleanup errors on the new connection.
The previous resource retains its own old results and events.

See also: `libtmux.control:connection-cleanup-failures`, `libtmux.control:reconnect`, `libtmux.control:with-connection`.

## Parameters

- `(name snapshot previous &rest options)`
- `body`
