# options.OptionScope

- **Module:** options
- **Package:** libtmux
- **Language:** Rust
- **Kind:** enum
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/options.rs#L71
- **Page:** https://libtmux.org/en/rs/latest/reference/options-optionscope/

Which table an option primarily lives in.

## Example

```rust
use libtmux::{OptionScope, option_schema};

// The scope says which handle can set an option, which is not guessable
// from the name: `mouse` is per-session, and `exit-empty` is server-wide.
assert!(option_schema("mouse").is_some_and(|o| o.accepts(OptionScope::Session)));
assert!(option_schema("exit-empty").is_some_and(|o| o.accepts(OptionScope::Server)));

// Some options live in two tables at once, and tmux takes a write at
// either. Asking for one scope would have to pick, and picking is wrong.
let remain = option_schema("remain-on-exit").expect("a documented option");
assert_eq!(remain.scopes(), [OptionScope::Window, OptionScope::Pane]);
```

## Members

- `Server` (constant): Server options, read with tmux's `-s`.
- `Session` (constant): Session options.
- `Window` (constant): Window options, read with tmux's `-w`.
- `Pane` (constant): Pane options, read with tmux's `-p`.
