# LibTmux::Server::get_option

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Perl
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-perl/blob/352715a4fa66a96eed7763b90daaa536aa2f121d/packages/core/lib/LibTmux/Server.pm#L1087
- **Page:** https://libtmux.org/en/perl/latest/reference/libtmux-server-get_option/

```
sub get_option($self, %args)
```

`get_option(name => string, scope => scope, target => id?, global => boolean?, inherited => boolean?)`.

Read an option and return its octets, decoding tmux's quoted string values. Literal backslashes and non-UTF-8 bytes remain distinct on older daemons. Key, numeric and command options retain native printed syntax. Array values are joined with newlines in native index order; an empty array returns `''`. Empty text and '0' remain values. `inherited => true` requests tmux's `-A` behavior; otherwise only the selected local level is queried. Performs I/O without mutation. Native missing-option errors throw [`"Command" in LibTmux::X`](/en/perl/latest/reference/libtmux-x-command/); malformed output throws [`"Codec" in LibTmux::X`](/en/perl/latest/reference/libtmux-x-codec/). A built-in option without a local override may produce empty output. See [`"set_option"`](/en/perl/latest/reference/libtmux-server-set_option/) and [`"unset_option"`](/en/perl/latest/reference/libtmux-server-unset_option/).


```perl
    my $value = $server->get_option(scope => 'window', target => $window->id, name => '@build');
```

## Methods

## Parameters

- `args`

## tmux command

The tmux commands behind `get_option`.

- [`show-options`](/en/tmux/latest/manual/show-options/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_show_options_entry`](/en/tmux/latest/reference/c-variable-cmd_show_options_entry/) (attribute)
- [`cmd_show_options_exec`](/en/tmux/latest/reference/c-function-cmd-show-options-c-cmd_show_options_exec/) (function)

## tmux options

Settings for the server, sessions, windows and panes, with their types, defaults and allowed values.

- [Options](/en/tmux/latest/catalog/options/) (option)

## In other ports

Read one server option

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Server.show_option`](/en/py/latest/reference/libtmux-server-show_option/) (method) |
| Lua | [`libtmux.Server:get_option`](/en/lua/latest/reference/libtmux-server-get_option/) (method) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | no single-option read; `Server.showOptions` returns them all |
| Rust | [`server.Server.typed_option`](/en/rs/latest/reference/server-server-typed_option/) (method) |
| Go | [`tmux.Server.RawOption`](/en/go/latest/reference/tmux-server-rawoption/) (method) |
| Java | reached through `Server.options`, whose `Options.get` reads one |
| C# | reached through `Server.Options`, whose `TmuxOptions.GetAsync` reads one |
| C++ | no single-option read; `Server::options` returns them all |
| Swift | [`Server.option(_:scope:)`](/en/swift/latest/reference/server-option(_-scope-)/) (method) |
| OCaml | [`Libtmux_unix.Client.read_option`](/en/ocaml/latest/reference/libtmux_unix-client-read_option/) (function). Pass the corresponding explicit Options scope; captured tables preserve their source and inheritance policy. |

No equivalent is recorded in Ruby, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Read one session option

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Session.show_option`](/en/py/latest/reference/libtmux-session-show_option/) (method) |
| Lua | [`libtmux.Session:get_option`](/en/lua/latest/reference/libtmux-session-get_option/) (method) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | no single-option read; `Session.showOptions` returns them all |
| Rust | [`session.Session.typed_option`](/en/rs/latest/reference/session-session-typed_option/) (method) |
| Go | [`tmux.Session.RawOption`](/en/go/latest/reference/tmux-session-rawoption/) (method) |
| Java | reached through `Session.options`, whose `Options.get` reads one |
| C# | reached through `Session.Options`, whose `TmuxOptions.GetAsync` reads one |
| C++ | [`libtmux::Session::option`](/en/cxx/latest/reference/libtmux-session-option/) (method) |
| Swift | [`Server.option(_:scope:)`](/en/swift/latest/reference/server-option(_-scope-)/) (method) |
| OCaml | [`Libtmux_unix.Client.read_option`](/en/ocaml/latest/reference/libtmux_unix-client-read_option/) (function). Pass the corresponding explicit Options scope; captured tables preserve their source and inheritance policy. |

No equivalent is recorded in Ruby, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Read one window option

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Window.show_option`](/en/py/latest/reference/libtmux-window-show_option/) (method) |
| Lua | [`libtmux.Window:get_option`](/en/lua/latest/reference/libtmux-window-get_option/) (method) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | no single-option read; `Window.showOptions` returns them all |
| Rust | [`window.Window.typed_option`](/en/rs/latest/reference/window-window-typed_option/) (method) |
| Go | [`tmux.Window.RawOption`](/en/go/latest/reference/tmux-window-rawoption/) (method) |
| Java | reached through `Window.options`, whose `Options.get` reads one |
| C# | reached through `Window.Options`, whose `TmuxOptions.GetAsync` reads one |
| C++ | [`libtmux::Window::option`](/en/cxx/latest/reference/libtmux-window-option/) (method) |
| Swift | [`Server.option(_:scope:)`](/en/swift/latest/reference/server-option(_-scope-)/) (method) |
| OCaml | [`Libtmux_unix.Client.read_option`](/en/ocaml/latest/reference/libtmux_unix-client-read_option/) (function). Pass the corresponding explicit Options scope; captured tables preserve their source and inheritance policy. |

No equivalent is recorded in Ruby, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Read one pane option

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Pane.show_option`](/en/py/latest/reference/libtmux-pane-show_option/) (method) |
| Lua | [`libtmux.Pane:get_option`](/en/lua/latest/reference/libtmux-pane-get_option/) (method) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | no single-option read; `Pane.showOptions` returns them all |
| Rust | [`pane.Pane.typed_option`](/en/rs/latest/reference/pane-pane-typed_option/) (method) |
| Go | [`tmux.Pane.RawOption`](/en/go/latest/reference/tmux-pane-rawoption/) (method) |
| Java | reached through `Pane.options`, whose `Options.get` reads one |
| C# | reached through `Pane.Options`, whose `TmuxOptions.GetAsync` reads one |
| C++ | [`libtmux::Pane::option`](/en/cxx/latest/reference/libtmux-pane-option/) (method) |
| Swift | [`Server.option(_:scope:)`](/en/swift/latest/reference/server-option(_-scope-)/) (method) |
| OCaml | [`Libtmux_unix.Client.read_option`](/en/ocaml/latest/reference/libtmux_unix-client-read_option/) (function). Pass the corresponding explicit Options scope; captured tables preserve their source and inheritance policy. |

No equivalent is recorded in Ruby, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.
