# test.TestServer

- **Module:** test
- **Package:** libtmux
- **Language:** Rust
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/test.rs#L614
- **Page:** https://libtmux.org/en/rs/latest/reference/test-testserver/

One isolated tmux daemon and its descriptor-relative cleanup guard.

This value owns its foreground daemon and socket-directory lifecycle and
holds a no-start [`Server`] handle. The daemon uses a private explicit
socket and an owned empty config, creating no initial session. Escaped
[`Server`] clones share that handle's executor. [`TestServer::shutdown`]
closes the shared executor and reports graceful lifecycle and cleanup
failures; [`Drop`] performs synchronous forced best-effort daemon and file
cleanup whose failures cannot be observed.

## Members

- `new` (method): Start an isolated tmux server with the default builder settings.
- `builder` (method): Start a consuming isolated test-server builder.
- `server` (method): Return the no-start client handle for this isolated daemon.
- `socket_path` (method): Return this guard's explicit Unix socket path.
- `session` (method): Create a session on this fixture's server.
- `daemon_pid` (method): Return the retained foreground daemon PID.
- `daemon_state` (method): Report whether the daemon is still running, and how it ended if not.
- `shutdown` (method): Stop the client executor and consume the daemon guard.
