# LibTmux.get_option

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Julia
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/configuration.jl#L232
- **Page:** https://libtmux.org/en/julia/latest/reference/libtmux-get_option/

```
get_option(
    connection::LibTmux.ControlConnection,
    scope,
    name::AbstractString;
    index,
    inherit,
    kwargs...
)

get_option(
    server::LibTmux.Server,
    scope,
    name::AbstractString;
    index,
    inherit,
    kwargs...
)
```

## Methods

### `get_option` (overload 1)

```julia
get_option(
    connection::LibTmux.ControlConnection,
    scope,
    name::AbstractString;
    index,
    inherit,
    kwargs...
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/control_options.jl#L162).

Read an exact option through named, escaped replies on the pinned daemon. Scope and returned strings follow `get_option(server, ...)`. Missing values return `nothing`; empty strings and explicitly empty arrays mask inheritance. Array reads require `index` and inspect complete local membership before any parent lookup, so a missing sparse entry is never mistaken for an empty value.

```julia
get_option(connection::ControlConnection, scope, name; index=nothing, inherit=false, kwargs...)
```



Built-in names and scopes use pinned release metadata; the named command still checks runtime availability. Seven names whose metadata changed require an encoded version observation. Ambiguous unknown version profiles are refused. Unrestricted string values are decoded as literal VIS data, never evaluated. These observations are not atomic, and no subprocess fallback occurs.

### `get_option` (overload 2)

```julia
get_option(
    server::LibTmux.Server,
    scope,
    name::AbstractString;
    index,
    inherit,
    kwargs...
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/configuration.jl#L247).

Read one scalar or indexed value as a string. `nothing` means no value in the requested scope; `""` is an explicit empty value. `inherit=true` follows tmux's parent options. Arrays require a numeric `index`; missing sparse entries return `nothing`. String options preserve literal control bytes and backslashes. Use `get_hook` to read an entire command array.

```julia
get_option(server, scope, name; index=nothing, inherit=false, kwargs...)
```



Scopes are `:server`, `:global_session`, `:global_window`, `SessionRef`, `WindowRef` and `PaneRef`. Names are exact built-in names or user names matching `@[A-Za-z0-9_.-]+`; abbreviations are rejected. Reads use explicit subprocess I/O and may span several observations, not a transaction. Deadline, cancellation and best-effort identity checks follow `new_session`.

## Parameters

- `connection` (`LibTmux.ControlConnection`) (for `get_option(connection, scope, name, index, inherit, kwargs)`)
- `scope` (`Any`)
- `name` (`AbstractString`)
- `index`
  Default: `nothing`.
- `inherit` (`Bool`)
  Default: `false`.
- `kwargs`
- `server` (`LibTmux.Server`) (for `get_option(server, scope, name, index, inherit, kwargs)`)
