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.

struct libtmux-rs latest

WindowTree

One window and its panes, from Server::hierarchy().

Source and package
Qualified name
libtmux::server::discovery::WindowTree
Module
server.discovery
Package
libtmux
Source
crates/libtmux/src/server/discovery.rs
struct server.discovery.WindowTree

Examples#

use libtmux::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?;
let tree = guard.server().hierarchy().await?;
let panes: usize = tree
.iter()
.flat_map(|branch| branch.windows.iter())
.map(|branch| branch.panes.len())
.sum();
assert_eq!(panes, 2);
guard.shutdown().await?;

Fields2#

WindowTree fields
NameTypeDescription
panes Vec<Pane> Its panes, in tmux's order.
window Window The window, carrying the link it was reached through.
Esc

Type to search.

Reference previewOpen reference