On this page
session.settings.Session.options
- Module
- session.settings
- Declared in
- Session
- Package
- libtmux
- Source
- crates/libtmux/src/session/settings.rs
-
Read every option set at this session, decoded by its declared kind.
Costs one tmux command per option, because each value is read as the bytes tmux stored rather than the form it lists them in. Use
Self::option_nameswhen only the names are wanted, andSelf::typed_optionfor one value.An array option keeps the indexed name tmux lists it under, so
command-alias[0]andcommand-alias[1]are separate entries.Reports what is set *at this scope*, not what the object resolves to. A session that has set nothing of its own answers empty even though every option still has an effective value it inherits.
Errors
Returns an error when tmux cannot be reached or refuses the listing. An empty map means nothing is set, never that the listing failed.
Examples
let guard = libtmux::test::TestServer::new().await?; let session = guard.server().new_session("opts").await?; session.set_option("status-left-length", "30").await?; let options = session.options().await?; assert!(options.contains_key("status-left-length")); guard.shutdown().await?;
0 declared, 0 inherited