# libtmux:rotate-window

- **Package:** libtmux
- **Language:** Common Lisp
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-lisp/blob/c2e5fc4ed3befda21f45dfa5d5868c38fd138311/src/placement.lisp#L173
- **Public owner:** libtmux
- **Page:** https://libtmux.org/en/lisp/latest/reference/libtmux-rotate-window/

```
(rotate-window client window &key (direction :up) preserve-zoom (observe t) cancel-token timeout output-limit)
```

Rotate WINDOW's pane positions :UP or :DOWN; return an outcome and replacement.
Tmux also advances the active pane. PRESERVE-ZOOM restores zoom after rotating.
Signals INVALID-ARGUMENT, STALE-TARGET or an operational condition. Captured
pane order remains unchanged in earlier observations.

## Parameters

- `client`
- `window`
- `direction?`
- `preserve-zoom?`
- `observe?`
- `cancel-token?`
- `timeout?`
- `output-limit?`

## tmux command

The tmux commands behind `rotate-window`.

- [`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)

## Guides

Pages that discuss `rotate-window`.

- [Explicit operations](/en/lisp/latest/guides/operations/)
