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

View as Markdown

Module
session
Declared in
Session
Package
libtmux
Source
crates/libtmux/src/session.rs
Other languages
PythonTypeScriptGoJava.NETC++Swift
detach_clients ( self ) → Result<(), Error>
method [source]
method [source]
detach_clients

Detach every client attached to this session.

Succeeds when no client was attached. tmux reports that as a failure, but the state this asks for -- nobody attached to this session -- is already true, and a caller that has to tell "detached them" from "there was nobody" can compare crate::Server::clients before and after.

Errors

Returns an error when tmux cannot be reached or refuses the detach for any other reason.

In other ports Detach every client attached to a session

Examples

let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("busy").await?;
// Nothing is attached in a headless fixture, so this is a no-op.
session.detach_clients().await?;
guard.shutdown().await?;
>>> with control_mode() as ctl:
... session.detach_client()
await session.detach();

0 declared, 0 inherited

Esc

Type to search.