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

SessionTree

One session and everything under it, from Server::hierarchy().

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

Examples#

let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("work").await?;
session.new_window("editor").await?;
// One round of listings for the whole hierarchy, rather than one call per
// session and another per window.
let tree = guard.server().hierarchy().await?;
let found = tree
.iter()
.find(|branch| branch.session.name().to_string_lossy() == "work")
.expect("the session just created");
assert_eq!(found.windows.len(), 2);
guard.shutdown().await?;

Fields2#

SessionTree fields
NameTypeDescription
windows Vec<WindowTree> Its windows, in tmux's order. A window linked into several sessions appears under each of them, as the listings report it.
session Session The session.
Esc

Type to search.

Reference previewOpen reference