Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Rust API

Rust documentation

server.Server.owns_control_client

Rust
  • Python Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
server
Declared in
Server
Package
libtmux
Source
crates/libtmux/src/server.rs
owns_control_client ( self , pid : u32 ) → bool
method [source]
method [source]
owns_control_client

Report whether this process itself opened the control client with this pid, and it is still running.

crate::Client::is_own is the usual form, and reads better: ask a handle from Self::clients rather than doing pid arithmetic. This one is for a caller that already has a pid and no handle -- reading list-clients itself to get sessions and pids in one command, which a per-client lookup would turn into one command each.

crate::Pane::stream_output , crate::Client::pid and friends can all open or report a control-mode connection; tmux counts any of them as an attached client the same as a human's terminal. A caller telling its own observation apart from an attached human reads every crate::Client::pid it cares about through this rather than tracking one connection it happened to keep, because more than one may be open at once.

Examples

let guard = libtmux::test::TestServer::new().await?;
let server = guard.server();
// Nothing has opened a control client yet.
assert!(!server.owns_control_client(std::process::id()));
guard.shutdown().await?;

0 declared, 0 inherited

Esc

Type to search.