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.typed_option

Read one option, decoded according to what tmux declares about it.

Source and package
Qualified name
libtmux::session::Session::typed_option
Module
session
Declared in
Session
Package
libtmux
Source
crates/libtmux/src/session/settings.rs
Other languages
Perlmethod Erlang PowerShell Julia Elixir Haskell Common Lisp Python Ruby Lua TypeScript Go Java C# C++Swift Kotlin Scala OCamlfunction F# Clojure
pub async fn typed_option(&self, name: &str) -> Result< Option<OptionValue>, Error >

Description#

A flag comes back as OptionValue::Flag and a number as OptionValue::Number, so a caller does not decide for itself that on means one. Everything else, including user options, stays text. The one way to read a single option; OptionValue says how reads and writes fit together.

None means the option holds nothing at this session. A user option, whose name begins with @, exists only while it is set, and a built-in one always exists, so both report an unset option as None.

Errors

Returns an error when tmux does not recognize the option name.

Parameters

tmux options#

Settings for the server, sessions, windows and panes, with their types, defaults and allowed values.

In other ports#

Read one session option

Equivalents of Read one session option in other languages
Language Equivalent
Python libtmux.Session.show_option
Lua libtmux.Session:get_option
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript no single-option read; Session.showOptions returns them all
Go tmux.Session.RawOption
Java reached through Session.options, whose Options.get reads one
C# reached through Session.Options, whose TmuxOptions.GetAsync reads one
C++ libtmux::Session::option
Swift Server.option(_:scope:)
OCaml Libtmux_unix.Client.read_option Pass the corresponding explicit Options scope; captured tables preserve their source and inheritance policy.
Perl LibTmux::Server::get_option Pass scope => 'session' and the explicit target ID where applicable; inherited and global reads are deliberate options.

No equivalent is recorded in Ruby, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Esc

Type to search.

Reference previewOpen reference