# session.Session.set_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#L88
- **Page:** https://libtmux.org/en/rs/latest/reference/session-session-set_option/

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

Set one option to text, unchecked.

The value is marked sensitive, so it never reaches `Debug`, an error,
or a tracing span. tmux validates it; [`Self::set_typed_option`]
checks it against tmux's option table first.

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