# window.Window.cmd

- **Module:** window.Window
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/3fe1ca654b81b8cbf4a13b777a001a3298c87a6f/packages/libtmux/src/window.ts#L548
- **Page:** https://libtmux.org/en/ts/latest/reference/window-window-cmd/

```
window.Window.cmd(command: : string, args: : readonly string[] = [], options: : CmdOptions) -> Promise<readonly string[]>
```

Run a tmux command this package does not model, addressed at this window.

The window's id is sent as the target; pass `target` to address something
else, or `null` for a command that takes none — `display-panes` takes a
client, so it wants `{ target: null }` and not this window's `@n`.

## Example

```ts
await window.cmd("rotate-window");
```
