# window.Window.set_typed_option

- **Module:** window.Window
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/window/settings.rs#L125
- **Page:** https://libtmux.org/en/rs/latest/reference/window-window-set_typed_option/

```
window.Window.set_typed_option(self, name: &str, value: impl Into<OptionValue>) -> Result<(), Error>
```

Set one option to a typed value, checked before it is sent.

The value must be the variant [`Self::typed_option`] reads back for
the option; [`OptionValue`] gives the rules, and the two writes it
cannot check. The value is marked sensitive, as in
[`Self::set_option`].

# Errors

Returns [`crate::Error::OptionValueRefused`] without sending anything
when tmux's option table refuses the value.

Returns [`crate::Error::OptionScopeMismatch`] when tmux keeps the
option in another of its tables, and an error when tmux rejects the
name or value.

## Example

```rust
window.set_typed_option("synchronize-panes", true).await?;
window.set_typed_option("main-pane-width", "50%").await?;
```
