# window.Window.rotate

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

```
rotate(
  direction: "forward" | "backward" = "forward",
): Promise<void>
```

Rotate the panes within this window.

The layout stays put and the panes move through it, so this reorders what
occupies each position rather than trading two panes.

## Examples

```ts
await window.rotate("forward");
```

## Parameters

- `direction` (`"forward" | "backward"`)
  Default: `"forward"`.

## tmux command

The tmux commands behind `rotate`.

- [`rotate-window`](/en/tmux/latest/manual/rotate-window/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_rotate_window_entry`](/en/tmux/latest/reference/c-variable-cmd_rotate_window_entry/) (attribute)
- [`cmd_rotate_window_exec`](/en/tmux/latest/reference/c-function-cmd-rotate-window-c-cmd_rotate_window_exec/) (function)

## In other ports

Rotate panes within a window

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Window.rotate`](/en/py/latest/reference/libtmux-window-rotate/) (method) |
| Rust | [`window.Window.rotate`](/en/rs/latest/reference/window-window-rotate/) (method) |
| Go | [`tmux.Window.Rotate`](/en/go/latest/reference/tmux-window-rotate/) (method) |
| Java | [`io.github.libtmux.Window.rotate`](/en/java/latest/reference/io-github-libtmux-window-window-rotate/) (method) |
| C# | [`LibTmux.Window.RotateAsync`](/en/csharp/latest/reference/libtmux-window-rotateasync/) (method) |
| C++ | [`libtmux::Window::rotate`](/en/cxx/latest/reference/libtmux-window-rotate/) (method) |
| Swift | [`Server.rotate(_:upward:)`](/en/swift/latest/reference/server-rotate(_-upward-)/) (method) |

No equivalent is recorded in Ruby, Lua, PowerShell, Julia, Elixir, Kotlin, Scala or F#.
