# `LibTmux.Server`
[🔗](https://github.com/libtmux/libtmux-elixir/blob/b72452c198917433229bdc266a68c163541b6127/lib/libtmux/server.ex#L1)

An explicit local tmux server descriptor.

`new/1` performs no I/O. One-shot commands use an absolute executable and
socket with `-N`, so they cannot start a missing server or attach a client.
Configured server hooks remain environmental effects. Reads observe an
interval; one-shot identity checks leave a check/use race. Persistent
incarnation-bound mutations require a separately qualified connection.

# `option`

```elixir
@type option() ::
  {:executable | :socket | :cwd, String.t()}
  | {:env, %{optional(binary()) =&gt; binary()}}
```

Descriptor inputs; executable, socket and cwd are absolute NUL-free paths.

# `t`

```elixir
@type t() :: %LibTmux.Server{
  cwd: String.t(),
  env: %{optional(binary()) =&gt; binary()},
  executable: String.t(),
  socket: String.t()
}
```

An explicit local server descriptor; constructing it neither connects nor reserves server identity.

# `new`

```elixir
@spec new([option()]) :: t()
```

Constructs a descriptor for an existing server without connecting or creating it.

# `run`

```elixir
@spec run(t(), LibTmux.Command.t(), [LibTmux.Transport.OneShot.option()]) ::
  {:ok, LibTmux.Transport.OneShot.result()} | {:error, LibTmux.Error.t()}
```

Runs one trusted command without attaching; returns bounded output and exit evidence.

# `snapshot`

```elixir
@spec snapshot(t(), [LibTmux.Capture.option()]) ::
  {:ok, LibTmux.Snapshot.t()} | {:error, LibTmux.Error.t()}
```

Captures a new graph explicitly, with bounded work and read retries.

# `snapshot!`

```elixir
@spec snapshot!(t(), [LibTmux.Capture.option()]) :: LibTmux.Snapshot.t()
```

Captures a graph or raises the same structured capture error.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
