# session.settings.Session.set_option

- **Module:** session.settings.Session
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/session/settings.rs#L97
- **Page:** https://libtmux.org/reference/rs/session-settings-session-set_option/

```
session.settings.Session.set_option(self, name: &str, value: impl Into<OsString>) -> Result<(), Error>
```

Set one option.

The value is marked sensitive, so it never reaches `Debug`, an error,
or a tracing span.

# Errors

Returns an error when tmux rejects the name or value.

Returns [`crate::Error::OptionScopeMismatch`] when tmux keeps the
option in another of its tables.
