# tmuxtest.NewServer

- **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#L304
- **Page:** https://libtmux.org/reference/go/tmuxtest-newserver/

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

NewServer starts an isolated [tmux.Server] with a session named "work". Startup uses ctx and the harness timeout, whichever ends first. It registers bounded cleanup with t; setup failures call [testing.TB.Fatal]. The context does not govern later server cleanup or daemon lifetime.
