# pane.Pane.setOption

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

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

Set an option on this pane.

## Examples

```ts
await pane.setOption("remain-on-exit", "on");
```

## 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)

## Guides

Pages that discuss `setOption`.

- [Options and hooks](/en/ts/latest/topics/options-and-hooks/)

## In other ports

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

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