# server.Server.setGlobalOption

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

```
setGlobalOption(
  scope: "session" | "window",
  name: string,
  value: string,
  options?: SetOptionOptions,
): Promise<void>
```

Set a default every session or window inherits.

## Examples

```ts
await server.setGlobalOption("session", "history-limit", "50000");
```

## Parameters

- `scope` (`"session" | "window"`)
- `name` (`string`)
- `value` (`string`)
- `options?` (`SetOptionOptions`)

## tmux command

The tmux commands behind `setGlobalOption`.

- [`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 default every session inherits

| Language | Equivalent |
| --- | --- |
| Python | no equivalent on `Server` |
| 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` |

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