# window.Rotation

- **Module:** window
- **Package:** libtmux
- **Language:** Rust
- **Kind:** enum
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/window.rs#L1261
- **Page:** https://libtmux.org/en/rs/latest/reference/window-rotation/

Where a split puts the new pane, relative to the one being divided.

tmux spells these `-v`, `-v -b`, `-h`, and `-h -b`, where "horizontal"
means side by side. Naming the resulting position instead removes a
question every tmux user has asked at least once.

## Example

```rust
use libtmux::{Rotation, SplitDirection};

let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("work").await?;
let window = session.active_window().await?.expect("a session has a window");
window.split(SplitDirection::Below).await?;

// Rotating moves panes between positions; it does not create or destroy any.
let before = window.panes().await?.len();
window.rotate(Rotation::Down).await?;
assert_eq!(window.panes().await?.len(), before);

guard.shutdown().await?;
```

## Members

- `Up` (constant): Move each pane to the position before it, so the first becomes last.
- `Down` (constant): Move each pane to the position after it, which is tmux's default.
