# LibTmux::Server::set_option

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

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

`set_option(name => string, value => string|integer, scope => session|window|pane|server, target => id?, global => boolean?)`.

Set an option at explicit session/window/pane/server scope. Supply an exact target ID for local settings or global => true for the global level. Empty and zero values are preserved. [`"get_option"`](/en/perl/latest/reference/libtmux-server-get_option/) controls whether inherited values participate.

Returns `undef` after command acceptance. Performs I/O; failures propagate through [`LibTmux::X`](/en/perl/latest/reference/libtmux-x/). Captured objects are not modified.


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

## Methods

## Parameters

- `args`

## tmux command

The tmux commands behind `set_option`.

- [`set-option`](/en/tmux/latest/manual/set-option/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_set_option_entry`](/en/tmux/latest/reference/c-variable-cmd_set_option_entry/) (attribute)
- [`cmd_set_option_exec`](/en/tmux/latest/reference/c-function-cmd-set-option-c-cmd_set_option_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

Set a server option

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Server.set_option`](/en/py/latest/reference/libtmux-server-set_option/) (method) |
| Lua | [`libtmux.Server:set_option`](/en/lua/latest/reference/libtmux-server-set_option/) (method) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`server.Server.setOption`](/en/ts/latest/reference/server-server-setoption/) (method) |
| Rust | [`server.Server.set_option`](/en/rs/latest/reference/server-server-set_option/) (method) |
| Go | [`tmux.Server.SetOption`](/en/go/latest/reference/tmux-server-setoption/) (method) |
| Java | reached through `Server.options`, whose `Options` carries the write |
| C# | reached through `Server.Options`, whose `TmuxOptions` carries the write |
| C++ | [`libtmux::Server::set_server_option`](/en/cxx/latest/reference/libtmux-server-set_server_option/) (method) |
| Swift | [`Server.setOption(_:to:scope:)`](/en/swift/latest/reference/server-setoption(_-to-scope-)/) (method) |
| OCaml | [`Libtmux_unix.Client.set_option`](/en/ocaml/latest/reference/libtmux_unix-client-set_option/) (function) |

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

Set a session option

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Session.set_option`](/en/py/latest/reference/libtmux-session-set_option/) (method) |
| Lua | [`libtmux.Session:set_option`](/en/lua/latest/reference/libtmux-session-set_option/) (method) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`session.Session.setOption`](/en/ts/latest/reference/session-session-setoption/) (method) |
| Rust | [`session.Session.set_option`](/en/rs/latest/reference/session-session-set_option/) (method) |
| Go | [`tmux.Session.SetOption`](/en/go/latest/reference/tmux-session-setoption/) (method) |
| Java | reached through `Session.options`, whose `Options` carries the write |
| C# | reached through `Session.Options`, whose `TmuxOptions` carries the write |
| C++ | [`libtmux::Session::set_option`](/en/cxx/latest/reference/libtmux-session-set_option/) (method) |
| Swift | [`Server.setOption(_:to:scope:)`](/en/swift/latest/reference/server-setoption(_-to-scope-)/) (method) |
| OCaml | [`Libtmux_unix.Client.set_option`](/en/ocaml/latest/reference/libtmux_unix-client-set_option/) (function) |

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

Set a window option

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Window.set_option`](/en/py/latest/reference/libtmux-window-set_option/) (method) |
| Lua | [`libtmux.Window:set_option`](/en/lua/latest/reference/libtmux-window-set_option/) (method) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`window.Window.setOption`](/en/ts/latest/reference/window-window-setoption/) (method) |
| Rust | [`window.Window.set_option`](/en/rs/latest/reference/window-window-set_option/) (method) |
| Go | [`tmux.Window.SetOption`](/en/go/latest/reference/tmux-window-setoption/) (method) |
| Java | reached through `Window.options`, whose `Options` carries the write |
| C# | reached through `Window.Options`, whose `TmuxOptions` carries the write |
| C++ | [`libtmux::Window::set_option`](/en/cxx/latest/reference/libtmux-window-set_option/) (method) |
| Swift | [`Server.setOption(_:to:scope:)`](/en/swift/latest/reference/server-setoption(_-to-scope-)/) (method) |
| OCaml | [`Libtmux_unix.Client.set_option`](/en/ocaml/latest/reference/libtmux_unix-client-set_option/) (function) |

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

Set a pane option

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Pane.set_option`](/en/py/latest/reference/libtmux-pane-set_option/) (method) |
| Lua | [`libtmux.Pane:set_option`](/en/lua/latest/reference/libtmux-pane-set_option/) (method) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`pane.Pane.setOption`](/en/ts/latest/reference/pane-pane-setoption/) (method) |
| Rust | [`pane.Pane.set_option`](/en/rs/latest/reference/pane-pane-set_option/) (method) |
| Go | [`tmux.Pane.SetOption`](/en/go/latest/reference/tmux-pane-setoption/) (method) |
| Java | reached through `Pane.options`, whose `Options` carries the write |
| C# | reached through `Pane.Options`, whose `TmuxOptions` carries the write |
| C++ | [`libtmux::Pane::set_option`](/en/cxx/latest/reference/libtmux-pane-set_option/) (method) |
| Swift | [`Server.setOption(_:to:scope:)`](/en/swift/latest/reference/server-setoption(_-to-scope-)/) (method) |
| OCaml | [`Libtmux_unix.Client.set_option`](/en/ocaml/latest/reference/libtmux_unix-client-set_option/) (function) |

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

Set a default every session inherits

| Language | Equivalent |
| --- | --- |
| Python | no equivalent on `Server` |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`server.Server.setGlobalOption`](/en/ts/latest/reference/server-server-setglobaloption/) (method) |
| Rust | [`server.Server.set_global_option`](/en/rs/latest/reference/server-server-set_global_option/) (method) |
| Go | no equivalent on `Server` |
| Java | no equivalent on `Server` |
| C# | no equivalent on `Server` |
| C++ | [`libtmux::Server::set_global_option`](/en/cxx/latest/reference/libtmux-server-set_global_option/) (method) |
| Swift | no equivalent on `Server` |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |

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