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.

MoreLess about this notice

method libtmux-rs

Client.lock

Lock this client's terminal.

Source and package
Qualified name
libtmux::client::Client::lock
Module
client
Declared in
Client
Package
libtmux
Source
crates/libtmux/src/client.rs
pub async fn lock(&self) -> Result<(), Error>
Completion
Returns a future that runs when awaited.signature · client.rs:430
Errors
Returns an error when tmux refuses the command. A later Self::refresh() can return Error::ClientSuspended or succeed, depending on whether that tmux release omits the locked client.doc comment · :427

Description

Runs the lock-command option, which is lock -np unless the server was told otherwise. crate::Session::lock() locks every client attached to one session and crate::Server::lock_all() locks every client on the server; this locks exactly one.

tmux marks a locked client with the flag it uses for a suspended one, so a locked client can leave crate::Server::clients() the same way and returns to normal when its lock-command exits. A server with lock-after-time set reaches that state with nobody asking.

Errors

Returns an error when tmux refuses the command. A later Self::refresh() can return Error::ClientSuspended or succeed, depending on whether that tmux release omits the locked client.

Recorded calls

source calls
No call edges in the Rust model.

The Rust reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls client.Client.lock.

tmux command

task material

The tmux commands behind lock.

tmux C API

task material

The C declarations in tmux that implement these commands.

Esc
Search in

Type to search.

Reference previewOpen reference