# LibTmux.Server.snapshot/2

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/66b9b1c3f3f3186428abdfda2c76f5cf87446710/lib/libtmux/server.ex#L174
- **Page:** https://libtmux.org/en/elixir/latest/reference/libtmux-server-snapshot-2/

```
snapshot(server, options \\ [])
@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.

See the [worked example](first-task.html).

## Parameters

- `server` (`t()`)
- `options` (`[LibTmux.Capture.option()]`)

## In other ports

### Capture the tmux hierarchy

- PowerShell: [`LibTmux\Get-TmuxSnapshot`](/en/powershell/latest/reference/libtmux-get-tmuxsnapshot/) (cmdlet). Acquires a replacement `LibTmux.Server` to [`-Depth`](/en/powershell/latest/reference/libtmux-get-tmuxsnapshot/#LibTmux%5CGet-TmuxSnapshot.parameter.Depth) (panes by default). Acquisition is not atomic; retained handles do not refresh.
- Julia: [`LibTmux.snapshot`](/en/julia/latest/reference/libtmux-snapshot-1gv6/) (function). Acquires a new `Snapshot` over an observation interval. Topology checks do not make it a transaction; earlier snapshots do not refresh.
- Ruby: [`LibTmux::Server#snapshot`](/en/ruby/latest/reference/libtmux-server-snapshot/) (method)
- Lua: [`libtmux.Server:snapshot`](/en/lua/latest/reference/libtmux-server-snapshot/) (method)
- TypeScript: [`server.Server.snapshot`](/en/ts/latest/reference/server-server-snapshot/) (method)
- Go: [`tmux.Server.Snapshot`](/en/go/latest/reference/tmux-server-snapshot/) (method)
- Java: [`io.github.libtmux.Server.Server.snapshot`](/en/java/latest/reference/io-github-libtmux-server-server-snapshot/) (method)
- C#: [`LibTmux.Server.CaptureSnapshotAsync`](/en/csharp/latest/reference/libtmux-server-capturesnapshotasync/) (method)
- Swift: [`Server.snapshot()`](/en/swift/latest/reference/server-snapshot()/) (method)
- Kotlin: [`io.github.libtmux.kotlin.Server.snapshot`](/en/kotlin/latest/reference/io-github-libtmux-kotlin-server-snapshot/) (method)
- Scala: [`io.github.libtmux.scaladsl.Server.snapshot`](/en/scala/latest/reference/io-github-libtmux-scaladsl-server-snapshot/) (method)
- F#: [`LibTmux.FSharp.Server.capture`](/en/fsharp/latest/reference/libtmux-fsharp-server-capture/) (function). Acquires a replacement shared .NET `LibTmux.Server` to the requested depth. Acquisition is not atomic; retained handles do not refresh.
