Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

enum libtmux-rs latest

Rotation

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

Source and package
Qualified name
libtmux::window::Rotation
Module
window
Package
libtmux
Source
crates/libtmux/src/window.rs
enum window.Rotation

Description#

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.

Examples#

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?;

Variants2#

Rotation variants
CasePayloadDescription
Down No payload Move each pane to the position after it, which is tmux's default.
Up No payload Move each pane to the position before it, so the first becomes last.
Esc

Type to search.

Reference previewOpen reference