# tmuxtest.NewServerWithOptions

- **Module:** tmuxtest
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-go/blob/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/tmuxtest/harness.go#L320
- **Page:** https://libtmux.org/en/go/latest/reference/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.
