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.falsefor every client once this process ends, since the answer is about connections thisServeris still holding open.Examples#
let others = server.clients().await?.into_iter().filter(|client| !client.is_own()).count();