# Window configuration

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

> Set window names, indexes, layouts, options and focus.

Each item in `windows` creates one window with its own ordered pane list.
Set `window_index` when the tmux index matters independently of list position.

```yaml title="windows.yaml"
session_name: windows-example
windows:
  - window_name: tools
    window_index: 2
    layout: even-horizontal
    focus: true
    options:
      automatic-rename: false
    options_after:
      synchronize-panes: true
    panes:
      - printf left
      - printf right
```

`options` applies during construction. `options_after` applies after initial
pane commands, which is useful for enabling synchronized typing after each pane
has received its own setup. Later input in a synchronized pane can reach the
other panes in that window.

## Launch settings

`start_directory` supplies a directory for panes that do not override it.
`window_shell` supplies their launch command; a pane's `shell` overrides it.
Set `environment` for a window-wide launch map and read
[environment inheritance](https://libtmux.org/en/csharp/latest/workspace/configuration/environment/) before overriding it per pane.

Use distinct explicit indexes. `focus: true` selects the window after building.
An explicit [layout](https://libtmux.org/en/csharp/latest/workspace/configuration/layouts/) makes the intended arrangement clear across
terminal sizes. [Pane configuration](https://libtmux.org/en/csharp/latest/workspace/configuration/panes/) controls each pane's contents.

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