# Session configuration

Source: https://libtmux.org/en/csharp/latest/workspace/configuration/session/

> Name a workspace and apply session options and environment.

Set `session_name` and an ordered, nonempty `windows` list. Use a simple name
without tmux target separators such as `:` and `.`.

```yaml title="session.yaml"
session_name: session-example
environment:
  PROJECT_MODE: development
options:
  status: false
windows:
  - window_name: shell
    panes: [null]
```

## Session fields

| Field | Effect |
| --- | --- |
| `session_name` | Session to create or reuse |
| `windows` | Windows to construct in order |
| `start_directory` | Starting directory inherited by child configuration |
| `environment` | Variables supplied to the workspace |
| `options` | Options applied to this session |
| `global_options` | Options applied globally on the selected tmux server |
| `shell_command_before` | Commands prepended to each pane's commands |
| `suppress_history` | History policy inherited by windows and panes |
| `before_script` | Checked bootstrap process |
| `workspace_builder_options` | Builder settings such as prompt readiness |

Use `global_options` only when every session on that server should share the
change. Select a private socket for examples and automated jobs.

An existing session is reused under the loader's policy. Use `load -s NAME`
when a second copy needs another name. Loading does not remove unrelated
sessions or reconcile away extra windows.

Read [environment](https://libtmux.org/en/csharp/latest/workspace/configuration/environment/), [commands](https://libtmux.org/en/csharp/latest/workspace/configuration/commands/) and
[hooks](https://libtmux.org/en/csharp/latest/workspace/configuration/hooks/) for the behavior behind those fields.

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