Module tmux_interface::options

source ·
Expand description

Command builders and output parsers

§Table Of Contents

    1. Quick Start
    1. Developer Information
    • 2.1. Tmux Manual
    • 2.2. Structure
    • 2.3. Implementation
    • 2.4. Modules Hierarchy

§1. Quick Start

§Examples

§2. Developer Information

§2.1. Tmux Manual

Get command

show-options [-AgHpqsvw] [-t target-pane] [option]
(alias: show)
Show the pane options (or a single option if option is
provided) with -p, the window options with -w, the server
options with -s, otherwise the session options.  If the
option is not a user option, -w or -s may be unnecessary -
tmux will infer the type from the option name, assuming -w
for pane options.  Global session or window options are
listed if -g is used.  -v shows only the option value, not
the name.  If -q is set, no error will be returned if
option is unset.  -H includes hooks (omitted by default).
-A includes options inherited from a parent set of options,
such options are marked with an asterisk.

Set command

set-option [-aFgopqsuUw] [-t target-pane] option value
      (alias: set)
Set a pane option with -p, a window option with -w, a
server option with -s, otherwise a session option.  If the
option is not a user option, -w or -s may be unnecessary -
tmux will infer the type from the option name, assuming -w
for pane options.  If -g is given, the global session or
window option is set.

-F expands formats in the option value.  The -u flag unsets
an option, so a session inherits the option from the global
options (or with -g, restores a global option to the
default).  -U unsets an option (like -u) but if the option
is a pane option also unsets the option on any panes in the
window.  value depends on the option and may be a number, a
string, or a flag (on, off, or omitted to toggle).

The -o flag prevents setting an option that is already set
and the -q flag suppresses errors about unknown or
ambiguous options.

With -a, and if the option expects a string or a style,
value is appended to the existing setting.  For example:

      set -g status-left "foo"
      set -ag status-left "bar"

Will result in ‘foobar’.  And:

      set -g status-style "bg=red"
      set -ag status-style "fg=blue"

Will result in a red background and blue foreground.
Without -a, the result would be the default background and
a blue foreground.

§2.2. Structure

Briefly, abstractions for working procedures with Tmux options can be done using following principles:

  • by Scope (-g flag)

    • Global (-g flag)
    • Local (`` flag omitted)
  • by access type ([option] parameter)

    • All ([option] parameter omitted)
    • Value only (-v flag)
    • Single ([option] parameter)
    • Multiple Selective (multiple show-options, set-option commands)
  • by object type (-s, , -w, -p flags)

  • by modifiying methods ([value] parameter and -u flag)

    • Set ([value] parameter is set)
    • Unset (-u flag)
    • Toggle (for on | off | ... options) ([value] parameter omitted)

Table: Tmux Options

Tmux Options Scope
Global (`show/set -g`) Local
ServerOptions x (`show/set -s`)
SessionOptions x (`show/set -g`) x (`show/set`)
WindowOptions x (`show/set -wg`) x (`show/set -w`)
PaneOptions x (`show/set -p`)

§2.3. XXX

XXX: examples

§2.3. Control

§2.3. Implementation

implementations derived using previous prinnciples

§2.4. Modules Hierarchy

Options submodules, traits and structures schematic hierarchy

Get/Set options control traits
                          Global
                          +-------------------------+     +------------------------+
                          | GlobalSessionOptionsCtl |     | GlobalWindowOptionsCtl |
                          +-------------------------+     +------------------------+
                            * .get_<OPTION>()               ...
                            * .set_<OPTION>()
                            * ...
                            * .get_all()
                            * .set_all()
                          Local
                          +------------------------+      +-----------------------+
                          | LocalSessionOptionsCtl |      | LocalWindowOptionsCtl |
                          +------------------------+      +-----------------------+
                           ...                             ...

 +------------------+     +-------------------+           +------------------+          +----------------+
 | ServerOptionsCtl |     | SessionOptionsCtl |           | WindowOptionsCtl |          | PaneOptionsCtl |
 +------------------+     +-------------------+           +------------------+          +----------------+
  ...                      ...                             ...                           ...

Get/Set options command builder traits (by target, by scope, by access)

                          Global
                           single option
                          +------------------------+      +-----------------------+
                          | GetGlobalSessionOption |      | GetGlobalWindowOption |
                          +------------------------+      +-----------------------+
                           ...                             ...
                           single value only
                          +-----------------------------+ +----------------------------+
                          | GetGlobalSessionOptionValue | | GetGlobalWindowOptionValue |
                          +-----------------------------+ +----------------------------+
                           ...                             ...
                           multiple options
                          +-------------------------+     +------------------------+
                          | GetGlobalSessionOptions |     | GetGlobalWindowOptions |
                          +-------------------------+     +------------------------+
                           ...                             ...
                           single option
                          +------------------------+      +-----------------------+
                          | SetGlobalSessionOption |      | SetGlobalWindowOption |
                          +------------------------+      +-----------------------+
                           ...                             ...
                           multiple options
                          +-------------------------+     +------------------------+
                          | SetGlobalSessionOptions |     | SetGlobalWindowOptions |
                          +-------------------------+     +------------------------+
                           ...                             ...
 Local
  single option
 +----------------+       +-----------------------+       +----------------------+       +---------------+
 | GetServerOpton |       | GetLocalSessionOption |       | GetLocalWindowOption |       | GetPaneOption |
 +----------------+       +-----------------------+       +----------------------+       +---------------+
  ...                      ...                             ...                            ...
  single value only
 +---------------------+  +----------------------------+  +---------------------------+  +--------------------+
 | GetServerOptonValue |  | GetLocalSessionOptionValue |  | GetLocalWindowOptionValue |  | GetPaneOptionValue |
 +---------------------+  +----------------------------+  +---------------------------+  +--------------------+
  ...                      ...                             ...                            ...
  multiple options
 +-----------------+      +------------------------+      +-----------------------+      +----------------+
 | GetServerOptons |      | GetLocalSessionOptions |      | GetLocalWindowOptions |      | GetPaneOptions |
 +-----------------+      +------------------------+      +-----------------------+      +----------------+
  ...                      ...                             ...                            ...
  single option
 +----------------+       +-----------------------+       +----------------------+       +---------------+
 | SetServerOpton |       | SetLocalSessionOption |       | SetLocalWindowOption |       | SetPaneOption |
 +----------------+       +-----------------------+       +----------------------+       +---------------+
  ...                      ...                             ...                            ...
  multiple options
 +-----------------+      +------------------------+      +-----------------------+      +----------------+
 | SetServerOptons |      | SetLocalSessionOptions |      | SetLocalWindowOptions |      | SetPaneOptions |
 +-----------------+      +------------------------+      +-----------------------+      +----------------+
  ...                      ...                             ...                            ...
Options Structures
 +---------------+        +----------------+              +---------------+              +-------------+
 | ServerOptions |        | SessionOptions |              | WindowOptions |              | PaneOptions |
 +---------------+        +----------------+              +---------------+              +-------------+
  ...                      ...                             ...                            ...
Get/Set user options command builder traits (custom get/set implementations for user options `@name value`)
 +---------------+            +---------------+
 | GetUserOption |            | SetUserOption |
 +---------------+            +---------------+
  ...                          ...
 +----------------+           +----------------+
 | GetUserOptions |           | SetUserOptions |
 +----------------+           +----------------+
  ...                          ...
Get/Set options command builder traits (custom get/set implementations for server/session/window/pane)
 +-------------+              +-------------+
 | GetOptionTr |              | SetOptionTr |
 +-------------+              +-------------+
  ...                          ...

Get/Set options commands builder structures (named methods for server/session/window/pane and other)
 +------------+               +-----------+
 | ShowOption |               | SetOption |
 +------------+               +-----------+
  ...                          ...

Tmux interface command structures (command, flags, options, parameters)
 +-------------+
 | TmuxCommand |
 +-------------+
  ...
 +--------------+
 | TmuxCommands |
 +--------------+
  ...
Tmux command (resulting command as `std::process::Command` or `String`)
 +--------------------------+ +---------------------------------+
 | `show [-FLAGS] <OPTION>` | | `set [-FLAGS] <OPTION> <VALUE>` |
 +--------------------------+ +---------------------------------+

Re-exports§

Modules§