# session.Session.typed_option

- **Module:** session.Session
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/session/settings.rs#L561
- **Page:** https://libtmux.org/en/rs/latest/reference/session-session-typed_option/

```
session.Session.typed_option(self, name: &str) -> Result<Option<OptionValue>, Error>
```

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

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.
