# LibTmux.with_server

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Julia
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/lifecycle.jl#L473
- **Page:** https://libtmux.org/en/julia/latest/reference/libtmux-with_server/

```
with_server(f; kwargs...)
```

## Methods

Call `f(server)` with an owned daemon, return its result, and close the daemon before returning or rethrowing. Keywords match `open_server`. If both the body and cleanup fail, throw `CompositeException` retaining both errors in that order.

```julia
with_server(f; kwargs...)
```

## Parameters

- `f` (`Any`)
- `kwargs`
