# Load a workspace

Source: https://libtmux.org/en/csharp/latest/workspace/cli/load/

> Create or reuse a session from a workspace file, with explicit attachment and output choices.

Load a saved configuration into tmux. Use `-d` for scripts so the command returns
after construction without attaching a terminal. Command delivery does not mean
the programs running in those panes have finished or become ready.

## Load without attaching

Continue the [installation walkthrough](https://libtmux.org/en/csharp/latest/workspace/guides/installation/) with its
[`workspace.yaml`](https://libtmux.org/en/csharp/latest/workspace/guides/installation/#create-the-input) and private socket:

```console
$ tmux-workspace load \
    -S "$WORKSPACE_TMP/tmux.sock" \
    -f /dev/null \
    -d \
    --json \
    workspace.yaml
```

`-S` selects the socket path; `-L` selects a socket name. `-f` supplies tmux's
configuration when starting a server. Keep the same endpoint for later capture,
inspection and cleanup. Pass `-s another-name` to override the final input's
session name.

## Existing sessions and append

A session with the requested name is reused. Loading is not a reconciliation
operation that removes extra windows. Inspect a failed result before retrying:
earlier inputs and changes to a borrowed session can remain.

Inside tmux, `--append` adds windows to the invoking pane's session. It needs
valid `TMUX` and `TMUX_PANE` values for the selected daemon. Use `-d` when loading
onto a different server. Multiple inputs are processed in their supplied order.

## Attachment and output

Human loading can attach a terminal or switch a tmux client. For automation,
choose `-d` or an authenticated append explicitly; machine output does not
answer interactive questions. `--yes` accepts supported confirmations.

`--json` returns a result; `--ndjson` emits records as work proceeds. Read
[output](https://libtmux.org/en/csharp/latest/workspace/reference/output/) and [errors](https://libtmux.org/en/csharp/latest/workspace/reference/exit-codes/)
before consuming those records. `--no-progress` disables the terminal display;
it does not disable errors. `-2` requests 256-color handling from tmux.

Use [configuration](https://libtmux.org/en/csharp/latest/workspace/configuration/) for fields and
[hooks](https://libtmux.org/en/csharp/latest/workspace/configuration/hooks/) for bootstrap scripts and extensions.

[CLI source](https://github.com/libtmux/libtmux-dotnet/blob/f77fe776ba67a04abb20ddbbc26cf4a000d63b74/src/LibTmux.Workspace.Cli/README.md).
