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

Session.hook

Read one hook's commands, or None when it holds nothing.

Source and package
Qualified name
libtmux::session::Session::hook
Module
session
Declared in
Session
Package
libtmux
Source
crates/libtmux/src/session/settings.rs
pub async fn hook(&self, name: &str) -> Result< Option<IndexedHooks>, Error >

Description#

Errors

Returns an error when tmux cannot be reached or refuses the listing.

Examples#

let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("hooked").await?;
assert!(session.hook("alert-bell").await?.is_none());
session.set_hook("alert-bell", "display-message rang").await?;
assert!(session.hook("alert-bell").await?.is_some());
guard.shutdown().await?;
Parameters
Esc

Type to search.

Reference previewOpen reference