# LibTmux.Option.get/4

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/ce52194a746ce1d6785c352a731cff734e0d11ce/lib/libtmux/option.ex#L47
- **Page:** https://libtmux.org/en/elixir/latest/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 `:option_changed`. The
[one-shot read hook rules](LibTmux.Server.html#module-one-shot-read-hooks)
apply to [`after-show-options`](/en/tmux/latest/catalog/hooks/after-show-options/).

## Parameters

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