# Window configuration

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

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

**Workspace Manager concept example** A working example of the core library. It can change without notice.



Each item in [`windows`](https://libtmux.org/en/ts/latest/workspace/configuration/session/#session-fields-windows) creates one window with its own ordered pane list.
Set [`window_index`](https://libtmux.org/en/tmux/latest/catalog/formats/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`](https://libtmux.org/en/ts/latest/workspace/configuration/session/#session-fields-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`](https://libtmux.org/en/ts/latest/workspace/configuration/session/#session-fields-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`](https://libtmux.org/en/ts/latest/workspace/configuration/session/#session-fields-environment) for a window-wide launch map and read
[environment inheritance](https://libtmux.org/en/ts/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/ts/latest/workspace/configuration/layouts/) makes the intended arrangement clear across
terminal sizes. [Pane configuration](https://libtmux.org/en/ts/latest/workspace/configuration/panes/) controls each pane's contents.

[CLI source](https://github.com/libtmux/libtmux-ts/blob/f36d692552bb9a373b45338bb5fece854e57cc3d/packages/workspace-cli/README.md).
