# LibTmux.Option.get/4

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/5bacf40788b43a5af27bb3656e727a921ba2db40/lib/libtmux/option.ex#L43
- **Page:** https://libtmux.org/en/elixir/pr-173/reference/libtmux-option-get-4/

```
get(server, target, key, options \\ [])
@spec get(LibTmux.Server.t(), target(), key(), [
        get_option()
      ]) ::
        {:ok, :unset | {:value, binary()}}
        | {:error, LibTmux.Error.t()}
```

Reads one printed tmux value or returns `:unset`.

The default `:local` reads only the chosen scope. `:effective` may use a
parent value. `:inherited` reads the parent directly, even if the chosen
scope has a local value. A server or global option set has no parent.
An empty configured string is returned as `{:value, ""}`.

The value has tmux's [`show-options -v`](/en/tmux/latest/manual/show-options/) representation. tmux 3.4 escapes
some bytes, including variable-shaped dollars, in this output.
An empty indexed response needs a second read to distinguish an absent entry.
Conflicting observations return an option_changed error.

## Parameters

- `server` (`LibTmux.Server.t()`)
- `target` (`target()`)
- `key` (`key()`)
- `options` (`[get_option()]`)
  Default: `[]`.
