# tmuxtest.NewServerWithOptions

- **Module:** tmuxtest
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmux/tmuxtest/harness.go#L317
- **Page:** https://libtmux.org/reference/go/tmuxtest-newserverwithoptions/

```
tmuxtest.NewServerWithOptions(ctx: context.Context, t: testing.TB, options: ServerOptions) -> tmux.Server
```

NewServerWithOptions prepares an isolated harness-owned [tmux.Server] from options. Initial startup uses ctx and the harness timeout, whichever ends first. The daemon starts only when [ServerOptions.InitialSession] is non-nil or a later tmux command starts it. It registers bounded cleanup with t; setup failures call [testing.TB.Fatal]. The context does not govern later cleanup or daemon lifetime.
