# window.Window.cmd

- **Module:** window.Window
- **Package:** @libtmux/libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/2cb93308200da38a26b59876618116850f110607/packages/libtmux/src/window.ts#L489
- **Page:** https://libtmux.org/reference/ts/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");
```
