Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Python API

Python documentation

libtmux.Window.rotate

View as Markdown

Module
libtmux
Declared in
Window
Package
libtmux
Source
src/libtmux/window.py
Other languages
Ruby Lua TypeScriptRustGoJava.NETC++Swift
rotate ( self , upward : bool | None = None , downward : bool | None = None , keep_zoom : bool | None = None ) → Window
method [source]
method [source]
rotate

Rotate pane positions in the window via $ tmux rotate-window.

Parameters
  • upward ( bool | None ) – Rotate upward (-U flag).

  • downward ( bool | None ) – Rotate downward (-D flag).

  • keep_zoom ( bool | None ) – Keep the window zoomed if zoomed (-Z flag).

Returns

Window Self, for method chaining.

In other ports Rotate panes within a window

Examples

>>> pane1 = window.active_pane
>>> pane2 = window.split()
>>> window.rotate()
Window(...)
await window.rotate("forward");
use libtmux::{Rotation, SplitDirection, SplitOptions};
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("turning").await?;
let mut window = session.active_window().await?.expect("a window");
window.split(SplitOptions::new(SplitDirection::Below)).await?;
let before: Vec<_> = window.panes().await?.iter().map(|p| p.id().clone()).collect();
window.rotate(Rotation::Up).await?;
let after: Vec<_> = window.panes().await?.iter().map(|p| p.id().clone()).collect();
assert_ne!(before, after, "the panes moved");
window.rotate(Rotation::Down).await?;
let back: Vec<_> = window.panes().await?.iter().map(|p| p.id().clone()).collect();
assert_eq!(before, back, "and the other way undoes it");
guard.shutdown().await?;

0 declared, 0 inherited

Esc

Type to search.