# window.Window.setOption

- **Module:** window
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/window.ts#L258
- **Page:** https://libtmux.org/en/ts/latest/reference/window-window-setoption/

```
setOption(
  name: string,
  value: string,
  options?: SetOptionOptions,
): Promise<void>
```

Set an option on this window.

## Examples

```ts
await window.setOption("automatic-rename", "off");
```

## Parameters

- `name` (`string`)
- `value` (`string`)
- `options?` (`SetOptionOptions`)

## tmux command

The tmux commands behind `setOption`.

- [`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 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) |
| 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) |

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