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

session.Session.hook

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

View as Markdown

Module
session
Declared in
Session
Package
libtmux
Source
crates/libtmux/src/session/settings.rs
hook ( self , name : &str ) → Result<Option<IndexedHooks>, Error>
method [source]
method [source]
hook

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

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?;

0 declared, 0 inherited

Esc

Type to search.