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

Client.is_own

Report whether this process opened this client itself.

Source and package
Qualified name
libtmux::client::Client::is_own
Module
client
Declared in
Client
Package
libtmux
Source
crates/libtmux/src/client.rs
#[cfg(feature = "control-mode")] #[must_use] pub fn is_own(&self) -> bool

Description#

tmux counts a control connection as an attached client, and this crate opens them: crate::Pane::stream_output(), crate::control::ControlMode::attach() and the waits built on them all show up in a client listing beside a human's terminal. A caller asking "is anybody watching this session" means anybody else, so this is the question to ask before counting.

false for every client once this process ends, since the answer is about connections this Server is still holding open.

Examples#

let others = server
.clients()
.await?
.into_iter()
.filter(|client| !client.is_own())
.count();
Esc

Type to search.

Reference previewOpen reference