# Window configuration

Source: https://libtmux.org/en/rs/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/rs/latest/workspace/configuration/session/#session-fields-windows) creates one window with its own ordered pane list.
Set [`window_index`](<https://libtmux.org/en/rs/latest/workspace/reference/config-windowconfig-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/rs/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/rs/latest/workspace/configuration/session/#session-fields-start-directory) supplies a directory for panes that do not override it.
[`window_shell`](<https://libtmux.org/en/rs/latest/workspace/reference/config-windowconfig-window_shell/>) supplies their launch command; a pane's [`shell`](<https://libtmux.org/en/rs/latest/workspace/reference/config-paneconfig-shell/>) overrides it.
Set [`environment`](https://libtmux.org/en/rs/latest/workspace/configuration/session/#session-fields-environment) for a window-wide launch map and read
[environment inheritance](https://libtmux.org/en/rs/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/rs/latest/workspace/configuration/layouts/) makes the intended arrangement clear across
terminal sizes. [Pane configuration](https://libtmux.org/en/rs/latest/workspace/configuration/panes/) controls each pane's contents.

[CLI source](https://github.com/libtmux/libtmux-rs/blob/e9be0b6f6d22cd2eb79b0ec08964f82e717e5fe4/crates/tmux-workspace/docs/cli.md).
