# Workspace environment

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

> Configure the loader process and the variables available to pane commands.

The CLI's process environment controls discovery and optional runtimes.
Configuration `environment` maps provide variables to the workspace's shells.

```yaml title="environment.yaml"
session_name: environment-example
environment:
  DOC_SESSION: session
windows:
  - window_name: shell
    environment:
      DOC_WINDOW: window
    panes:
      - environment:
          DOC_PANE: pane
        shell_command: 'printf "ENV=%s|%s|%s\n" "$DOC_SESSION" "$DOC_WINDOW" "$DOC_PANE"'
      - shell_command: 'printf "ENV=%s|%s|%s\n" "$DOC_SESSION" "$DOC_WINDOW" "$DOC_PANE"'
```

A pane map selects its launch environment in place of the window map. Session
variables still apply. Repeat a window variable in the pane map when that pane
needs it too. Avoid putting credentials in example files or diagnostic output.

## Variable expressions

The loader expands defined variables in configuration values before delivery.
An expression can therefore use the invoking process's value before the pane
shell reads it. Use explicit configuration variables and inspect resulting
commands when moving a workspace between environments.

## Loader settings

| Variable | Use |
| --- | --- |
| `TMUXP_CONFIGDIR` | Preferred existing directory for saved workspaces |
| `XDG_CONFIG_HOME` | Base for the `tmuxp` configuration directory |
| `EDITOR` | Editor used by `edit` |
| `TMUX_WORKSPACE_PYTHON` | Optional interpreter for [`shell`](<https://libtmux.org/en/py/latest/workspace/reference/tmuxp-cli-shell-clishellnamespace-shell/>) and supported extensions |
| `NO_COLOR` | Disable terminal color when nonempty |

These are process settings, not workspace YAML keys. Read
[discovery](https://libtmux.org/en/csharp/latest/workspace/guides/discovery/), [editing](https://libtmux.org/en/csharp/latest/workspace/cli/edit/) and
[shell inspection](https://libtmux.org/en/csharp/latest/workspace/cli/shell/) for their task-specific behavior.

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