# LibTmux.Workspace.WorkspaceFile.FromSnapshot

- **Module:** LibTmux.Workspace
- **Package:** LibTmux.Workspace
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux.Workspace/WorkspaceFile.cs#L381
- **Page:** https://libtmux.org/en/csharp/latest/workspace/reference/libtmux-workspace-workspacefile-fromsnapshot/

```
LibTmux.Workspace.WorkspaceFile.FromSnapshot(session: Session) -> WorkspaceFile
```

Creates a workspace declaration from a captured session without reaching tmux.

Preserves captured window placements and pane order, names, layouts, and focus.
Repeated links become separate declared windows. Captured pane directories
escape literal dollars for a later explicit <see cref="Resolve" />; captured
null paths remain unspecified. Commands, environment, options, terminal text,
entity identifiers, pane indices, and shared-link identity are not
reconstructed.
Foreground command names do not establish shell intent. Restoring a native
custom layout can change which pane occupies a position; see
<see cref="Window.SelectLayoutAsync" />.

## Parameters

- `session` (`Session`): The session with captured windows, panes, and active pane relations.

## Returns

An unresolved declaration without a document directory.

## Raises

- [`ArgumentNullException`](https://learn.microsoft.com/dotnet/api/system.argumentnullexception): The session is null.
- [`IncompleteSnapshotException`](/en/csharp/latest/reference/libtmux-incompletesnapshotexception/): A required field or relation was not captured.
- [`TmuxProtocolException`](/en/csharp/latest/reference/libtmux-tmuxprotocolexception/): A captured window active flag is malformed.
