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

Rust API

Rust documentation

View as Markdown

Module
server
Declared in
Server
Package
libtmux
Source
crates/libtmux/src/server/settings.rs
Other languages
PythonTypeScriptGoJava.NETC++Swift
options ( self ) → Result<BTreeMap<String, OptionValue>, Error>
method [source]
method [source]
options

Read every option set at this server, 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_names when only the names are wanted, and Self::typed_option for one value.

An array option keeps the indexed name tmux lists it under, so command-alias[0] and command-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.

In other ports Read the options set on the server

Examples

let guard = libtmux::test::TestServer::new().await?;
let server = guard.server();
server.set_option("buffer-limit", "42").await?;
let options = server.options().await?;
assert!(options.contains_key("buffer-limit"));
guard.shutdown().await?;
>>> options = server.show_options()
>>> isinstance(options, dict)
True
>>> 'buffer-limit' in options
True
const options = await server.showOptions();
options.get("escape-time");

0 declared, 0 inherited

Esc

Type to search.