# server.Server.validateLayouts

- **Module:** server
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/server.ts#L1171
- **Page:** https://libtmux.org/en/ts/latest/reference/server-server-validatelayouts/

```
validateLayouts(
  layouts: readonly {
    readonly layout: string;
    readonly panes: number;
  }[],
  options?: CommandOptions,
): Promise<void>
```

Check every planned window layout before setup scripts or mutations.

Names accept unique abbreviations. Only version-sensitive layouts query the
daemon; a cold endpoint uses the selected client. Checksums, bounded tree
structure and pane counts are checked locally; tmux owns geometry and pruning.
Custom layouts are limited to 8192 characters and 256 classic groups.
JSON layouts require tmux 3.8 and permit at most 200 nested objects.

## Examples

```ts
await server.validateLayouts([
  { layout: "even-h", panes: 2 },
  { layout: "tiled", panes: 1 },
]);
```

## Parameters

- `layouts` (`readonly { readonly layout: string; readonly panes: number }[]`)
- `options?` (`CommandOptions`)

## Raises

- [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError): when a layout, pane count or version reply is invalid.
- [`TmuxCommandError`](/en/ts/latest/reference/errors-tmuxcommanderror/): when the daemon or client version cannot be read.
- [`TmuxTransportError`](/en/ts/latest/reference/errors-tmuxtransporterror/): when validation is cancelled or a version probe fails.

## tmux command

The tmux commands behind `validateLayouts`.

- [`run-shell`](/en/tmux/latest/manual/run-shell/) (layouts that depend on the tmux version)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_run_shell_entry`](/en/tmux/latest/reference/c-variable-cmd_run_shell_entry/) (attribute)
- [`cmd_run_shell_exec`](/en/tmux/latest/reference/c-function-cmd-run-shell-c-cmd_run_shell_exec/) (function)
