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

PaneDirection

Which way to move focus among a window's panes.

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

Description#

tmux decides what is "up" from a pane's position on screen rather than from its index, so these follow the layout rather than the pane order.

Examples#

use libtmux::{PaneDirection, 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");
let lower = window.split(SplitDirection::Below).await?;
// Focus follows the layout, and tmux wraps at the edge rather than
// refusing, so this always names a pane.
let focused = window.focus_direction(PaneDirection::Below).await?;
assert_eq!(focused.id(), lower.id());
guard.shutdown().await?;

Variants4#

PaneDirection variants
CasePayloadDescription
Above No payload The pane above.
Below No payload The pane below.
Left No payload The pane to the left.
Right No payload The pane to the right.
Esc

Type to search.

Reference previewOpen reference