Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

enum libtmux-rs latest

OptionScope

Which table an option primarily lives in.

Source and package
Qualified name
libtmux::options::OptionScope
Module
options
Package
libtmux
Source
crates/libtmux/src/options.rs
enum options.OptionScope

Examples#

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]);

Variants4#

OptionScope variants
CasePayloadDescription
Pane No payload Pane options, read with tmux's -p.
Server No payload Server options, read with tmux's -s.
Session No payload Session options.
Window No payload Window options, read with tmux's -w.
Esc

Type to search.

Reference previewOpen reference