# libtmux.Session:set_option

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Lua
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/lua/libtmux/_internal/entity.lua#L401
- **Inherited from:** libtmux.Configurable
- **Page:** https://libtmux.org/en/lua/v0.1.1/reference/libtmux-session-set_option/

```
set_option: fun(
  self: libtmux.Configurable<libtmux.SnapshotSession>,
  name: string,
  value: boolean|string|number|libtmux.HookProgram|libtmux.OptionArrayInput,
  options?: libtmux.SettingSetOptions,
):libtmux.Request<boolean>
```

## Parameters

- `name` (`string`)
- `value` (`boolean|string|number|libtmux.HookProgram|libtmux.OptionArrayInput`)
- `options` (`libtmux.SettingSetOptions?`)

## 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 session option

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Session.set_option`](/en/py/latest/reference/libtmux-session-set_option/) (method) |
| 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) |

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