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.

method libtmux-rs latest

SplitWindow.direction

Put the new pane on this side of the one being divided.

Source and package
Qualified name
libtmux::plan::ops::panes::SplitWindow::direction
Module
plan.ops.panes
Declared in
SplitWindow
Package
libtmux
Source
crates/libtmux/src/plan/ops/panes.rs
#[must_use] pub const fn direction( mut self, direction: SplitDirection ) -> Self

Description#

The default is SplitDirection::Below, which is tmux's. Above and Left need tmux's -b, so they are reachable only through this: with SplitWindow::horizontal() alone a plan could ask for two of the four positions, while the object API's crate::SplitOptions has always offered all four.

Examples#

use libtmux::SplitDirection;
use libtmux::plan::{NewSession, Plan, SplitWindow};
let mut plan = Plan::new();
let session = plan.add(NewSession::new("above"));
plan.add(SplitWindow::new(session.window()).direction(SplitDirection::Above));
assert_eq!(plan.len(), 2);
Parameters
Esc

Type to search.

Reference previewOpen reference