# io.github.libtmux.OptionKey.OptionKey

- **Module:** io.github.libtmux.OptionKey
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-java/blob/842228310449e879ebcaa3f910597757c9dbffd6/libtmux/src/main/java/io/github/libtmux/OptionKey.java#L27
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-optionkey-optionkey/

A tmux option and the Java type its value reads as.

Declared by the caller rather than catalogued here. tmux has hundreds of options, adds them
between releases and changes a few of their types, so a closed catalogue would be wrong somewhere
on every release it did not track. A key says how to read one option; the name-and-string methods
on {@link Options} remain for anything else.

The constants are the ones whose type is the same on every supported release, checked against
tmux's own option table from 3.2a to 3.7c. {@code status} is not among the flags for that reason:
tmux reads it as a choice of {@code off}, {@code on} and a line count.

## Example

```java
session.options().set(OptionKey.HISTORY_LIMIT, 50_000);
int kept = session.options().get(OptionKey.HISTORY_LIMIT).orElseThrow();   // → 50000

OptionKey<Boolean> bell = OptionKey.flag("visual-bell");
```

## Members

- `HISTORY_LIMIT` (attribute): Lines of scrollback a pane keeps. A session option.
- `BASE_INDEX` (attribute): The index a session's first window gets. A session option.
- `ESCAPE_TIME` (attribute): How long tmux waits after an escape to see whether a key sequence follows. A server option.
- `MOUSE` (attribute): Whether the mouse is captured. A session option.
- `AUTOMATIC_RENAME` (attribute): Whether a window renames itself after what its pane runs. A window option.
- `SYNCHRONIZE_PANES` (attribute): Whether keys typed into one pane go to every pane in the window. A window or pane option.
- `text` (method): An option read as the text tmux reports, which suits a string, a choice, a style or a colour.
- `number` (method): An option tmux holds as a number.
- `flag` (method): An option tmux holds as a flag, which it reports as {@code on} or {@code off}.
- `name` (method): The option's name, as tmux spells it.
- `read` (method)
- `write` (method)
- `toString` (method)
