# Libtmux_unix.Client.rotate_panes

- **Module:** Libtmux_unix
- **Package:** libtmux-unix
- **Language:** OCaml
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-ocaml/blob/205dfda49742592b479247049d186956e4a4cfe9/unix/libtmux_unix.mli#L722
- **Public owner:** Libtmux_unix
- **Page:** https://libtmux.org/en/ocaml/latest/reference/libtmux_unix-client-rotate_panes/

```
val rotate_panes :
  ?cancel:Cancellation.t ->
  t ->
  Libtmux.Window.target ->
  [ `Backward | `Forward ] -> (unit, Libtmux.Error.t) result
```

Rotate pane positions in the selected direction. Pane identities and running processes remain attached to their panes.

## Parameters

- `cancel?` (`Cancellation.t`)
- `arg1` (`t`)
- `arg2` (`Libtmux.Window.target`)
- `arg3` (``[ `Backward | `Forward ]``)

## tmux command

The tmux commands behind `rotate_panes`.

- [`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) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`window.Window.rotate`](/en/ts/latest/reference/window-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) |
| Perl | No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands. |

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