# libtmux for Lua
> The Lua library (libtmux). These pages include its guides, tested examples and API documentation.
- [Lua API reference](https://libtmux.org/en/lua/v0.1.1/reference/): every public symbol, generated from the source. Hosted on libtmux.org.
---
# Concepts
Source: https://libtmux.org/en/lua/v0.1.1/concepts/
> Concepts for libtmux.
Understand captured queries, object identities, and operations.
---
# Server, session, window, pane
Source: https://libtmux.org/en/lua/v0.1.1/concepts/server-session-window-pane/
> How tmux servers, sessions, windows, panes and attached clients relate to each other.
libtmux models tmux's server, session, window, and pane objects:
```
Server
├── Session
│ └── Window
│ └── Pane
└── Client (attached view)
```
A `Server` contains sessions. Each `Session` contains links to windows, and each
`Window` contains panes. Commands run inside a `Pane`, where you send input and
capture output. A window can be linked to more than one session.
## Stable identity, not name or index
tmux assigns a unique ID to each session, window, and pane at creation. The ID
remains stable for that object's lifetime even if its name or index changes:
| Object | ID prefix | Example |
|--------|-----------|---------|
| Session | `$` | `$13` |
| Window | `@` | `@3243` |
| Pane | `%` | `%5433` |
| Server | - | identified by socket name or path instead |
Use stable IDs to identify the same tmux object across reads. Names and indexes
can change while a program is running.
## Client: a view, not a child
A `Client` represents a terminal attached to a session. Several clients can view
the same server, and each can switch sessions or windows independently. Client
fields describe the view at the time of the read.
A [control-mode connection](https://libtmux.org/en/lua/v0.1.1/concepts/transports/) is also a client. It appears in
[`list-clients`](https://libtmux.org/en/tmux/latest/manual/list-clients/), counts toward [`session_attached`](https://libtmux.org/en/tmux/latest/catalog/formats/session_attached/), and affects
attachment-dependent behavior such as [`destroy-unattached`](https://libtmux.org/en/tmux/latest/catalog/options/destroy-unattached/). Closing the last
attached client can therefore destroy a session configured with that option.
---
# Examples
Source: https://libtmux.org/en/lua/v0.1.1/examples/
> Examples for libtmux.
Run complete programs with their documented setup and cleanup.
- [Capture pane output](https://libtmux.org/en/lua/v0.1.1/examples/capture-pane-output/): Send a command, wait for its output, and clean up the private server.
---
# Capture pane output
Source: https://libtmux.org/en/lua/v0.1.1/examples/capture-pane-output/
> Run a complete Lua program that captures output on an isolated tmux server.
This complete Lua program starts a private tmux server, sends a command,
and captures the line it prints. It includes imports, setup, and cleanup.
You need tmux and a Unix environment; no existing session is required.
Save both files shown below. Run `sh run.sh` after the [setup](https://libtmux.org/en/lua/v0.1.1/examples/capture-pane-output/#setup-and-run);
the launcher creates the server and passes its socket to the Lua program.
## Read what's on screen
The leading newline puts the output on a fresh row. Matching the whole line
avoids mistaking the echoed command for its output.
```lua title="capture.lua"
local adapter = require("libtmux.runtime.luv")
local function must(value, err)
if err ~= nil then error(tostring(err), 0) end
return value
end
local function quote(text)
return "'" .. text:gsub("'", "'\\''") .. "'"
end
local socket = assert(arg[1], "pass the private socket path")
local binary = assert(arg[2], "pass the absolute tmux executable path")
must(adapter.run(function(runtime)
local server = must(runtime:connect({ binary = binary, socket_path = socket }):await())
local created = must(server:new_session({
name = "capture", argv = { "/bin/sh" },
}):await())
local pane = created.pane
local command = "printf '\\nlibtmux capture ready\\n'; "
.. quote(binary) .. " -S " .. quote(socket) .. " wait-for -S capture-ready"
must(pane:send_text(command):await())
must(pane:send_keys({ "Enter" }):await())
must(server:command({ "wait-for", "capture-ready" }, { timeout = 5000 }):await())
local capture = must(pane:capture({ history_lines = 20 }):await())
local found = false
for line in must(capture:text()):gmatch("[^\r\n]+") do
if line == "libtmux capture ready" then found = true end
end
assert(found, "The completed command did not produce the expected line")
print("libtmux capture ready")
must(server:close():await())
return true
end))
```
## Wait for output or completion
The pane prints its line, then signals a tmux [`wait-for`](https://libtmux.org/en/tmux/latest/manual/wait-for/) channel on the same private socket. The awaited command has a five-second deadline. Capture runs after that signal and checks the complete line. The launcher stops its server on success or failure; if stopping fails, it reports the error and keeps the socket directory.
Capture reads screen state and scrollback, so output that has scrolled away
may be absent. The program prints `libtmux capture ready` when its check passes
and exits unsuccessfully if an operation fails.
## Setup and run
Use an empty directory and save the files using the displayed names. You need
Lua 5.5, LuaRocks, a C compiler, and CMake. The commands install libtmux and its luv runtime adapter into a local rocks tree.
Save this launcher beside the Lua program.
```sh title="run.sh"
#!/bin/sh
set -eu
binary=$(command -v tmux)
case "$binary" in
/*) ;;
*) printf '%s\n' 'tmux must resolve to an absolute path' >&2; exit 1 ;;
esac
mkdir -p /tmp/libtmux-lua-dev
directory=$(mktemp -d /tmp/libtmux-lua-dev/capture.XXXXXX)
socket="$directory/tmux.sock"
cleanup() {
status=$?
trap - 0 HUP INT TERM
if [ -S "$socket" ]; then
if ! "$binary" -S "$socket" kill-server; then
printf 'Could not stop server; retained %s\n' "$directory" >&2
exit 1
fi
fi
rm -rf "$directory" || exit 1
exit "$status"
}
trap cleanup 0
trap 'exit 1' HUP INT TERM
export ENV=/dev/null
"$binary" -S "$socket" -f /dev/null new-session -d -s bootstrap /bin/cat
lua capture.lua "$socket" "$binary"
```
The commands pin the library revision used to run this program.
```console
$ git clone https://github.com/libtmux/libtmux-lua libtmux-source &&
git -C libtmux-source checkout 5baa3f9b830ebdbc76fb50b5b3d7a5ad3f76d443 &&
luarocks --tree ./rocks install luv 1.52.1-0 &&
(cd libtmux-source &&
luarocks --tree ../rocks make rockspecs/libtmux-scm-1.rockspec) &&
eval "$(luarocks --tree ./rocks path)" &&
sh run.sh
```
## Where this comes from
The displayed files were compiled or loaded with their native tools and run
on Linux with tmux 3.2a and 3.7c. The rendering checks preserve those file bytes.
---
# Guides
Source: https://libtmux.org/en/lua/v0.1.1/guides/
> Guides for libtmux.
Connect to tmux and work with its sessions, windows, and panes.
- [Getting started](https://libtmux.org/en/lua/v0.1.1/guides/overview/): Read about libtmux for lua.
- [Attaching to tmux](https://libtmux.org/en/lua/v0.1.1/guides/attaching-to-tmux/): Connect to an existing socket and leave its server running.
- [Capture server state](https://libtmux.org/en/lua/v0.1.1/guides/snapshots/): Read about capture server state.
- [Compatibility targets](https://libtmux.org/en/lua/v0.1.1/guides/compatibility/): Read about compatibility targets.
- [Create sessions, windows and panes](https://libtmux.org/en/lua/v0.1.1/guides/creation/): Read about create sessions, windows and panes.
- [Execute tmux commands](https://libtmux.org/en/lua/v0.1.1/guides/commands/): Read about execute tmux commands.
- [Observing a session](https://libtmux.org/en/lua/v0.1.1/guides/control/): Read about observing a session.
- [Pane operations](https://libtmux.org/en/lua/v0.1.1/guides/panes/): Read about pane operations.
- [Query captured data](https://libtmux.org/en/lua/v0.1.1/guides/query/): Read about query captured data.
- [Read and paste named buffers](https://libtmux.org/en/lua/v0.1.1/guides/buffers/): Read about read and paste named buffers.
- [Switch and detach clients](https://libtmux.org/en/lua/v0.1.1/guides/clients/): Read about switch and detach clients.
- [tmux option and hook reference](https://libtmux.org/en/lua/v0.1.1/guides/options/): Read about tmux option and hook reference.
- [Topology operations](https://libtmux.org/en/lua/v0.1.1/guides/topology/): Read about topology operations.
---
# Getting started
Source: https://libtmux.org/en/lua/v0.1.1/guides/overview/
> Getting started: libtmux documentation.
Script tmux from Lua: [create sessions and panes][ref-server-new-session],
[capture terminal output][ref-pane-capture],
[query server state][ref-server-query], and
[watch pane output][ref-observation-watch-pane]. Use standalone Lua with luv or
Neovim's event loop.
[](https://github.com/libtmux/libtmux-lua/actions/workflows/ci.yml)
[](https://luarocks.org/modules/tony/libtmux)
[](https://libtmux.org/en/lua/)
[](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/LICENSE)
Releases are numbered `0.1.N`, and each release increments `N`. The API is not
settled: any release may change or remove exported identifiers, and the
[changelog](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/CHANGES.md) marks each break. Pin an exact version to avoid one.
The separate MCP and workspace packages are unpublished scaffolds.
**Contents** — [Quick start](https://libtmux.org/en/lua/v0.1.1/guides/overview/#quick-start) ·
[Read tmux](https://libtmux.org/en/lua/v0.1.1/guides/overview/#read-what-tmux-has-now) ·
[Create](https://libtmux.org/en/lua/v0.1.1/guides/overview/#create-sessions-windows-and-panes) ·
[Type and read](https://libtmux.org/en/lua/v0.1.1/guides/overview/#type-into-a-pane-and-read-the-answer) ·
[Neovim](https://libtmux.org/en/lua/v0.1.1/guides/overview/#use-it-from-neovim) · [Packages](https://libtmux.org/en/lua/v0.1.1/guides/overview/#packages) ·
[Leaves out](https://libtmux.org/en/lua/v0.1.1/guides/overview/#what-it-leaves-out) · [Support](https://libtmux.org/en/lua/v0.1.1/guides/overview/#support-and-status) ·
[Guides](https://libtmux.org/en/lua/v0.1.1/guides/overview/#guides) ·
[CI](https://github.com/libtmux/libtmux-lua/actions/workflows/ci.yml) ·
[MIT license](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/LICENSE)
## Quick start
Standalone scripts run on [`luv`](), the event loop. Building [`luv`]() needs a C
compiler, make and CMake. Install them first:
- Debian and Ubuntu: `build-essential` and `cmake`.
- Fedora: `gcc`, `make` and `cmake`.
- macOS (not a CI platform): the Xcode command line tools
(`xcode-select --install`) and `cmake`.
If the [`luv`]() build fails, use a system package where one exists, such as
`lua-luv` on Debian and Ubuntu. It serves only the distribution's own Lua,
not one built elsewhere.
Install the core rock, then [`luv`](), skipping [`luv`]() if you installed the
system package:
```console
$ luarocks --local install libtmux
```
```console
$ luarocks --local install luv 1.52.1-0
```
Add the local rocks tree to Lua's module paths:
```console
$ eval "$(luarocks --local path)"
```
Create a session and read it back. This is the whole program:
```lua
local adapter = require("libtmux.runtime.luv")
local function must(value, err)
if err ~= nil then
error(tostring(err), 0)
end
return value
end
local binary = assert(os.getenv("TMUX_BIN"), "set TMUX_BIN to an absolute tmux executable")
local socket = assert(os.getenv("TMUX_SOCKET"), "set TMUX_SOCKET to the private socket")
must(adapter.run(function(runtime)
local server = must(runtime:connect({ binary = binary, socket_path = socket }):await())
local created = must(server
:new_session({
name = "demo",
window_name = "main",
argv = { "/bin/cat" },
})
:await())
assert(created.session and created.window and created.pane, "creation handles are missing")
local snapshot = must(created.session:snapshot():await())
assert(snapshot.name == "demo", "created session has the wrong name")
print("session: " .. snapshot.name)
must(server:close():await())
return true
end))
```
[`Runtime:connect`][ref-runtime-connect] binds the socket you name and never
starts a server.
[`Server:new_session`][ref-server-new-session] creates the session and
[`Session:snapshot`][ref-session-snapshot] reads it back.
Live calls return [Requests][ref-request]. [`:await()`][ref-request-await]
yields inside the [runtime][ref-runtime] body and returns `value, err`; the
`must` helper turns an error into a raised one.
The program reads `TMUX_BIN` and `TMUX_SOCKET`, absolute paths to tmux and a
socket. To run it without touching a tmux you use, clone the repository:
```console
$ git clone https://github.com/libtmux/libtmux-lua.git && cd libtmux-lua
```
Its launcher starts a tmux server on a private socket, runs the program, and
stops the server. It needs `perl` to confirm the stop:
```console
$ sh examples/api/run.sh examples/api/new_session.lua
session: demo
```
Every Lua block on this page is quoted from a program under
[`examples/`](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/examples/) that CI runs, against a real tmux wherever the block
uses one. Excerpts that talk to tmux run inside the same runtime body, with
`server` and `must` in hand.
## Read what tmux has now
### [`Server:snapshot`][ref-server-snapshot]: what tmux has now
One call reads every session, window and pane the server holds.
[`snapshot.sessions`][ref-snapshot-sessions],
[`snapshot.windows`][ref-snapshot-windows] and
[`snapshot.panes`][ref-snapshot-panes] list them. This prints each pane and
its window:
```lua
local snapshot = must(server:snapshot({ strict = true }):await())
for _, pane in ipairs(snapshot.panes) do
io.stdout:write(pane.id, "\t", pane.window_id, "\n")
end
```
The launcher's server has one pane, so the complete
[`snapshot.lua`](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/examples/snapshot.lua) prints its pane ID and window ID:
```console
$ sh examples/api/run.sh examples/snapshot.lua
%0 @0
```
A [snapshot][ref-snapshot] is a record of what tmux held when it was read. It
does not change when tmux does, and it spans several tmux commands, so it is
not an atomic view. `strict = true` adds a verification pass. Call
[`Server:snapshot`][ref-server-snapshot] again to refresh.
### [`Selection:where`][ref-selection-where]: narrow what you read
[`Selection:where`][ref-selection-where] narrows a collection by structured
criteria, and [`Selection:filter`][ref-selection-filter] by a Lua function.
Both work on [`snapshot.panes`][ref-snapshot-panes] and on any list you give
[`query.select`][ref-query-select], and neither calls tmux:
```lua
local panes = query.select(rows, schema)
local editors = panes:where({ current_command = { one_of = { "nvim", "vim" } } })
assert(#editors == 2 and editors[1] == rows[1] and editors[2] == rows[3])
local inactive = panes:filter(function(pane)
return not pane.active
end)
assert(#inactive == 2 and inactive[1].id == "%2")
for _, pane in ipairs(editors) do
print(pane.id, pane.current_command)
end
```
[`native_query.lua`](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/examples/native_query.lua) defines [`rows`]() and [`schema`]()
and needs only Lua. It prints the panes whose command is [`nvim`]() or `vim`:
```console
$ lua examples/native_query.lua
%1 nvim
%3 vim
```
[Criteria and relationships](https://libtmux.org/en/lua/v0.1.1/guides/query/) and the
[field reference](https://libtmux.org/en/lua/v0.1.1/topics/format-token-fields/) list what `where` accepts.
### [`Server:query`][ref-server-query]: read and filter in one call
[`Server:query`][ref-server-query] captures a snapshot and applies `where` to
it. `kind` picks the record type. The rows come back as a
[Selection][ref-selection] beside the snapshot behind them:
```lua
local result = must(server
:query({
kind = "session",
where = { name = "demo" },
snapshot = { strict = true },
})
:await())
assert(result.complete, "query observed a topology change")
assert(#result.rows == 1 and result.rows[1].name == "demo", "query selected the wrong session")
print("matched: " .. result.rows[1].name)
```
The program creates sessions named `demo` and `worker`, so the filter matches
one:
```console
$ sh examples/api/run.sh examples/api/query.lua
matched: demo
```
`complete` reports no known inconsistency. The read is still not atomic.
## Create sessions, windows and panes
### [`Session:new_window`][ref-session-new-window]: add a window
[`Session:new_window`][ref-session-new-window] adds a window to a session.
Like [`Server:new_session`][ref-server-new-session], it returns a
[`Creation`][ref-creation] holding [`session`][ref-session],
[`window`][ref-window], [`pane`][ref-pane] and
[`window_link`][ref-windowlink] handles:
```lua
local created = must(server
:new_session({
name = "demo",
window_name = "main",
argv = { "/bin/cat" },
})
:await())
local logs = must(created.session:new_window({ name = "logs", argv = { "/bin/cat" } }):await())
local snapshot = must(logs.window:snapshot():await())
assert(snapshot.name == "logs", "created window has the wrong name")
print("window: " .. snapshot.name)
```
`argv` is the literal command the pane runs. Leave it out for tmux's default
shell.
```console
$ sh examples/api/run.sh examples/api/new_window.lua
window: logs
```
Creation does not wait for the program to start or report whether it
succeeds. Closing the server handle leaves what you created running.
### [`Pane:split`][ref-pane-split]: divide a window
[`Pane:split`][ref-pane-split] splits a pane to the `left`, `right`, `up` or
`down`, sized by `percent` or `size`. The new pane is [`split.pane`][ref-pane]:
```lua
local logs = must(created.session:new_window({ name = "logs", argv = { "/bin/cat" } }):await())
local split =
must(logs.pane:split({ direction = "right", percent = 40, argv = { "/bin/cat" } }):await())
```
[`quickstart.lua`](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/examples/quickstart.lua) creates a session, a window and
this split, then prints their IDs. New windows and splits leave the
selection alone unless you pass `select = true`:
```console
$ sh examples/api/run.sh examples/quickstart.lua
$1 @2 %3
```
## Type into a pane and read the answer
### [`Pane:send_text`][ref-pane-send-text]: type a command
[`Pane:send_text`][ref-pane-send-text] types literal text and adds no Enter.
[`Pane:send_keys`][ref-pane-send-keys] presses named keys such as `Enter`.
Success means tmux accepted the input while the command may still be running.
The example waits on a tmux [`wait-for`](https://libtmux.org/en/tmux/latest/manual/wait-for/) channel with
[`Server:command`][ref-server-command]:
```lua
-- Signal completion on this socket; do not guess when the shell has printed.
local command = "printf '\\nlua input ready\\n'; "
.. quote(binary)
.. " -S "
.. quote(socket)
.. " wait-for -S example-ready"
must(pane:send_text(command):await())
must(pane:send_keys({ "Enter" }):await())
must(server:command({ "wait-for", "example-ready" }, { timeout = 1000 }):await())
```
`quote` shell-quotes the tmux path and socket for the pane's shell. The
program goes on to capture the pane and print the line the command wrote:
```console
$ sh examples/api/run.sh examples/api/send_keys.lua
lua input ready
```
[`Server:command`][ref-server-command] runs any tmux command from literal
arguments. A nonzero exit is part of the result.
### [`Pane:capture`][ref-pane-capture]: read the screen
[`Pane:capture`][ref-pane-capture] returns the screen tmux drew.
`history_lines = 20` adds up to 20 rows of history.
[`capture:text()`][ref-capture-text] returns the bytes as UTF-8, or an
[`invalid_utf8`](https://libtmux.org/en/lua/v0.1.1/guides/panes/#capture-and-text) error:
```lua
local capture = must(pane:capture({ history_lines = 20 }):await())
local found = false
for line in must(capture:text()):gmatch("[^\r\n]+") do
if line == "lua capture ready" then
found = true
end
end
assert(found, "completed command did not print the expected line")
print("lua capture ready")
```
```console
$ sh examples/api/run.sh examples/api/capture.lua
lua capture ready
```
A capture holds the cells tmux rendered, so it cannot say whether a command
finished. [Pane operations](https://libtmux.org/en/lua/v0.1.1/guides/panes/) lists the capture options, from
joined lines to escape sequences.
### [`Pane:wait_for_text`][ref-pane-wait-for-text]: wait for text on screen
[`Pane:wait_for_text`][ref-pane-wait-for-text] polls the visible screen on
every supported tmux release until it holds the literal text.
The result has the matching screen and [`matched_at_entry`](), true when the
first read already matched. Pass `timeout` or `deadline` to bound the wait.
```lua
-- The shell echoes what is typed, so print the needle from two pieces.
must(pane:send_text("printf '%s%s\\n' 'lua wait ' 'ready'"):await())
must(pane:send_keys({ "Enter" }):await())
local found = must(pane:wait_for_text("lua wait ready", { timeout = 5000 }):await())
assert(found.text:find("lua wait ready", 1, true))
print("lua wait ready")
```
```console
$ sh examples/api/run.sh examples/api/wait_for_text.lua
lua wait ready
```
If the pane exits first, the wait ends with `pane_died` and the text seen so
far. See [waiting for pane text](https://libtmux.org/en/lua/v0.1.1/guides/panes/#wait-for-text) for the read,
the hooks it runs and every end state.
## Use it from Neovim
### [`runtime.nvim.start`][ref-nvim-start]: borrow the editor's loop
[`start`][ref-nvim-start] returns at once, runs the body on Neovim's loop and
calls `on_done(value, err)` after the work it owns has finished. Handles it
did not create stay open:
```lua
local adapter = require("libtmux.runtime.nvim")
adapter.start(function(runtime)
local server, err = runtime
:connect({
binary = vim.fn.exepath("tmux"),
socket_path = assert(os.getenv("TMUX_SOCKET")),
})
:await()
if not server then
return nil, err
end
return server:snapshot({ strict = true }):await()
end, function(snapshot, err)
if err then
vim.notify(tostring(err), vim.log.levels.ERROR)
return
end
vim.notify(("Panes: %d"):format(#snapshot.panes))
end)
```
From the checkout, start Neovim with the library on its `runtimepath` and set
`TMUX_SOCKET` to the absolute path of a server's socket:
```console
$ TMUX_SOCKET=/path/to/tmux.sock nvim \
--cmd 'set runtimepath+=.' \
-c 'luafile examples/nvim_snapshot.lua'
```
Neovim then shows the server's pane count. It has its own libuv binding, so
the [`luv`]() rock is not needed here.
The runtime closes its connections when the body finishes and leaves the tmux
server running. See [runtime ownership and cancellation](https://libtmux.org/en/lua/v0.1.1/guides/runtime/).
## Packages
| Package | Source | Reference | What it is |
| --- | --- | --- | --- |
| [`libtmux`]() | [`lua/libtmux/`](https://github.com/libtmux/libtmux-lua/tree/master/lua/libtmux) | [libtmux.org](https://libtmux.org/en/lua/latest/reference/) | The library. Sessions, windows, panes, snapshots, queries and two event-loop adapters. |
| `libtmux-workspace` | [`packages/workspace/`](https://github.com/libtmux/libtmux-lua/tree/master/packages/workspace) | [libtmux.org](https://libtmux.org/en/lua/latest/workspace/) | An unpublished scaffold for workspace operations. |
| `libtmux-mcp` | [`packages/mcp/`](https://github.com/libtmux/libtmux-lua/tree/master/packages/mcp) | [libtmux.org](https://libtmux.org/en/lua/latest/mcp/) | An unpublished scaffold for the MCP server. |
Each heading below links to its directory on GitHub, which LuaRocks does not
show. Only [`libtmux`]() is published. `libtmux-workspace` and `libtmux-mcp` are
unpublished scaffolds with no public API.
Each rock keeps its own changelog: [`libtmux`](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/CHANGES.md),
[`libtmux-workspace`](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/packages/workspace/CHANGELOG.md) and
[`libtmux-mcp`](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/packages/mcp/CHANGELOG.md).
### [`libtmux`](https://github.com/libtmux/libtmux-lua/tree/master/lua/libtmux): the library
Create sessions, windows and panes, capture pane output, query server state
and watch pane output, on luv or Neovim's event loop. Reference:
- [LuaRocks](https://luarocks.org/modules/tony/libtmux) and
[libtmux.org](https://libtmux.org/en/lua/latest/reference/).
- [`libtmux.Server`](https://libtmux.org/en/lua/latest/reference/libtmux-server/),
[`libtmux.runtime.luv`](https://libtmux.org/en/lua/latest/reference/libtmux-runtime-luv/),
[`libtmux.runtime.nvim`](https://libtmux.org/en/lua/latest/reference/libtmux-runtime-nvim/)
and [`libtmux.query`](https://libtmux.org/en/lua/latest/reference/libtmux-query/).
Importing a module starts neither tmux nor an event loop, and
[local queries][ref-query] need only Lua. To install from a checkout instead
of LuaRocks:
```console
$ luarocks --local make rockspecs/libtmux-scm-1.rockspec
```
The [core README](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/lua/libtmux/README.md) covers each module, with a complete
program for the standalone loop, Neovim and tables without tmux.
### [`libtmux-workspace`](https://github.com/libtmux/libtmux-lua/tree/master/packages/workspace): workspace scaffold
A development package for planned workspace operations. It has no loader,
command or builder API yet, and its module returns only a version.
[libtmux.org](https://libtmux.org/en/lua/latest/workspace/) records that it
is unpublished. After installing [`libtmux`](), build it from the checkout:
```console
$ luarocks --local make rockspecs/libtmux-workspace-scm-1.rockspec
```
With the local rocks tree on Lua's module paths, print its version:
```console
$ lua -e 'print(require("libtmux_workspace")._VERSION)'
scm
```
The [package README](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/packages/workspace/README.md) lists the prerequisites,
including LibYAML for `lyaml`.
### [`libtmux-mcp`](https://github.com/libtmux/libtmux-lua/tree/master/packages/mcp): MCP scaffold
A development package for the planned MCP server. It has no server,
executable, tools or prompts yet, so there is nothing to register with an MCP
client.
[libtmux.org](https://libtmux.org/en/lua/latest/mcp/) records that it is
unpublished. After installing [`libtmux`](), build it from the checkout:
```console
$ luarocks --local make rockspecs/libtmux-mcp-scm-1.rockspec
```
With the local rocks tree on Lua's module paths, print its version:
```console
$ lua -e 'print(require("libtmux_mcp")._VERSION)'
scm
```
The [package README](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/packages/mcp/README.md) has the full build steps.
## What it leaves out
- **Starting a server.** [`Runtime:connect`][ref-runtime-connect] never starts
one. Without a [`socket_path`](https://libtmux.org/en/tmux/latest/catalog/formats/socket_path/), `LIBTMUX_SOCKET_PATH` or `LIBTMUX_SOCKET` names
the server, and otherwise tmux picks it.
- **Live records.** A [snapshot][ref-snapshot] holds what tmux said when it
was read. Capture again to see a change.
- **Proof that a command finished.** [`Pane:send_keys`][ref-pane-send-keys]
succeeds when tmux accepts the input. Wait on a [`wait-for`](https://libtmux.org/en/tmux/latest/manual/wait-for/) channel, or print
a token and [wait for it][ref-pane-wait-for-text].
- **An interactive terminal.** The luv and Neovim adapters own no terminal, so
[`Session:attach`][ref-session-attach] returns `unsupported_tty`.
- **Your tmux configuration.** The library does not change a borrowed
server's configuration, and your aliases and hooks still apply to
[its commands](https://libtmux.org/en/lua/v0.1.1/guides/commands/).
- **An MCP server or a workspace loader.** Both packages are
[scaffolds](https://libtmux.org/en/lua/v0.1.1/guides/overview/#packages) with no public API.
## Support and status
- **Versions.** Releases are numbered `0.1.N`, and each release increments
`N`. The API is not settled: any release may change or remove exported
identifiers, and the changelog marks each break. Pin an exact version to
avoid one.
- **Lua 5.1 to 5.5, and LuaJIT.** CI runs the unit suites on each.
- **tmux 3.3a or newer.** Connection setup may probe the daemon's release,
then refuse an older server with
[`unsupported_version`](https://libtmux.org/en/lua/v0.1.1/guides/compatibility/#minimum-tmux-release).
The [compatibility matrix](https://libtmux.org/en/lua/v0.1.1/guides/compatibility/) lists CI's integration releases.
- **tmux release candidates are not supported.** A feature can require one
only until its release ships, and a candidate such as `X.Y-rcN` ranks below
`X.Y`, so one below the floor is refused.
See [Release candidates](https://libtmux.org/en/tmux/guides/tmux-support/#release-candidates).
- **Pane-output watches and control observation need tmux 3.7 or newer.**
[`observe`]() returns `unsupported` on an older server. See
[control](https://libtmux.org/en/lua/v0.1.1/guides/control/).
- **Waiting for text polls the visible screen.**
[`Pane:wait_for_text`][ref-pane-wait-for-text] works on every release. Each
read runs the [`after-capture-pane`](https://libtmux.org/en/tmux/latest/catalog/hooks/after-capture-pane/) hook and never searches scrollback.
- **Nested commands are not checked.** A refused command inside another,
such as [`if-shell -F 1 'break-pane -d'`](https://libtmux.org/en/tmux/latest/manual/if-shell/), reaches tmux and can stop the
server on exactly 3.7. See the [limit and its advice](https://libtmux.org/en/lua/v0.1.1/guides/commands/).
- **Optional features.** Some commands and options need a newer release than
3.3a. The [optional-feature table](https://libtmux.org/en/lua/v0.1.1/guides/compatibility/#optional-features)
lists each, and [`capabilities.json`](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/capabilities.json) holds the same
data for tools.
- **Neovim.** CI runs the Neovim tests on 0.10.0 and 0.12.5.
- **Linux, including WSL.** CI runs on Ubuntu 24.04 and local checks run under
WSL2. No CI job runs on macOS, so macOS is untested.
- **Releases.** The [changelog](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/CHANGES.md) records each one, and the
[release instructions](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/.github/CONTRIBUTING.md#releases) cover verification.
## Guides
- **Clients:** [switch sessions and detach terminals](https://libtmux.org/en/lua/v0.1.1/guides/clients/).
- **Read and watch:** [snapshots](https://libtmux.org/en/lua/v0.1.1/guides/snapshots/),
[session notifications and pane streams](https://libtmux.org/en/lua/v0.1.1/guides/control/).
- **Run and arrange:** [commands and batches](https://libtmux.org/en/lua/v0.1.1/guides/commands/),
[session/window topology](https://libtmux.org/en/lua/v0.1.1/guides/topology/), [binary buffers](https://libtmux.org/en/lua/v0.1.1/guides/buffers/).
- **Configure:** [options and hooks](https://libtmux.org/en/lua/v0.1.1/topics/options-and-hooks/),
[option reference](https://libtmux.org/en/lua/v0.1.1/guides/options/),
[environment values](https://libtmux.org/en/lua/v0.1.1/topics/environment/).
- **Contribute:** [setup and validation](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/.github/CONTRIBUTING.md),
[writing conventions](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/.github/WRITING.md).
Live tests use private sockets and clean up their own servers. See the
contributing guide for the same offline checks that run in CI.
## Attribution
Please use the following BibTeX template to cite libtmux-lua in scientific discourse:
```bibtex
@misc{libtmux-lua,
author = {Tony Narlock},
year = {2026},
note = {https://libtmux.org/en/lua/},
title = {libtmux-lua: Lua wrapper for tmux}
}
```
## License
MIT. See [`LICENSE`](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/LICENSE).
[ref-server-new-session]: https://libtmux.org/en/lua/latest/reference/libtmux-server-new_session/
[ref-pane-capture]: https://libtmux.org/en/lua/latest/reference/libtmux-pane-capture/
[ref-server-query]: https://libtmux.org/en/lua/latest/reference/libtmux-server-query/
[ref-observation-watch-pane]: https://libtmux.org/en/lua/latest/reference/libtmux-observation-watch_pane/
[ref-query]: https://libtmux.org/en/lua/latest/reference/libtmux-query/
[ref-runtime-connect]: https://libtmux.org/en/lua/latest/reference/libtmux-runtime-connect/
[ref-session-snapshot]: https://libtmux.org/en/lua/latest/reference/libtmux-session-snapshot/
[ref-request]: https://libtmux.org/en/lua/latest/reference/libtmux-request/
[ref-request-await]: https://libtmux.org/en/lua/latest/reference/libtmux-request-await/
[ref-runtime]: https://libtmux.org/en/lua/latest/reference/libtmux-runtime/
[ref-server-snapshot]: https://libtmux.org/en/lua/latest/reference/libtmux-server-snapshot/
[ref-snapshot]: https://libtmux.org/en/lua/latest/reference/libtmux-snapshot/
[ref-snapshot-sessions]: https://libtmux.org/en/lua/latest/reference/libtmux-snapshot-sessions/
[ref-snapshot-windows]: https://libtmux.org/en/lua/latest/reference/libtmux-snapshot-windows/
[ref-snapshot-panes]: https://libtmux.org/en/lua/latest/reference/libtmux-snapshot-panes/
[ref-selection]: https://libtmux.org/en/lua/latest/reference/libtmux-selection/
[ref-selection-where]: https://libtmux.org/en/lua/latest/reference/libtmux-selection-where/
[ref-selection-filter]: https://libtmux.org/en/lua/latest/reference/libtmux-selection-filter/
[ref-query-select]: https://libtmux.org/en/lua/latest/reference/libtmux-query-select/
[ref-creation]: https://libtmux.org/en/lua/latest/reference/libtmux-creation/
[ref-session]: https://libtmux.org/en/lua/latest/reference/libtmux-session/
[ref-window]: https://libtmux.org/en/lua/latest/reference/libtmux-window/
[ref-pane]: https://libtmux.org/en/lua/latest/reference/libtmux-pane/
[ref-windowlink]: https://libtmux.org/en/lua/latest/reference/libtmux-windowlink/
[ref-session-new-window]: https://libtmux.org/en/lua/latest/reference/libtmux-session-new_window/
[ref-pane-split]: https://libtmux.org/en/lua/latest/reference/libtmux-pane-split/
[ref-pane-send-text]: https://libtmux.org/en/lua/latest/reference/libtmux-pane-send_text/
[ref-pane-send-keys]: https://libtmux.org/en/lua/latest/reference/libtmux-pane-send_keys/
[ref-server-command]: https://libtmux.org/en/lua/latest/reference/libtmux-server-command/
[ref-pane-wait-for-text]: https://libtmux.org/en/lua/latest/reference/libtmux-pane-wait_for_text/
[ref-capture-text]: https://libtmux.org/en/lua/latest/reference/libtmux-capture-text/
[ref-session-attach]: https://libtmux.org/en/lua/latest/reference/libtmux-session-attach/
[ref-nvim-start]: https://libtmux.org/en/lua/latest/reference/libtmux-runtime-nvim-start/
---
# Attaching to tmux
Source: https://libtmux.org/en/lua/v0.1.1/guides/attaching-to-tmux/
> Connect to an existing tmux server and find a session with Lua.
Connect a `Server` to an explicit socket and find the existing `work` session.
The program prints its name and leaves the tmux server running. It reports an
error if the connection fails or the session is absent.
This controls tmux from your program. To open a session in your terminal, use
[`tmux attach-session`](https://libtmux.org/en/tmux/latest/manual/attach-session/); the [shared guide](https://libtmux.org/en/tmux/guides/attaching-to-tmux/) covers
interactive attachment and detaching.
## Connect to an existing server
Save the complete program as `connect.lua`. `LIBTMUX_SOCKET_PATH` selects
the existing server. The launcher below supplies a private socket for trying
the example.
```lua title="connect.lua"
local adapter = require("libtmux.runtime.luv")
local function must(value, err)
if err ~= nil then error(tostring(err), 0) end
return value
end
local socket = assert(os.getenv("LIBTMUX_SOCKET_PATH"), "set LIBTMUX_SOCKET_PATH")
local binary = assert(os.getenv("TMUX_BIN"), "set TMUX_BIN to the absolute tmux path")
must(adapter.run(function(runtime)
local server = must(runtime:connect({ binary = binary, socket_path = socket }):await())
local snapshot, capture_error = server:snapshot({ strict = true }):await()
local closed, close_error = server:close():await()
must(snapshot, capture_error)
must(closed, close_error)
for _, session in ipairs(snapshot.sessions) do
if session.name == "work" then
print("work")
return true
end
end
error("The work session does not exist", 0)
end))
```
## Setup and run
Use an empty directory on Linux with Git and tmux 3.3a or newer installed.
This example was checked with Lua 5.5.1, luv 1.52.1-0.
Save the launcher as `run.sh`. It starts an isolated tmux server, runs the
program, checks that the session still exists, then stops only that server.
Cleanup runs after failures too. A failed shutdown keeps its socket directory
and prints its location for inspection.
```sh title="run.sh"
#!/bin/sh
set -eu
binary=$(command -v tmux)
directory=$(mktemp -d "${TMPDIR:-/tmp}/libtmux-lua-attach.XXXXXX")
socket="$directory/tmux.sock"
cleanup() {
status=$?
trap - 0 HUP INT TERM
if [ -S "$socket" ] && ! "$binary" -S "$socket" kill-server; then
printf 'Cannot stop tmux; kept %s\n' "$directory" >&2
exit 1
fi
rm -rf "$directory" || exit 1
exit "$status"
}
trap cleanup 0
trap 'exit 1' HUP INT TERM
unset TMUX TMUX_PANE
export LIBTMUX_SOCKET_PATH="$socket" TMUX_BIN="$binary"
"$binary" -S "$socket" -f /dev/null new-session -d -s work /bin/cat
"$@"
"$binary" -S "$socket" has-session -t '=work'
```
Fetch the verified library revision, build, and run:
```console
$ git clone https://github.com/libtmux/libtmux-lua libtmux-source &&
git -C libtmux-source checkout 5baa3f9b830ebdbc76fb50b5b3d7a5ad3f76d443 &&
luarocks --tree ./rocks install luv 1.52.1-0 &&
(cd libtmux-source &&
luarocks --tree ../rocks make rockspecs/libtmux-scm-1.rockspec) &&
eval "$(luarocks --tree ./rocks path)" &&
sh run.sh lua connect.lua
```
The program prints `work`. To use an existing server of your own, set
`LIBTMUX_SOCKET_PATH` to its socket and run the program without the launcher.
Also set `TMUX_BIN` to the absolute path of the tmux executable.
The launcher is responsible for the demonstration server's lifetime.
## Find or create a session
The example only looks up a session. If your application creates a session
after an unsuccessful lookup, another client may create the same name between
those operations. Handle the creation error instead of assuming the lookup
reserves the name.
For a complete program that starts and owns its server, see
[Capture pane output](https://libtmux.org/en/lua/v0.1.1/examples/capture-pane-output/).
---
# Capture server state
Source: https://libtmux.org/en/lua/v0.1.1/guides/snapshots/
> Capture server state: libtmux documentation.
Use [`runtime:connect(options):await()`]() to bind a borrowed tmux daemon, then
[`server:snapshot(options):await()`]() to capture its state. Every live operation
returns a Request. The [snapshot example](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/examples/snapshot.lua) prints
each unique pane and its window ID using the public API.
Pass an absolute [`binary`]() to [`connect`](), and usually an absolute [`socket_path`](https://libtmux.org/en/tmux/latest/catalog/formats/socket_path/).
Optional [`config_path`]() defaults to `/dev/null`. Connection options are copied
before dispatch. The library never starts a server. Importing the library and
inspecting captured records perform no I/O.
Without a [`socket_path`](https://libtmux.org/en/tmux/latest/catalog/formats/socket_path/), [`connect`]() reads `LIBTMUX_SOCKET_PATH`, a socket path
(tmux `-S`), then `LIBTMUX_SOCKET`, a socket name (`-L`). The path wins when
both are set, and a variable that is empty or only whitespace counts as unset.
A `socket_path` option leaves both unread. With neither variable set, tmux gets
no socket and picks the server itself: the one in `TMUX` inside tmux, otherwise
the default socket under `TMUX_TMPDIR`. `LIBTMUX_SOCKET_PATH` must be absolute
and name a file.
[`connect`]() starts no server. If tmux finds none running on the socket it picked,
or on the `LIBTMUX_SOCKET` name, it fails with `invalid_endpoint`. A socket
path, from the option or `LIBTMUX_SOCKET_PATH`, fails with `invalid_endpoint`
when no file is there, and with `uncertain_generation` when the file outlived
its server, which tmux leaves behind when it exits.
Connection setup reads the actual daemon's version and identity and disables
tmux autostart. Linux socket binding creates a private socket alias in the
selected socket's parent directory; that directory must permit creation and
hard links. Each command checks the original socket and alias, and reads
bounded daemon evidence. A socket name, or tmux's own choice, has no path to
alias, so nothing is created: the daemon's pid, start time and release, which
every command carries as a fence, are its only identity. A restart, replaced
socket or uncertain connection invalidates the handle. Reconnect explicitly;
old references do not bind to reused IDs. The
[compatibility matrix](https://libtmux.org/en/lua/v0.1.1/guides/compatibility/) records Ubuntu CI coverage and local
WSL2 checks; macOS remains outside the verified matrix.
[`server:close():await()`]() closes the handle and its owned connections. It leaves
the borrowed daemon running. The runtime also closes handles when its root
scope finishes. Keep live work inside that scope; returning a handle from
[`adapter.run`]() does not keep its runtime alive.
## Collections and projections
Snapshots contain [`sessions`](), [`windows`](), `panes`, `window_links`, [`clients`]()
and [`buffers`]() as [native selections](https://libtmux.org/en/lua/v0.1.1/guides/query/). Canonical entity collections
deduplicate identity; [`snapshot.raw`]() preserves contextual listing rows and
their order. A window linked twice has two link rows and one canonical window.
Relationships refer only to captured data. Clients are the attached clients
that tmux exposes through [`list-clients`](https://libtmux.org/en/tmux/latest/manual/list-clients/).
Window links own [`session_id`](https://libtmux.org/en/tmux/latest/catalog/formats/session_id/), [`window_id`](https://libtmux.org/en/tmux/latest/catalog/formats/window_id/), `index` and active context. Pane
and window IDs remain tmux strings; Lua positions are not tmux indexes.
A daemon with no sessions can still have buffers. Capture reads them without
creating a session.
By default, capture loads every supported field in the [catalog](https://libtmux.org/en/lua/v0.1.1/topics/format-token-fields/).
The `fields` option maps collection names to nonempty field-name sequences;
omitted collections keep their default projection. Required identity and
relationship fields are added. [`requested_projections`]() records the caller's
selection; `projections` records effective fields, including for empty
collections. Both maps use singular entity names such as `pane` and
[`window_link`](). `capabilities.fields` records availability for the observed
daemon version; it does not claim every tmux command is supported.
Refresh by calling `snapshot` again. It returns fresh records. Tables remain
mutable, so do not edit them during traversal. Editing a record does not
refresh the server, another snapshot or its private identity index.
Create a handle with [`server:handle(snapshot, record)`](). The record's kind picks
the handle's class: a [`SnapshotPane`]() gives a [`libtmux.Pane`](), a
[`SnapshotSession`]() a [`libtmux.Session`](), and so on, so LuaLS offers only the
methods tmux accepts for that kind. It copies the record's
private identity, so edits to exposed `id` or `ref` fields cannot redirect it.
`handle:reference()` returns a separate reference table without I/O.
`handle:snapshot():await()` explicitly captures fresh state and returns the
matching record. A missing link/index, client/TTY or buffer name returns
`target_missing`; stale server generations fail before capture. Same-name
client or buffer reuse cannot establish continuous object identity.
## Consistency and limits
Capture spans multiple commands. `acquisition.started` and `finished` are
monotonic milliseconds. Normal capture reports observed relationship races
in `races` and sets `complete` to false. Transport failures return an error.
Set `strict = true` for one additional identity/topology verification pass.
It compares membership and link context, ignoring listing order and volatile
scalar values. A mismatch returns `inconsistent_snapshot` with the original
snapshot in [`err.partial`](); capture never retries to manufacture consistency.
[`verification`]() records the pass and its result. Equal observations do not
make capture atomic, prove continuous identity, or detect objects created
and removed between reads. Replacing a named buffer can preserve every
catalog field while changing its contents.
Each pass permits at most [`max_rows`]() raw rows (default 65,536) across all
collections, before deduplication. `max_bytes` (default 16 MiB) limits both
total encoded output and retained scalar/key bytes per pass. Strict mode
adds one bounded pass. Accumulated rows and the graph copy also consume the
runtime's byte budget; exhaustion returns `queue_full`. These counters bound
data, not exact Lua heap allocation.
`timeout` defaults to 750 milliseconds per listing command. Endpoint evidence
checks have a separate bounded 750-millisecond deadline. Whole capture has
a finite command count; cancel its Request for an earlier stop. Closing the
server during capture prevents a successful current-reference result.
Cancellation retires owned clients; it does not kill the daemon.
Run the example against an explicitly selected existing server:
```console
$ TMUX_BIN=/usr/bin/tmux TMUX_SOCKET=/tmp/example-tmux.sock lua examples/snapshot.lua
```
The package gate runs this file from installed core and luv outside the
checkout, checks exact output, and verifies cleanup. Core-only installation
still has no luv dependency; this standalone example selects it explicitly.
---
# Compatibility targets
Source: https://libtmux.org/en/lua/v0.1.1/guides/compatibility/
> Compatibility targets: libtmux documentation.
This release line supports tmux 3.3a and newer. A push and a pull request run
the integration suite on the oldest and newest released tmux (3.3a and 3.8),
and the full CI run, which a release requires, runs it on each listed tmux
release. The table below lists the versions the full run exercises. A
release outside it is expected to work but is untested, and option operations
refuse it (see [minimum tmux release](https://libtmux.org/en/lua/v0.1.1/guides/compatibility/#minimum-tmux-release)). A source
declaration, successful import, or sibling-port result does not establish live
compatibility. Features that need a newer release than the minimum are listed
under [optional features](https://libtmux.org/en/lua/v0.1.1/guides/compatibility/#optional-features), and the same data is published as
[`capabilities.json`](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/capabilities.json).
| Component | Versions CI covers |
| --- | --- |
| PUC Lua | 5.1.5, 5.2.4, 5.3.6, 5.4.9, 5.5.1 |
| LuaJIT | v2.1 at c6ffc141a8762b41703f9287d63d93622a13dd8f |
| Standalone adapter | luv 1.52.1-0 built for each runtime ABI |
| Neovim | 0.10.0, 0.12.5 |
| tmux | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 |
| Platforms | Ubuntu 24.04 x86_64 in CI; WSL2 checked locally |
Pure-core tests run once per runtime/platform. Standalone and embedded live
tests cover floor/current tmux for each runtime or host. The full tmux sweep
uses PUC Lua 5.5.1 and current Neovim. Consumer imports and pure validation cover
each runtime; floor/current combinations also run interoperability and workspace
failure tests. Client/daemon version mismatches must report protocol failures
truthfully instead of inferring daemon capabilities from the client executable.
macOS and native Windows transport are outside the platform
matrix. Results from builds outside the matrix, such as unreleased builds,
are diagnostic evidence and cannot replace released-version checks. Neovim's
LuaJIT results do not prove stock PUC Lua 5.1 yield behavior. A Neovim build
using PUC Lua is a separate host gate.
## Minimum tmux release
The supported minimum is tmux 3.3a, compared as a complete release: 3.3 is
below it. A development build (`next-X.Y`) or release candidate (`X.Y-rc`,
`X.Y-rcN`) ranks just below the release it names and is accepted when it
ranks at or above 3.3a: `next-3.9` clears the minimum, while `next-3.3` and
a candidate of 3.3 do not. A candidate with a patch letter, such as
`X.Ya-rcN`, names no release and is refused. Clearing the minimum does not
qualify a release: subsystems that key on exact releases refuse versions
they do not list, such as 3.9 or a candidate of it.
tmux release candidates are not supported: a feature can require one only
until its release ships, and a candidate such as `X.Y-rcN` ranks below
`X.Y`. See
[Release candidates](https://libtmux.org/en/tmux/guides/tmux-support/#release-candidates).
The library checks the connected daemon's own [`#{version}`](https://libtmux.org/en/tmux/latest/catalog/formats/version/), never the client
executable's `-V`, so a newer client cannot pass for an older daemon. The
pinned endpoint reads the daemon's version, pid and start time once, when it
binds, with [`run-shell -C`](https://libtmux.org/en/tmux/latest/manual/run-shell/), which fires no `after-*` or [`command-error`](https://libtmux.org/en/tmux/latest/catalog/hooks/command-error/) hook.
Each dispatched command group then starts with a fence on the cached pid,
start time and release, so a command costs no probe. A daemon that changed
after the check raises `stale_generation`, none of the group's commands run
and the cache is dropped; a daemon that is gone raises the same error. The
endpoint only binds to a running server and always passes `-N`, so no
client binary starts a daemon.
A daemon below the minimum raises `unsupported_version` when connecting, with
`effect` set to `not_sent`. So does a report that names no release, such as
bare `master`; its message says so instead of calling the version too old.
tmux before 3.2 has neither [`run-shell -C`](https://libtmux.org/en/tmux/latest/manual/run-shell/) nor the client's `-N`: its server
answers the probe with a usage error (3.1) or is turned away by a newer
client (3.0), and an executable that old rejects `-N`. All three raise
`unsupported_version` too. The message states the remedy: upgrade tmux to
3.3a or newer and restart the server, or install the previous libtmux
release. 0.1.0alpha1-1 is the last release that supports tmux 3.2a;
0.1.0alpha2-1 raised the minimum to 3.3a.
The listed releases include 3.7d and 3.8, the current stable release. 3.7d
shares 3.7c's option table and decoders. 3.8 changes the option table, the
layout export (JSON for non-control clients) and paste sanitization, and the
catalog and layout check cover those. `next-3.9` is a development build: its
row describes the upstream master commit pinned in the option catalog, so a
later master build can differ. The full CI run builds all three.
The full CI run has tmux 3.0a, 3.1c, 3.2a and the unpatched 3.3 as refusal
lanes. They assert the refusal and that no requested operation ran; they do
not run the integration suite. The 3.0a and 3.1c lanes also run the check with
a 3.3a client against the old daemon, which covers the 3.1 usage error and the
3.0 "too old for client" answer.
## Optional features
The 3.3a minimum covers subprocess commands, typed operations, snapshots and
polling captures. Each feature below names its own release requirement and
its state in the stated evidence. A refusal is checked by a test that fails
when the guard is removed; a feature without such a test is unverified.
| Feature | tmux | State |
| --- | --- | --- |
| Commands, typed operations, snapshots, captures | 3.3a to 3.8, 3.7d and the pinned next-3.9 build | Qualified where the CI integration suite passes at that release |
| Control observation ([`observe`](), watches, subscriptions) | below 3.7 | Non-operative: refused with `unsupported` before any attachment |
| Control observation | 3.7 to 3.8 | Qualified for idle attachment, watches and subscriptions; concurrent acquisition from several processes is unverified |
| Waiting for pane text ([`Pane:wait_for_text`]()) | 3.3a to 3.8 | Qualified where the CI integration suite passes at that release; it polls and never uses control mode |
| Named buffer deletion (typed and literal) | below 3.4 | Non-operative: refused |
| Named paste with [`delete_after`]() | 3.3a and later | Qualified: tmux looks the buffer up exactly |
| [`run-shell`](https://libtmux.org/en/tmux/latest/manual/run-shell/) output | 3.3a to 3.4 | Raw client output only: tmux sends job output to pane view mode, so nothing is captured; later releases write it to the client |
| Custom layout strings | below 3.4 | Operative with validation: a checksum header is required |
| JSON layout strings | 3.8 and later | Accepted |
| JSON layout strings | below 3.8 | Refused before dispatch with `invalid_layout` |
| Literal [`select-layout`](https://libtmux.org/en/tmux/latest/manual/select-layout/) with a JSON layout | below 3.8 | Refused before dispatch with `unsupported` |
| Percentage splits | 3.4 | Typed splits encode `-l N%`; literal `-p` is refused |
| Window breaks | exactly 3.7 | Typed [`break_out`]() is operative with a rename repair; literal [`break-pane`](https://libtmux.org/en/tmux/latest/manual/break-pane/) is refused |
| Session and window names with `:` or `.` | exactly 3.7 | Refused before dispatch |
| Development builds | `next-3.9` | Qualified only for the master commit pinned in the option catalog; other development builds and `X.Y-rcN` candidates have no listed option table, so option operations refuse them |
Named buffer deletion requires tmux 3.4 or later. The typed API refuses older
releases because a missing target can delete another buffer. The older-release
deletion parity requirement remains open; see [buffers](https://libtmux.org/en/lua/v0.1.1/guides/buffers/).
Exact operating-system images, binary hashes, compiler and module ABI identities
belong with each result. Missing and skipped cells remain unverified. Checks on
macOS do not run in CI, so macOS is untested; checks run locally under WSL2 on
Ubuntu 24.04 do not replace the Linux CI jobs.
The [CI workflow](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/.github/workflows/ci.yml) covers Linux unit runtimes,
floor/current outer gates and the released-tmux integration sweep, which a
push and a pull request limit to the oldest and newest release. Its
[setup and coverage](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/.github/CONTRIBUTING.md#github-actions) use the same
local gate commands. A passing run establishes those checks at its tested
revision; macOS and host/runtime combinations outside the workflow matrix
remain unverified.
Version evidence comes from [Lua's version history](https://www.lua.org/versions.html),
[LuaJIT's release policy](https://luajit.org/status.html), the
[luv release](https://github.com/luvit/luv/releases/tag/1.52.1-0),
[Neovim's Lua contract](https://neovim.io/doc/user/lua/#lua-compat), and
[tmux releases](https://github.com/tmux/tmux/releases).
---
# Create sessions, windows and panes
Source: https://libtmux.org/en/lua/v0.1.1/guides/creation/
> Create sessions, windows and panes: libtmux documentation.
[`Server:new_session`](), [`Session:new_window`]() and [`Pane:split`]() return a
`Request`. Await inside the adapter's managed coroutine, or register
[`on_complete(value, err)`](). See [connections](https://libtmux.org/en/lua/v0.1.1/guides/snapshots/) and
[runtime ownership](https://libtmux.org/en/lua/v0.1.1/guides/runtime/) for setup and cancellation.
The receipt contains `session`, `window`, `pane` and [`window_link`]() handles
made from tmux's returned IDs. Its `created` sequence names the objects this
operation created: all four for a session, window/pane/link for a window, and
only the pane for a split. Other handles describe the containing context.
Creating a pane proves neither application readiness nor command success.
## Commands and literal values
Pass `argv` for a literal command, or `shell` for explicitly authored tmux
shell text. They are mutually exclusive. Multiple arguments use tmux's native
argument execution. A singleton executable uses `/usr/bin/env --` to avoid
tmux's single-argument shell interpretation; it requires that utility and
rejects executable names containing `=`. Use explicit shell text for that
case. Omitting both fields uses tmux's configured default command or shell.
Names, directories and environment values stay literal, including tmux
format-looking text. Session names reject `:`, `.`, and control bytes because
tmux would otherwise change them. `environment` maps portable variable names
to string values and applies to the created session or pane process through
tmux's `-e` semantics. It does not change the caller's environment.
An explicit `cwd` must be an absolute existing directory. The asynchronous
preflight rejects a missing directory before sending the creation command.
Filesystem changes after validation remain possible. Input is copied and
validated before dispatch, including nested process options.
## Placement and selection
Sessions start detached and accept `name`, [`window_name`](), `width` and
`height`. Windows accept `name`, an optional nonnegative `index`, and
`select`; their parent is the Session handle's exact ID. A supplied occupied
index fails rather than replacing the existing window.
Splits accept `direction` (`left`, `right`, `up` or `down`), optional positive
`size` in cells or `percent` from 1 through 99, `full_size`, and `select`. The default
direction is down. New windows and splits leave selection unchanged unless
`select=true`. Handle references cannot be edited to redirect an operation.
## Errors and limits
`process` accepts `timeout`, `deadline`, `max_output_bytes`, `kill_timeout`
and `drain_timeout`; see [command completion](https://libtmux.org/en/lua/v0.1.1/guides/commands/). It cannot replace
the bound socket, process environment, input stream or working directory.
Creation accepts at most 1024 argv items, 128 environment entries and one MiB
of encoded input, subject to the runtime's shared byte capacity.
Errors preserve whether the command was not sent, may have taken effect, or
completed. A malformed receipt reports `invalid_result` with completed effect
and retained command output. Canceling the tmux client cannot undo a creation
already accepted by the daemon. Creation does not retry or remove partial
state. Closing the Server connection leaves created sessions running.
The [public creation fixture](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/tests/integration/domain.lua) exercises the
same API through luv and Neovim with literal arguments, environment and
directory values, returned IDs, explicit shell text and missing directories.
---
# Execute tmux commands
Source: https://libtmux.org/en/lua/v0.1.1/guides/commands/
> Execute tmux commands: libtmux documentation.
After [connecting](https://libtmux.org/en/lua/v0.1.1/guides/snapshots/), [`server:command(argv, options)`]() submits
literal tmux arguments and returns a Request. It preserves raw stdout/stderr
bytes, exit code and signal, and waits for the owned client and its pipes to
retire. A completed nonzero exit is returned as result data. Spawn, timeout,
output-limit and incomplete-drain failures return `nil, err`.
No shell parses argv. tmux still parses its own command syntax; the library
protects literal separator arguments. A tmux command that explicitly accepts
shell text, such as [`run-shell`](https://libtmux.org/en/tmux/latest/manual/run-shell/), retains that command's shell semantics.
Before dispatch, the library refuses a literal command item that is unsafe on
the connected daemon's release. The check resolves the command through tmux's
own alias and unique-prefix rules, so `breakp` and [`split`]() match [`break-pane`](https://libtmux.org/en/tmux/latest/manual/break-pane/)
and [`split-window`](https://libtmux.org/en/tmux/latest/manual/split-window/). A refusal returns `unsupported` with the required release,
`effect = "not_sent"` and no process; a group with a refused item runs
nothing. The refused forms are:
| Command | Refused on | Reason |
| --- | --- | --- |
| [`delete-buffer -b`](https://libtmux.org/en/tmux/latest/manual/delete-buffer/), [`set-buffer -n`](https://libtmux.org/en/tmux/latest/manual/set-buffer/) | below 3.4 | A missing buffer name acts on another buffer. |
| [`select-layout`](https://libtmux.org/en/tmux/latest/manual/select-layout/) with a custom layout that has no checksum header | below 3.4 | tmux 3.3a crashes on an invalid layout. |
| [`select-layout`](https://libtmux.org/en/tmux/latest/manual/select-layout/) with a JSON layout | below 3.8 | Releases below 3.8 do not read JSON layouts. |
| [`split-window -p`](https://libtmux.org/en/tmux/latest/manual/split-window/) | 3.4 | The percentage flag is broken; use `-l N%`. |
| [`refresh-client -l`](https://libtmux.org/en/tmux/latest/manual/refresh-client/) | below 3.6a | tmux 3.3a exits at once when the attached client's `TERM` is `xterm-256color` or `tmux-256color`, and 3.4 through 3.6 can exit when that client leaves before its terminal answers. |
| [`break-pane`](https://libtmux.org/en/tmux/latest/manual/break-pane/) | exactly 3.7 | tmux 3.7 misnames windows; use [`Pane:break_out`](). |
| [`new-session -s/-n`](https://libtmux.org/en/tmux/latest/manual/new-session/), [`new-window -n`](https://libtmux.org/en/tmux/latest/manual/new-window/), [`rename-session`](https://libtmux.org/en/tmux/latest/manual/rename-session/), [`rename-window`](https://libtmux.org/en/tmux/latest/manual/rename-window/) with `:` or `.` in the name | exactly 3.7 | tmux 3.7 rejects those names. |
The check reads only the command a literal item starts with. It does not look
inside a tmux command string nested in another command, such as the argument
of [`if-shell`](https://libtmux.org/en/tmux/latest/manual/if-shell/) or [`run-shell -C`](https://libtmux.org/en/tmux/latest/manual/run-shell/), inside a brace block, inside the contents of
configured command aliases, or inside a key binding or hook, which tmux runs
without the library seeing the text. A refused form written that way reaches
tmux unchecked. Shell text that a command runs, such as the body of
[`run-shell`](https://libtmux.org/en/tmux/latest/manual/run-shell/), keeps native semantics.
What the nested copy does depends on the form in the table above:
| Nested form | Releases | Failure class |
| --- | --- | --- |
| [`break-pane`](https://libtmux.org/en/tmux/latest/manual/break-pane/) without `-n` | exactly 3.7 | The server exits ([source][break-pane-3-7]); the next command returns `stale_generation`. |
| [`select-layout`](https://libtmux.org/en/tmux/latest/manual/select-layout/) with an invalid layout string | 3.3a | The server exits. |
| [`refresh-client -l`](https://libtmux.org/en/tmux/latest/manual/refresh-client/) | 3.3a when the attached client's `TERM` is `xterm-256color` or `tmux-256color` (it survives `screen` and `vt100`); 3.4 through 3.6 when the attached client leaves before its terminal answers | The server can exit. 3.6a fixes the second case ([changes][clipboard-query]). |
| [`delete-buffer -b NAME`](https://libtmux.org/en/tmux/latest/manual/delete-buffer/), [`set-buffer -b NAME -n NEW`](https://libtmux.org/en/tmux/latest/manual/set-buffer/), with no buffer called `NAME` | below 3.4 | The newest buffer is deleted or renamed instead. |
| [`split-window -p`](https://libtmux.org/en/tmux/latest/manual/split-window/) | 3.4 | tmux answers with its own error and nothing changes. |
| [`select-layout`](https://libtmux.org/en/tmux/latest/manual/select-layout/) with a JSON layout | 3.4 and later, below 3.8 | tmux answers with its own error and nothing changes. |
| `:` or `.` in a session or window name | exactly 3.7 | tmux answers with its own error and nothing changes. |
On exactly tmux 3.7, [`if-shell -F 1 'break-pane -d'`](https://libtmux.org/en/tmux/latest/manual/if-shell/) passes the check and
stops the server, while a plain [`break-pane -d`](https://libtmux.org/en/tmux/latest/manual/break-pane/) is refused. Where the nested
text is written by hand or bound to a key (the default `prefix !` binding runs
[`break-pane`](https://libtmux.org/en/tmux/latest/manual/break-pane/), [source][prefix-bang]), name the new window with `-n`, or
upgrade to tmux 3.7a, which fixes the crash
([changes][changes-3-7a]). Exactly 3.7 ignores the `-n` name and gives the
window its default name: `-n` avoids the crash and nothing more. Do not use a plain [`break-pane`](https://libtmux.org/en/tmux/latest/manual/break-pane/) in nested text
there. Called directly, every literal [`break-pane`](https://libtmux.org/en/tmux/latest/manual/break-pane/) is refused on exactly 3.7,
with or without `-n`; use [`Pane:break_out`]().
[break-pane-3-7]: https://github.com/tmux/tmux/blob/3.7/cmd-break-pane.c#L117-L124
[prefix-bang]: https://github.com/tmux/tmux/blob/3.7/key-bindings.c#L358
[changes-3-7a]: https://github.com/tmux/tmux/blob/3.7a/CHANGES#L3
[clipboard-query]: https://github.com/tmux/tmux/blob/3.6a/CHANGES#L21
Native command aliases apply even to full built-in names, including commands
used by typed domain methods. Hooks can run additional commands and affect
state. The library does not change borrowed server configuration or promise
that aliases preserve built-in semantics. A preliminary configuration check
cannot prevent an alias from changing before a later command is parsed.
Use [`server:group(commands, options)`]() for an explicit ordered tmux command
group. Its result is aggregate output and exit status. Parse failure can
reject the whole group, immediate execution failure skips later commands,
and delayed WAIT-command failures can still allow later commands. A group
provides neither transactions nor independently attributed member results.
Output routing also follows tmux: [`run-shell`](https://libtmux.org/en/tmux/latest/manual/run-shell/) without a pane target writes
job output to pane view mode on tmux 3.3a and 3.4; tmux 3.5 onward
writes it to the waiting client's stdout. An explicit `-t` pane target
selects pane output. Without `-b`, client completion still waits for the job,
and a control-mode `%end` marker can precede that completion. See the upstream
[stdout restoration](https://github.com/tmux/tmux/commit/fb37d52ddeccb603b0932b81cff3a6228f1fd83d).
Use `server:batch(commands, { concurrency = n, process = options })` for
independent commands. Concurrency defaults to one and is bounded at 128;
runtime capacity can reduce the active pool. The result is an input-indexed
array of `completed`, `failed`, `unknown` or `skipped` outcomes, each with
`effect` and optional `value`/`error`. Nonzero exits are failed outcomes with
their actual result in [`error.partial`](). Other commands continue. A canceled
batch exposes a frozen `err.partial.outcomes` receipt; it preserves completed
results and distinguishes started work from work never sent.
All commands and process options are validated and copied before dispatch.
One submission accepts at most 1,024 commands, 4,096 total arguments and
16 MiB of input. NUL is rejected in argv and environment entries; raw stdin
can contain it. Never retry mutations automatically, especially after an
unknown effect. Canceling a client does not prove daemon work stopped.
Process options include [`stdin`](), `cwd`, explicit [`env`]() entries, `timeout`,
monotonic `deadline`, `max_output_bytes` (default 1 MiB), `drain_timeout`
(250 ms), and `kill_timeout` (100 ms). Timeout/deadline apply to the client
operation; pinned endpoint evidence uses a separate bounded check. Output
limits and runtime byte admission remain distinct. Excess batch output is
reported with byte counts and truncation metadata; it is not silently kept.
The raw API is an escape hatch. A successful [`send-keys`](https://libtmux.org/en/tmux/latest/manual/send-keys/) process does not
report the exit of a pane application.
---
# Observing a session
Source: https://libtmux.org/en/lua/v0.1.1/guides/control/
> Observing a session: libtmux documentation.
[`server:observe(session, options)`]() returns a Request for an observation lease.
Pass a session handle from that Server's snapshot or creation result. Concurrent
leases for the same session share one owned persistent client. General commands
use the [process command API](https://libtmux.org/en/lua/v0.1.1/guides/commands/).
Observation needs a daemon at tmux 3.7 or newer. On an older daemon,
[`server:observe`]() returns `unsupported` with `required = "3.7"` and
`effect = "not_sent"` before any lease, process or client exists, because a
short-lived control attach can crash servers that lack the 3.7 initialization
fixes. Ordinary commands, typed operations, snapshots and polling captures
stay available from tmux 3.3a; use [`pane:wait_for_text`](https://libtmux.org/en/lua/v0.1.1/guides/panes/#wait-for-text)
to poll the visible screen on any release.
Opening verifies the pinned daemon before spawning. The client's command
list starts with a fence on the checked pid, start time and version, so a
replaced daemon attaches nothing and reports `stale_generation`. Every client
uses `-N`; a missing session fails without creating a session or linking a
window. Each endpoint owns at most eight observation clients.
The observation offers:
- [`watch_pane(pane, options)`]() returns a ready pane-output watch for a pane handle.
- [`watch_notifications(options)`]() returns a ready notification watch,
preserving unknown events and raw lines.
- [`subscribe_format(pane, field_names, options)`]() returns a typed native
format watch using generated pane fields.
- [`coverage()`]() returns copied session/pane coverage and connection generation.
- `close()` closes this lease's watches; final close waits for native cleanup.
Handles must belong to the same Server. Their copied private identities select
targets; overwriting a public `reference` method cannot redirect observation.
Options are copied on submission. Shared connection limits must agree across
leases; conflicting options return `option_conflict`. Separate Server handles
have independent pools even when their socket paths match.
Canceling acquisition releases only that caller's claim. Startup continues for
remaining callers; canceling the final claim closes its client. Acquisition
during final cleanup returns `closing`. Await final `close()` before reopening;
a new connection has a distinct generation and requires new watches. A failed
startup also retains its pool entry until native cleanup finishes.
A new acquisition on a failed shared connection returns its recorded loss
error. Close the old leases before opening a fresh connection.
Watch creation installs its local receiver before a same-connection
[`list-panes`](https://libtmux.org/en/tmux/latest/manual/list-panes/) coverage check. A pane outside that session returns
`uncovered_pane`. Topology changes invalidate reported coverage and close
affected pane watches with `observation_gap`; opening a new watch performs
another bounded check. These checks are observations, not a topology
transaction. Capture remains a separate operation with no claimed lossless
handoff to the stream.
## Reading and closing
`watch:next({ timeout = milliseconds })` returns a Request for one event.
An absolute monotonic `deadline` is also supported. Only one read may be
pending on a watch; another returns `concurrent_read`. Canceling a read
detaches that waiter and leaves the watch usable. [`watch:close()`]() is explicit
and idempotent. An explicitly closed watch returns `nil, nil`; connection
failure or loss returns `nil, err`.
Pane events carry `kind = "output"`, `pane`, [`data`](), [`sequence`](), `generation`
and [`server_generation`](). [`data`]() is a Lua byte string, including NUL and
non-UTF-8 bytes. Extended output also preserves its decimal [`age`]() and
[`metadata`](). A sequence identifies ordering within one connection; it does
not imply complete pane history or application completion.
Format events carry `kind = "format"`, a typed `value`, and explicit
[`session_id`](https://libtmux.org/en/tmux/latest/catalog/formats/session_id/), [`window_id`](https://libtmux.org/en/tmux/latest/catalog/formats/window_id/), window-link `index` and `pane` context. Only catalog
field names are accepted. Unknown or unsupported fields fail before writes;
caller text cannot introduce a format expression. Registration acknowledgement
establishes readiness. Native values arrive on tmux's
[one-second sampling timer](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/control.c),
so readiness does not wait for the first sample. Native title normalization
and other daemon field behavior remain visible in the returned values.
Closing a format watch unregisters its subscription.
## Bounds and ownership
Defaults are 128 pending housekeeping replies, 128 watches, 4 MiB of retained
connection data, and 1 MiB or 1,024 events per watch. Each observation claim,
shared attachment and public watch consumes a runtime resource slot; the
default runtime limit is 128 resources in total. Runtime byte and logical
request limits also apply. Watch byte accounting includes event metadata;
subscription projections and queued encoded commands are charged before
deferred work begins.
Overflow closes the affected watch with `observation_gap`. Its partial result
reports discarded event count and decoded pane-byte count. Other watches and
the shared reader continue. Native `%pause` also invalidates pane continuity.
There is no silent drop policy, output coalescing, or claim that tmux pause is
lossless backpressure.
The reader parses bounded slices independently of watch consumption. Completion
callbacks run through the runtime scheduler; application callbacks must not
block the shared Lua event loop. A persistent connection occupies a resource
lease, not an active process slot. A pending `next` uses the separate bounded
logical-request lane.
The serialized writer accepts only private housekeeping operations. Arguments
are encoded for tmux's control-line parser. Bootstrap has its own response;
subsequent replies use FIFO attribution and matching guard tuples. A request
canceled after a possible write leaves a connection-owned tombstone until its
reply drains. A write or framing failure closes the connection and fails
pending callers. No command or pane input is retried or replayed.
Normal root return closes resource leases after owned requests retire.
Endpoint close or generation invalidation also closes its observation clients.
Native cleanup waits for exit, pipe closure and pending write callbacks.
Post-exit pipe drain is bounded at 250 ms. Explicit close first ends stdin;
after 100 ms it signals only the owned client, escalating after another
100 ms. It never signals the tmux daemon or a pane program.
## Attachment effects
The client uses [`attach-session -E -f ignore-size,active-pane`](https://libtmux.org/en/tmux/latest/manual/attach-session/) with an exact
session ID. It issues no shared pane/window selection, resizing, detachment
or session-environment updates. Native client listings, attachment state,
focus hooks and configured lifecycle policy remain observable. Hooks may
themselves change state; preservation fixtures use neutral hooks.
[`focus-events`](https://libtmux.org/en/tmux/latest/catalog/options/focus-events/) stays unchanged. Disabling it cannot suppress every attachment
focus hook, and tmux provides no supported client flag for that guarantee.
The transport does not create hidden sessions or change window links. It
omits `-r`: on tmux 3.7 and 3.7c, a read-only observer can make independent
process-lane [`send-keys`](https://libtmux.org/en/tmux/latest/manual/send-keys/) fail with "client is read-only". The private writer
restricts observation commands without that flag.
Closing an observer removes its attached client. Native policy such as
[`destroy-unattached`](https://libtmux.org/en/tmux/latest/catalog/options/destroy-unattached/) can then destroy its session. A startup check cannot
guarantee lifetime preservation when options or other clients can change.
The library does not rewrite borrowed options or retain hidden clients to
prevent that policy.
Housekeeping assumes the server's native command semantics. Aliases and hooks
can change even builtin commands; control framing does not authenticate server
output. This transport does not enable general command acceleration.
Automatic reconnect and subscription replay are not implemented. Opening a
new connection creates a distinct generation; callers must establish new
watches and treat the interval between connections as a gap.
---
# Pane operations
Source: https://libtmux.org/en/lua/v0.1.1/guides/panes/
> Pane operations: libtmux documentation.
Pane handles perform explicit asynchronous operations through the pinned
PROCESS endpoint. Each method returns a Request; await it inside a managed
runtime task or use its completion callback. Snapshot records remain plain
captured data. Obtain a handle from a creation receipt or [`server:handle`]().
```lua
local capture = assert(pane:capture({ history_lines = 20 }):await())
local text = assert(capture:text())
assert(pane:send_text("printf '%s\\n' ready"):await())
assert(pane:send_keys({ "Enter" }):await())
```
The executable [integration fixture](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/tests/integration/pane.lua) includes
connection setup, creation, output barriers and teardown.
## Capture and text
[`capture()`]() returns `{ bytes, target }` with a pure `text()` method. `bytes`
preserves tmux's stdout, including its terminal newline and invalid UTF-8.
`text()` validates UTF-8 strictly and returns the same string; invalid input
returns `nil, err` with `invalid_utf8`. It performs no replacement, trimming,
newline conversion or tmux I/O.
Ordinary capture reads rendered screen/history cells. It does not recover the
original PTY byte stream, prove application completion, or establish an
ordered handoff to observation. It does not enter, exit or navigate copy mode.
The default captures the visible terminal screen. `history_lines = N` adds
up to N history rows, bounded at 1,000,000. Alternatively, [`start_line`]() and
[`end_line`]() accept integer row offsets or `"-"`: zero is the first visible row,
negative offsets refer to history, `start_line = "-"` selects all retained
history and `end_line = "-"` selects the visible screen's end. Explicit ranges
cannot be combined with [`history_lines`](). tmux clamps ranges to available data.
| Option | Native behavior |
| --- | --- |
| [`join_lines`]() | Join wrapped rows and preserve trailing spaces (`-J`). |
| [`preserve_spaces`]() | Preserve trailing spaces (`-N`). |
| [`escape_sequences`]() | Include text/background attribute sequences (`-e`). |
| [`escape_nonprintable`]() | Request native octal escaping (`-C`). |
| [`alternate_screen`]() | Select tmux's alternate grid (`-a`); missing grid errors. |
| [`trim_empty_cells`]() | Omit trailing empty cells (`-T`); tmux 3.4 or later. |
| [`mode_screen`]() | Capture the active mode screen when available (`-M`); tmux 3.6 or later. |
| [`ignore_missing_alternate`]() | With [`alternate_screen`](), return one newline if the grid is missing (`-q`). |
| [`pending_escape_sequences`]() | Capture incomplete input held by tmux's parser (`-P`). |
| [`hyperlinks_only`]() | List native hyperlink URLs instead of cell text (`-H`); tmux 3.7 or later. |
| [`line_numbers`]() | Prefix rows with offsets relative to the visible screen (`-L`); tmux 3.7 or later. |
| [`line_flags`]() | Prefix rows with native grid flags (`-F`); tmux 3.7 or later. |
[`alternate_screen`]() cannot be combined with history, explicit ranges or
[`mode_screen`](). Unsupported version flags fail before dispatch.
[`pending_escape_sequences`]() selects parser input instead of screen cells. Only
[`escape_nonprintable`]() and process limits apply; other enabled capture options
are rejected. For example, a pending ESC followed by `[` produces `"\027[\n"`,
or `"\\033[\n"` with native octal escaping. The final newline belongs to tmux's
print output, not the pending input.
[`hyperlinks_only`]() preserves tmux's URL listing, including native deduplication
and spacing. It does not guarantee an exhaustive URL inventory: tmux limits
the number of distinct links collected to the grid width. Screen/range
selection, joined rows and line metadata still apply. Attribute sequences,
octal escaping, preserved spaces and empty-cell trimming are rejected because
tmux ignores them in this mode. No matches produce one newline.
[`line_numbers`]() and [`line_flags`]() preserve native prefixes; with both enabled,
the number precedes the flags. Flags include `D`, `H`, `O`, `P`, `W` and `X`
for dead, hyperlink, output-start, prompt-start, wrapped and extended rows;
`-` means none. The result remains bytes, not parsed row records.
The executable [capture fixture](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/tests/integration/capture.lua) demonstrates
the supported capture modes with output barriers and cleanup.
[`capture_to_buffer(name, options)`]() writes directly to an explicit named buffer
and returns `true` when the native command completes. It accepts the same
capture options and [buffer creation names](https://libtmux.org/en/lua/v0.1.1/guides/buffers/#storage-and-identity).
Nonempty capture replaces the current slot. Empty capture leaves an existing
buffer unchanged and does not create a missing buffer; this includes empty
pending input and quiet missing alternate grids.
Buffer capture stores native bytes without adding the print newline. A pending
ESC followed by `[` is stored as `"\027["`, whereas [`capture()`]() returns
`"\027[\n"`. Another client may replace the buffer before a subsequent read.
Process output limits bound client output, not storage inside the tmux daemon;
use a capture range to limit the selected rows.
## Wait for text
[`wait_for_text(text, options)`]() returns a Request that resolves with
`{ text, matched_at_entry }` once the visible screen contains `text`. The
search is a plain literal match, not a pattern. Wrapped rows are joined, so a
needle that straddles the pane width still matches. Only the visible screen is
read: rows that scrolled into history are not searched.
```lua
local found = must(pane:wait_for_text("build ok", { timeout = 5000 }):await())
```
Options:
- [`interval`](): milliseconds between reads, from 1; defaults to 100.
- `timeout`: milliseconds from the call. Expiry cancels the Request with
`deadline_exceeded`.
- `deadline`: an absolute time on the runtime driver clock, as for any other
Request.
With neither `timeout` nor `deadline` the wait runs until it matches, the pane
or server ends, or you call `:cancel(reason)`. An unknown option, empty or
non-string text, a non-plain options table, an [`interval`]() below 1, or a
`timeout` or `deadline` more than 2,147,483,647 ms away returns
`invalid_argument`.
The first read comes before the first pause. Text already on screen resolves
at once with `matched_at_entry = true`. There is no count of new occurrences:
a command that printed before the wait started is already on screen. To wait
only for new output, print a token the command produces after it ran, such as
`printf '%s%s' NEE''DLE`. The shell echoes what you type, so a command that
contains the contiguous needle matches its own echo.
Each read is one tmux invocation, [`capture-pane -p -J`](https://libtmux.org/en/tmux/latest/manual/capture-pane/) followed by
[`run-shell -C`](https://libtmux.org/en/tmux/latest/manual/run-shell/) with a marker that reports the pane id and whether the pane is
dead. It works on every supported release and never uses control mode. The
marker is a deliberate parse error, so the invocation exits 1 on success;
the wait ignores the exit code. Because the capture is an ordinary command,
the owner's [`after-capture-pane`](https://libtmux.org/en/tmux/latest/catalog/hooks/after-capture-pane/) hook runs on every read, and on tmux 3.5a and
later a hook that prints joins the captured text. [`run-shell -C`](https://libtmux.org/en/tmux/latest/manual/run-shell/) runs no hook
of its own.
The wait ends with one of these:
- Success: the result table.
- `deadline_exceeded` or the code passed to `:cancel(reason)`. Both carry the
latest screen in `err.partial.text` when one was read, including when the
deadline falls during a read.
- `pane_died` with `err.reason`: `pane_exited` when the program ended and the
pane remains ([`remain-on-exit`](https://libtmux.org/en/tmux/latest/catalog/options/remain-on-exit/)), `pane_gone` when the pane no longer exists,
and `server_gone` when the tmux server ended, whether the daemon refused the
connection or reported that it exited. `err.partial.text` holds the text
seen so far. A match on the last read wins over the verdict.
- `output_limit` if a read exceeds the process output limit, surfaced as is.
After the server ends, the `Server` handle is stale and later calls return
`stale_generation`; connect again.
## Clear history
[`clear_history()`]() clears the pane's retained history and exits all its modes,
including copy mode. It leaves visible screen cells intact. This is an
explicit shared-state mutation; cancellation of an unrelated Request never
calls it.
`clear_history({ clear_hyperlinks = true })` also clears hyperlink storage,
including links referenced by visible cells. This option requires tmux 3.4;
older versions return `unsupported` before changing history or mode state.
Success returns `true` under the same process, generation and error contracts
as the other Pane mutations.
## Text, keys and copy mode
[`send_text(text)`]() sends bounded NUL-free UTF-8 with native [`send-keys -l`](https://libtmux.org/en/tmux/latest/manual/send-keys/).
It appends no Enter. A CR or LF already present in the argument remains
explicit caller input. It accepts at most 65,536 bytes; arbitrary binary
input is not part of this method.
[`send_keys(names, options)`]() accepts a dense sequence of up to 1,024 names.
Supported names include Enter, Escape, Tab, BTab, Space, BSpace, arrows,
Home/End, Insert/Delete and their IC/DC aliases, PageUp/PageDown aliases,
F1–F12 and numeric keypad names. C-, M- and S- modifiers may prefix these
names or one printable ASCII character. Names are bounded at 64 bytes.
[`repeat_count`]() is an integer from 1 to 1,000. Typos return `invalid_key`;
recognized deferred native categories such as mouse and user-defined keys
return `unsupported`. Unmodified literal characters belong in [`send_text`]().
Both methods preserve native mode and [`synchronize-panes`](https://libtmux.org/en/tmux/latest/catalog/options/synchronize-panes/) behavior. Modes can
intercept input; synchronization can copy it to sibling panes. Dead or
input-disabled panes can accept a command without delivering input. Success
means tmux processed the operation, not that an application consumed it.
The library does not change these policies or infer shell-command success.
`copy_mode({ page_up = true })` explicitly enters copy mode. [`copy_command`]()
sends one validated action through [`send-keys -X`](https://libtmux.org/en/tmux/latest/manual/send-keys/), with optional arguments
and [`repeat_count`](). Entry, navigation and cancellation affect shared pane UI.
No automatic cleanup exits a mode that another client may be using.
The initial action subset includes cursor/word/paragraph/page/history
navigation, selection marking, rectangle modes, refresh, search and jumps.
For example:
```lua
assert(pane:copy_mode():await())
assert(pane:copy_command("search-forward-text", { "ready" }):await())
assert(pane:copy_command("page-up", {}, { repeat_count = 2 }):await())
assert(pane:copy_command("cancel"):await())
```
Unknown actions or incorrect argument counts return `invalid_copy_command`.
Recognized deferred actions return `unsupported`, including copy/append,
clipboard/pipe actions and newer navigation commands. This subset does not
claim complete native [copy-mode](https://libtmux.org/en/tmux/latest/manual/copy-mode/) parity. Native command completion does not
guarantee a search match or cursor movement.
## Resize, kill and respawn
`resize({ width = N, height = N })` requests absolute dimensions;
`resize({ direction = "left", amount = N })` adjusts one direction. Forms are
mutually exclusive, dimensions/amount are 1–65,535 and adjustment defaults to
one. Native layout constraints can clamp the result, resize neighbors and
unzoom the window. Obtain a fresh snapshot when the resulting geometry matters.
`kill()` targets only the handle's pane ID. Native removal of the last pane
also destroys its window and can remove links or empty sessions elsewhere.
This is an explicit mutation; canceling another Request never calls it.
`respawn(options)` reuses the same pane identity. Without `kill = true`, an
active pane produces a native error. Omitted `argv`/`shell` reuses its previous
program; explicit launch options follow [creation](https://libtmux.org/en/lua/v0.1.1/guides/creation/), including
absolute `cwd`, environment and separate literal argv/shell forms. Respawn
resets the terminal screen and mode. It can terminate the old program before
a later spawn failure, and tmux success does not prove executable startup.
These methods return `true` on successful native completion. They preserve
typed errors and partial command output on failure, with no automatic retry.
All options must be plain records. The nested `process` record accepts timeout,
deadline, output limit and drain/kill timeouts as described in
[commands](https://libtmux.org/en/lua/v0.1.1/guides/commands/). Generation validation and runtime byte limits apply
before dispatch; native completion still waits for client exit and both EOFs.
## Selection, titles and swaps
`select()` changes the window's shared active pane. It unzooms when changing
panes unless `keep_zoom = true`. This explicit mutation affects other clients
and can run native focus and selection hooks.
[`set_title(text)`]() sends format-literal UTF-8: [`#{pane_id}`](https://libtmux.org/en/tmux/latest/catalog/formats/pane_id/) stays text. NUL,
ASCII control bytes and DEL are rejected before dispatch because native tmux
can silently ignore them. The limit is 65,536 bytes. Exact tmux 3.7 also
silently ignores empty titles, so that combination returns `unsupported`.
Other accepted releases allow clearing the title. tmux's native name cleaning
still applies; from 3.7, backslashes can be doubled. Completion does not
promise byte-exact storage for every accepted title.
`swap(other_pane, options)` swaps two explicit, different panes from the same
Server. Their stable IDs follow them into their new windows. The default uses
native `-d`: across windows, an active pane moved out is replaced at its old
position. Within one window, an active source pane can remain selected after
moving positions. Neither active identity nor active position is preserved in
every case. `select = true` uses native selection of the swapped panes.
`keep_zoom = true`
preserves each window's zoom. Swaps change inherited window options and the
pane relationships visible through every linked window.
These methods return `true` on native completion and share the process limits
above. Missing targets retain the native failure and its partial receipt.
See [topology operations](https://libtmux.org/en/lua/v0.1.1/guides/topology/) for Session and Window mutations.
---
# Query captured data
Source: https://libtmux.org/en/lua/v0.1.1/guides/query/
> Query captured data: libtmux documentation.
[`libtmux.query`]() filters ordinary Lua records without contacting tmux, starting
a loop, or loading a codec. Supply a schema for an ordinary sequence, including
an empty one. [The native query example](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/examples/native_query.lua) shows
both structured criteria and a Lua predicate over the same records.
[`query.select(rows, schema)`]() copies the sequence and retains the record objects.
The result is a dense one-based Lua table: indexing, `#` and `ipairs` behave
normally. `:where(criteria)` and `:filter(predicate)` return new selections.
They preserve input order, duplicate records and shared record references.
The input and returned tables remain mutable; they are not live views.
| Operation | Result |
| --- | --- |
| `:first()` | First record, or nil |
| `:one()` | Record, or `nil, no_match/multiple_matches` error |
| `:one_or_nil()` | Zero or one record; multiple matches return an error |
| `:exists()` / `:count()` | Whether any records exist / sequence length |
| `:iter()` | Fresh local iterator yielding records |
| `:to_table()` | Shallow sequence copy without selection methods |
Free functions accept the sequence first and its schema last. A selection
carries its schema. [`query.compile(schema, criteria)`]() returns a compiled handle
or `nil, err`; [`query.where(rows, compiled)`]() uses that handle's schema for
ordinary rows. Compilation copies the schema and criteria. Mutating their
original tables cannot change the compiled query. Convenience validation errors
raise structured error tables; [`compile`]() and cardinality errors return them.
Trusted predicates run as ordinary Lua and their errors propagate unchanged.
## Criteria and projections
Schema fields declare [`string`](), [`number`]() or [`boolean`](), with optional `nullable`
and `supported` booleans. Relations declare `cardinality = "one"` or `"many"`
and a child [`schema`](). To-many arrays must describe the complete relationship.
Scalar criteria are equality shorthand; `false` is a value. Operators are
[`eq`](), [`ne`](), [`one_of`](), [`none_of`](), [`lt`](), [`lte`](), [`gt`](), [`gte`](), [`contains`](),
[`starts_with`](), [`ends_with`]() and [`is_null`](). Strings compare literal bytes.
[`AND`]()/[`OR`]() contain dense arrays of criteria; [`NOT`]() contains one criterion.
Multiple fields and operators imply AND. To-many relations use [`some`](), [`every`]()
or [`none`](); to-one relations use [`is`]() or [`is_not`]() with criteria or [`query.NULL`]().
[`query.NULL`]() represents a loaded absent nullable value or to-one relation.
A missing key is unloaded. Unloaded and unsupported data produce errors even
inside branches that would otherwise short-circuit. The entire grammar is
validated first, then every required projection, then matching begins. Invalid
criteria fail even when the input is empty.
Empty criteria and [`AND`]() match; empty [`OR`]() and [`one_of`]() do not; empty [`none_of`]()
matches. On empty relationships, [`some`]() is false and [`every`]()/[`none`]() are true.
For an absent to-one relation, `is = criteria` is false, `is_not = criteria`
is true, `is = NULL` is true, and `is_not = NULL` is false.
Criteria reject metatables, functions, cycles and non-finite numbers. Limits
are depth 32, 4,096 copied nodes, 1,024 members per membership operator,
65,536 aggregate string/key bytes and a conservative 524,288-byte encoding
estimate. These limits bound criteria validation. Local row traversal and
arbitrary caller predicates are synchronous CPU work.
## Versioned JSON criteria
[`query.encode_json(schema, criteria, codec)`]() returns a JSON string or `nil, err`.
[`query.decode_json(schema, text, codec)`]() returns new plain criteria tables or
`nil, err`. Both validate the complete grammar against the supplied local
schema. The wire does not supply its own schema or executable predicates.
Pass the consumer's codec explicitly. The supported interface is lunajson
1.2.3's `encode(value, null)` and `newparser(text, callbacks)` SAX API; an
ordinary JSON `decode` function cannot preserve evidence of duplicate keys.
Core imports and ordinary queries require only Lua. Codec functions are
trusted synchronous code; the library does not load a codec automatically.
```lua
local query = require("libtmux.query")
local json = require("lunajson")
local schema = { fields = { active = { type = "boolean" } } }
local text = assert(query.encode_json(schema, { active = false, AND = {} }, json))
local criteria = assert(query.decode_json(schema, text, json))
```
This Lua API's versioned profile has exactly two envelope members:
```json
{"version":"libtmux.where/v1","where":{"active":false,"AND":[]}}
```
Profile compatibility is scoped to this Lua API; cross-port conformance has
not been established. Wire operators retain their Lua spelling, including
uppercase [`AND`](), [`OR`]() and [`NOT`](). Unknown members and versions are rejected.
Schema positions determine array versus object encoding: empty [`AND`](), [`OR`](),
[`one_of`]() and [`none_of`]() use `[]`; empty criteria use `{}`. Decode rejects a
container of the wrong kind, including an empty object in an array position.
[`query.NULL`]() becomes JSON null and decodes back to the same sentinel. False
remains false. Encoding marks arrays only in private copies and leaves caller
criteria and schemas unchanged.
The decoder rejects duplicate decoded keys, trailing non-whitespace, malformed
Unicode, invalid UTF-8 and non-finite numbers. Wire numbers have magnitude at
most 9,007,199,254,740,991; nonzero number tokens that underflow to zero are
rejected. Numbers otherwise use the host's floating-point representation.
Strings containing arbitrary non-UTF-8 bytes remain usable in local criteria
and require a separate binary representation at a consumer boundary.
Input is capped at 524,288 bytes before constructing the SAX parser. Parsing
checks depth 32, 4,096 nodes and 65,536 aggregate decoded string/key bytes as
events arrive. Membership remains capped at 1,024 values. Encoding applies the
same wire budgets and output-byte cap. Envelope members and keys count toward
wire limits, so criteria at a local limit may exceed a wire limit.
Errors retain `code`, `operation`, `message` and `path`. `invalid_json` covers
syntax and scalar encoding failures, `invalid_wire` covers envelope/container
shape, and `unsupported_wire_version` rejects another profile version.
`invalid_codec` and `codec_error` report absent or failing injected codecs.
Existing grammar errors and `query_limit` remain structured errors as well.
## Query live state explicitly
[`server:query_panes(options)`]() returns a `Request>`.
[`server:query(options)`]() accepts `kind` for session, window, pane, window_link,
client or buffer records. Both return [`rows`](), a canonical Selection, plus the
captured `snapshot`, executed [`plan`](), acquisition interval, `complete` flag
and detected `races`. Collection methods on these results remain local.
Pass structured `where` criteria and choose a `pushdown` mode:
| Mode | Behavior |
| --- | --- |
| `never` | Capture the graph and evaluate all criteria locally. |
| `auto` | Also apply supported necessary pane predicates at the source. |
| `require` | Reject an incomplete native translation before any listing. |
Native translation currently supports bounded equality tests on selected pane
IDs, booleans and integer fields. Other criteria remain local. AND can supply
necessary source predicates; partial OR, NOT and relationship predicates
cannot. All entity kinds support local evaluation. `require` for another
entity kind reports `unsupported_pushdown`.
[`server:explain_panes(options)`]() and [`server:explain(options)`]() return Requests
with the ordered command phases, projections, relation hydration paths,
pushed predicates and residual reasons. Explaining performs no tmux I/O.
Inputs and projections validate before any live dispatch and are copied so
later caller mutation cannot change the query.
The `snapshot` option accepts [snapshot acquisition options](https://libtmux.org/en/lua/v0.1.1/guides/snapshots/).
Required criterion fields are added to explicit projections. The current
implementation captures the whole relationship graph before an optional
native candidate listing. It preserves canonical order and linked-window
context; filtering candidate IDs never removes children from quantified
relationships. This establishes semantics, not a performance advantage.
The graph and candidate listing cover different moments. `candidate_missing`
reports a candidate absent from the captured graph; `candidate_changed`
reports disagreement with a pushed predicate. `complete=true` means no known
inconsistency, not an atomic view. [`snapshot.strict`]() adds its one topology
verification pass; it cannot freeze state across the later candidate listing.
The acquisition interval covers both phases. Snapshot and candidate listing
each apply the requested row/byte limits; retained data also shares the
runtime byte budget.
Expert `native_filter` accepts an explicit pane format, up to 16 KiB. It is
mutually exclusive with `where` and `pushdown`. It uses tmux's format language
as supplied, has no equivalent local predicate, and receives no portability
guarantee. Use structured criteria for untrusted data.
The [public live-query fixture](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/tests/integration/live_query.lua) exercises
linked-window duplicates, projected fields, relationship quantifiers and an
expert filter through both adapters.
---
# Read and paste named buffers
Source: https://libtmux.org/en/lua/v0.1.1/guides/buffers/
> Read and paste named buffers: libtmux documentation.
Buffers hold bytes in the tmux daemon. Use an explicit name for every read,
write, deletion and paste; these methods never infer the most recent buffer.
Each live operation returns a Request through the PROCESS endpoint.
```lua
assert(server:set_buffer("build-output", "one\000two\n"):await())
local content = assert(server:show_buffer("build-output"):await())
assert(content.bytes == "one\000two\n")
assert(pane:paste_buffer("build-output", {
bytes = "raw",
linefeed_separator = true,
}):await())
```
The executable [integration fixture](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/tests/integration/buffer.lua) includes
connection setup, owned pane readers, output barriers and teardown.
## Storage and identity
[`server:set_buffer(name, bytes)`]() replaces the current value at that name.
Input accepts one byte through one MiB, including NUL, invalid UTF-8 and
trailing newlines. It uses native stdin loading, so no shell or argv decoder
processes the value. Empty input is rejected with `invalid_argument`: tmux
would accept it without creating or clearing a buffer. Delete explicitly to
remove the value.
New names must be nonempty UTF-8, at most 4,096 bytes, without NUL, ASCII
controls, DEL or backslash. The excluded creation forms return
`unsupported_name`; some tmux releases accept them, while newer name cleaning
can change their stored key. Further native name validation still applies.
Spaces, leading dashes and `#{...}` are literal. Buffer names do not undergo
tmux format expansion.
Use [`pane:capture_to_buffer(name, options)`](https://libtmux.org/en/lua/v0.1.1/guides/panes/#capture-and-text) to
store a native pane capture directly. It uses these creation-name rules;
empty capture leaves the named slot unchanged. Native buffer capture does
not add the newline used by capture's printed output.
[`server:show_buffer(name)`]() returns `{ name, bytes }` with a pure `text()`
method. `bytes` preserves exact stdout. `text()` requires valid UTF-8 and
performs no trimming, replacement or newline normalization. Invalid UTF-8
returns `nil, err` with `invalid_utf8`. Mutating this returned record changes
neither the daemon's value nor future Requests.
[`server:delete_buffer(name)`]() removes the current value on tmux 3.4 and later.
It returns `unsupported` before dispatch on 3.3a: that release
can delete the most recent buffer when the requested name is missing. Checking
existence first would still race with other clients. A literal
[`delete-buffer -b`](https://libtmux.org/en/tmux/latest/manual/delete-buffer/) or [`set-buffer -n`](https://libtmux.org/en/tmux/latest/manual/set-buffer/) through [`server:command`]() is refused on
the same releases. This limitation does not
affect [`paste_buffer`]() with [`delete_after`](), whose native lookup rejects missing
names before deletion.
Read, delete and paste accept broader exact observed names: nonempty NUL-free
strings up to 4,096 bytes. On supported operations, a missing buffer retains
tmux's error and native receipt.
A name identifies a current slot, not a persistent buffer incarnation. Another
client can replace its value after a snapshot or read. These methods operate
on the value present when tmux executes them; no preflight or transaction
claim hides that possibility.
## Paste behavior
[`pane:paste_buffer(name, options)`]() targets the handle's exact pane ID and adds
no Enter. Completion means the native command finished; it does not prove an
application received or consumed the bytes.
| Option | Behavior |
| --- | --- |
| `bytes = "native"` | Default: preserve the connected daemon's native policy. tmux 3.7+ sanitizes control and invalid UTF-8 bytes; earlier releases paste raw bytes. |
| `bytes = "raw"` | Disable that sanitization with `-S` on 3.7+; earlier releases already behave this way. Newline conversion remains separately controlled. |
| `linefeed_separator = true` | Preserve LF. By default, tmux changes each LF to CR. |
| `separator = text` | Replace each LF with this bounded NUL-free string, including empty. Excludes [`linefeed_separator`](), even explicit false. |
| `bracket = true` | Add native bracketed-paste wrappers only when the pane has enabled that terminal mode. |
| `delete_after = true` | Remove the named buffer after native paste processing. |
Input-disabled panes can accept paste without receiving bytes, including a
successful [`delete_after`](). Paste does not use the [send-keys](https://libtmux.org/en/tmux/latest/manual/send-keys/) dispatcher; do not
assume its [copy-mode](https://libtmux.org/en/tmux/latest/manual/copy-mode/) or synchronized-pane routing. Native aliases and hooks
remain observable as described in [command execution](https://libtmux.org/en/lua/v0.1.1/guides/commands/).
## Bounds and effects
Options must be plain records and are copied before dispatch. The nested
`process` options accept timeout, deadline, output limit and drain/kill limits
from [Pane operations](https://libtmux.org/en/lua/v0.1.1/guides/panes/). Buffer output defaults to one MiB and cannot
be raised above that bound. Overflow returns an error with available partial
output, never a successful truncated BufferValue.
Runtime input and output reservations remain charged through delivery.
Closed or stale generations reject new work; continuity lost after native
success preserves `effect = "completed"` and the receipt. Cancellation after
dispatch can have an unknown effect and never retries the mutation or kills
the target pane.
Binary append, buffer renaming and explicit file load/save remain pending
typed APIs. No read-concatenate-write operation is presented as atomic.
---
# Switch and detach clients
Source: https://libtmux.org/en/lua/v0.1.1/guides/clients/
> Switch and detach clients: libtmux documentation.
Use an explicit client name and TTY from a snapshot. A selector addresses the
current attachment at that name, including a replacement that attached after
the snapshot. Client records do not prove attachment continuity.
Inside a [runtime task](https://libtmux.org/en/lua/v0.1.1/guides/runtime/), with a connected `server`, choose the
client and destination session by their observed names:
```lua
local snapshot = assert(server:snapshot():await())
local observed = snapshot.clients:where({ name = "/dev/pts/7" }):one()
local record = snapshot.sessions:where({ name = "work" }):one()
local destination = assert(server:handle(snapshot, record))
local selector = { name = observed.name, tty = observed.tty }
assert(server:switch_client(selector, destination):await())
```
[`switch_client`]() requires a Session handle from the same Server. Its private
session ID determines the destination; changing a returned reference cannot
redirect the request. By default, switching preserves the destination's
environment. Set `{ update_environment = true }` to apply the client's native
[`update-environment`](https://libtmux.org/en/tmux/latest/catalog/options/update-environment/) values. Switching still triggers tmux's attachment,
selection, sizing, focus and lifecycle effects.
[`server:detach_client(selector)`]() detaches that current client. It neither
detaches all clients nor requests a parent-process signal or shell command.
Success means the native detach command completed; it does not mean the
borrowed terminal process was reaped. Closing the library connection leaves
other attached clients running.
Both methods return Requests that resolve to `true` on native completion.
The [owned-terminal fixture](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/tests/integration/test_client.py) runs these
[public API operations](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/tests/integration/client.lua) through standalone
Lua and Neovim, including same-process reconnection and environment updates.
## Selection and failure
The selector must be a plain record containing only `name` and `tty`.
Both are exact NUL-free byte strings of at most 4,096 bytes. `name` must be
nonempty; `tty` may be empty for a client without a terminal. No implicit
current client or abbreviated name is selected.
A fresh listing checks the complete name/TTY pair and native lookup aliases.
Missing pairs return `missing_target`; multiple native matches return
`ambiguous_target`. Neither dispatches a mutation. The listing and mutation
are separate commands: another attachment can replace the selected client
between them. No PID or timestamp check can prove continuity across native
detach/exec/reconnect. Use these methods only when addressing the current
attachment is the intended operation.
Selectors and options are copied before I/O. Closed handles and stale daemon
generations reject work. A failure before mutation dispatch has
`effect = "not_sent"`; cancellation after dispatch may have an unknown effect.
Continuity loss after success retains the native receipt and
`effect = "completed"`. Mutations are never retried automatically. Native
aliases and hooks follow the [command execution contract](https://libtmux.org/en/lua/v0.1.1/guides/commands/).
The `process` options accept `timeout`, `deadline`, `max_output_bytes`,
`drain_timeout` and `kill_timeout`. The output cap defaults to one MiB and
cannot exceed it. Each subprocess has its own timeout; an absolute deadline
also bounds later subprocesses. Preflight accepts at most 1,024 client rows.
Malformed or oversized listings fail without mutating a target. Runtime byte
capacity covers input, listing data and native receipts through delivery.
## Interactive attachment
[`session:attach()`]() returns `unsupported_tty` before spawning: the current luv
and Neovim adapters do not own an interactive terminal. It does not borrow
the editor's terminal or turn a control observation into an interactive
attachment. Interactive terminal ownership, client navigation, key tables
and read-only toggles remain pending capabilities.
---
# tmux option and hook reference
Source: https://libtmux.org/en/lua/v0.1.1/guides/options/
> tmux option and hook reference: libtmux documentation.
This generated catalog records every canonical built-in option and hook
in the supported tmux releases listed below. It describes native types
and storage scopes; it does not establish runtime or platform compatibility.
Edit [the catalog](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/data/tmux-options.json), then regenerate:
```console
$ python scripts/generate_options.py
```
Check generated Lua metadata and this reference without changing files:
```console
$ python scripts/generate_options.py --check
```
Both commands run offline with Python and the pinned StyLua formatter.
`--verify-source` additionally accepts a local tmux Git checkout and checks
every release tag, pinned source digest, definition and line anchor. It
does not download sources, build tmux or start a server.
## Values and scopes
Built-in names select their native storage scope; command flags alone do
not enforce the caller's intended scope. Session and window defaults are
separate global stores. Pane-capable options also support window storage;
there is no global pane store. Unknown release strings require new source
evidence: the private catalog does not fall back to the latest version.
Flags use booleans, numbers use exact bounded integers, and choices use
literal strings, including numeric-looking choices such as `"24"`. Keys,
colours, styles and commands retain their native string grammars. A command
value is tmux command-list source, not shell argv. Native grammar validation
and remote conditions such as shell suitability still require tmux.
Arrays retain native zero-based sparse indices and their element type.
The separator is a set of splitting characters, not a reversible codec.
An omitted array separator means space/comma; an empty separator preserves
one complete command-list entry. Indexed assignment avoids splitting.
All built-in hooks are command arrays; a scalar command option is not a
hook. User options beginning with `@` are separate string scalars.
Global built-in unset restores the default; local unset removes an override.
Native aliases, prefix matching, default values and descriptive option text
are outside this catalog. Source integer limits assume the supported target
ABIs' 32-bit `int` and 16-bit `short`; the largest bound is 4294967295.
## Source releases
| Release | Built-ins, including hooks | Hooks |
| --- | ---: | ---: |
| [3.3a](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c) | 181 | 65 |
| [3.4](https://github.com/tmux/tmux/blob/9ae69c3795ab5ef6b4d760f6398cd9281151f632/options-table.c) | 186 | 65 |
| [3.5](https://github.com/tmux/tmux/blob/ac44566c9c7e3e94d23be6def4c7ae83472543f5/options-table.c) | 190 | 66 |
| [3.5a](https://github.com/tmux/tmux/blob/549c35b06165f6ae023115eb76f83f2cbf945395/options-table.c) | 190 | 66 |
| [3.6](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c) | 210 | 68 |
| [3.6a](https://github.com/tmux/tmux/blob/cc117b5048f77a4842820f8ebbe3a86e5c077224/options-table.c) | 210 | 68 |
| [3.6b](https://github.com/tmux/tmux/blob/0623d1e968423ad0c192e0d8debf1258671063d5/options-table.c) | 210 | 68 |
| [3.7](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c) | 221 | 68 |
| [3.7a](https://github.com/tmux/tmux/blob/0e418b62d259ce8da8970f75732cc6632ee4c3a0/options-table.c) | 221 | 68 |
| [3.7b](https://github.com/tmux/tmux/blob/e802909de06012a4df6209d55e86487c56223163/options-table.c) | 221 | 68 |
| [3.7c](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/options-table.c) | 221 | 68 |
| [3.7d](https://github.com/tmux/tmux/blob/0d7b9e87f45d51e96c4f6f26450bcbb2411f11c8/options-table.c) | 221 | 68 |
| [3.8](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c) | 272 | 89 |
| [next-3.9](https://github.com/tmux/tmux/blob/b17d3da7cd84114e4c58630637f0b80428c0aa34/options-table.c) | 270 | 89 |
Full commit identities, hashes for `options-table.c`, `options.c` and
`tmux.h`, and per-entry source anchors are recorded in the source catalog.
Repeated release labels below mean the extracted metadata is identical,
not that defaults or other native behavior are identical.
## Options
| Name | Releases | Scope | Value | Array separator |
| --- | --- | --- | --- | --- |
| [`activity-action`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L383) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | [`none`](), [`any`](), `current`, `other` | — |
| [`aggressive-resize`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L794) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | flag | — |
| [`allow-passthrough`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L804) | 3.3a | window, pane | flag | — |
| [`allow-passthrough`](https://github.com/tmux/tmux/blob/9ae69c3795ab5ef6b4d760f6398cd9281151f632/options-table.c#L859) | 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | `off`, `on`, `all` | — |
| [`allow-rename`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L812) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | flag | — |
| [`allow-set-title`](https://github.com/tmux/tmux/blob/ac44566c9c7e3e94d23be6def4c7ae83472543f5/options-table.c#L900) | 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | flag | — |
| [`alternate-screen`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L820) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | flag | — |
| [`assume-paste-time`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L391) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | 0..2147483647 | — |
| [`automatic-rename`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L828) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | flag | — |
| [`automatic-rename-format`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L835) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | string | — |
| [`backspace`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L205) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | key | — |
| [`base-index`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L402) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | 0..2147483647 | — |
| [`bell-action`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L411) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | [`none`](), [`any`](), `current`, `other` | — |
| [`buffer-limit`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L212) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | 1..2147483647 | — |
| [`clear-on-attach`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L312) | 3.8, next-3.9 | server | flag | — |
| [`clock-mode-colour`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L843) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d | window | colour | — |
| [`clock-mode-colour`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1322) | 3.8, next-3.9 | window | colour | — |
| [`clock-mode-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L850) | 3.3a, 3.4, 3.5, 3.5a | window | `12`, `24` | — |
| [`clock-mode-style`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L1093) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | `12`, `24`, `12-with-seconds`, `24-with-seconds` | — |
| [`codepoint-widths`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L306) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | string; sparse array | `","` |
| [`command-alias`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L222) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | string; sparse array | `","` |
| [`copy-command`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L237) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | string | — |
| [`copy-mode-current-line-number-style`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L1208) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`copy-mode-current-line-style`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1448) | 3.8, next-3.9 | window | style string | — |
| [`copy-mode-current-match-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L867) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`copy-mode-line-number-style`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L1217) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`copy-mode-line-numbers`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L1226) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | `off`, `default`, `absolute`, `relative`, `hybrid` | — |
| [`copy-mode-mark-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L876) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`copy-mode-match-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L858) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`copy-mode-position-format`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L1128) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | string | — |
| [`copy-mode-position-style`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L1140) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`copy-mode-selection-style`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L1149) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`cursor-colour`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L245) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d | window, pane | colour | — |
| [`cursor-colour`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L354) | 3.8, next-3.9 | window, pane | colour | — |
| [`cursor-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L252) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | `default`, `blinking-block`, `block`, `blinking-underline`, `underline`, `blinking-bar`, `bar` | — |
| [`dark-theme-black`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L574) | 3.8, next-3.9 | server | colour | — |
| [`dark-theme-blue`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L630) | 3.8, next-3.9 | server | colour | — |
| [`dark-theme-cyan`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L638) | 3.8, next-3.9 | server | colour | — |
| [`dark-theme-dark-grey`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L598) | 3.8, next-3.9 | server | colour | — |
| [`dark-theme-green`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L606) | 3.8, next-3.9 | server | colour | — |
| [`dark-theme-light-grey`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L590) | 3.8, next-3.9 | server | colour | — |
| [`dark-theme-magenta`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L646) | 3.8, next-3.9 | server | colour | — |
| [`dark-theme-red`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L622) | 3.8, next-3.9 | server | colour | — |
| [`dark-theme-white`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L582) | 3.8, next-3.9 | server | colour | — |
| [`dark-theme-yellow`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L614) | 3.8, next-3.9 | server | colour | — |
| [`default-client-command`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L338) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | command | — |
| [`default-command`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L419) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | string | — |
| [`default-shell`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L427) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | string | — |
| [`default-size`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L434) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | string | — |
| [`default-terminal`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L260) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | string | — |
| [`destroy-unattached`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L442) | 3.3a | session | flag | — |
| [`destroy-unattached`](https://github.com/tmux/tmux/blob/9ae69c3795ab5ef6b4d760f6398cd9281151f632/options-table.c#L488) | 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | `off`, `on`, `keep-last`, `keep-group` | — |
| [`detach-on-destroy`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L450) | 3.3a | session | `off`, `on`, `no-detached` | — |
| [`detach-on-destroy`](https://github.com/tmux/tmux/blob/9ae69c3795ab5ef6b4d760f6398cd9281151f632/options-table.c#L497) | 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | `off`, `on`, `no-detached`, [`previous`](), `next` | — |
| [`display-panes-active-colour`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L459) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d | session | colour | — |
| [`display-panes-active-colour`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1338) | 3.8, next-3.9 | window | colour | — |
| [`display-panes-border-style`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1346) | 3.8, next-3.9 | window | style string | — |
| [`display-panes-colour`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L466) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d | session | colour | — |
| [`display-panes-colour`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1355) | 3.8, next-3.9 | window | colour | — |
| [`display-panes-format`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1363) | 3.8, next-3.9 | window | string | — |
| [`display-panes-time`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L473) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d | session | 1..2147483647 | — |
| [`display-panes-time`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1372) | 3.8, next-3.9 | window | 1..2147483647 | — |
| [`display-time`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L483) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | 0..2147483647 | — |
| [`editor`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L267) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | string | — |
| [`escape-time`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L274) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | 0..2147483647 | — |
| [`exit-empty`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L284) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | flag | — |
| [`exit-unattached`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L291) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | flag | — |
| [`extended-keys`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L299) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | `off`, `on`, `always` | — |
| [`extended-keys-format`](https://github.com/tmux/tmux/blob/ac44566c9c7e3e94d23be6def4c7ae83472543f5/options-table.c#L320) | 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | `csi-u`, `xterm` | — |
| [`fill-character`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L885) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | string | — |
| [`focus-events`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L308) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | flag | — |
| [`focus-follows-mouse`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L670) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | flag | — |
| [`get-clipboard`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L414) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | `off`, `buffer`, `request`, `both` | — |
| [`history-file`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L315) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | string | — |
| [`history-limit`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L493) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | 0..2147483647 | — |
| [`initial-repeat-time`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L664) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | 0..2000000 | — |
| [`input-buffer-size`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L416) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | 1048576..4294967295 | — |
| [`key-table`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L505) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | string | — |
| [`light-theme-black`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L654) | 3.8, next-3.9 | server | colour | — |
| [`light-theme-blue`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L710) | 3.8, next-3.9 | server | colour | — |
| [`light-theme-cyan`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L718) | 3.8, next-3.9 | server | colour | — |
| [`light-theme-dark-grey`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L678) | 3.8, next-3.9 | server | colour | — |
| [`light-theme-green`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L686) | 3.8, next-3.9 | server | colour | — |
| [`light-theme-light-grey`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L670) | 3.8, next-3.9 | server | colour | — |
| [`light-theme-magenta`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L726) | 3.8, next-3.9 | server | colour | — |
| [`light-theme-red`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L702) | 3.8, next-3.9 | server | colour | — |
| [`light-theme-white`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L662) | 3.8, next-3.9 | server | colour | — |
| [`light-theme-yellow`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L694) | 3.8, next-3.9 | server | colour | — |
| [`lock-after-time`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L513) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | 0..2147483647 | — |
| [`lock-command`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L523) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | string | — |
| [`main-pane-height`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L892) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | string | — |
| [`main-pane-width`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L900) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | string | — |
| [`menu-border-lines`](https://github.com/tmux/tmux/blob/9ae69c3795ab5ef6b4d760f6398cd9281151f632/options-table.c#L359) | 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | `single`, `double`, `heavy`, `simple`, `rounded`, `padded`, [`none`]() | — |
| [`menu-border-style`](https://github.com/tmux/tmux/blob/9ae69c3795ab5ef6b4d760f6398cd9281151f632/options-table.c#L350) | 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`menu-selected-style`](https://github.com/tmux/tmux/blob/9ae69c3795ab5ef6b4d760f6398cd9281151f632/options-table.c#L341) | 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`menu-style`](https://github.com/tmux/tmux/blob/9ae69c3795ab5ef6b4d760f6398cd9281151f632/options-table.c#L332) | 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`message-command-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L530) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | style string | — |
| [`message-format`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L736) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | string | — |
| [`message-limit`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L323) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | 0..2147483647 | — |
| [`message-line`](https://github.com/tmux/tmux/blob/9ae69c3795ab5ef6b4d760f6398cd9281151f632/options-table.c#L587) | 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | `0`, `1`, `2`, `3`, `4` | — |
| [`message-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L540) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | style string | — |
| [`mode-keys`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L908) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | `emacs`, `vi` | — |
| [`mode-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L916) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`monitor-activity`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L925) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | flag | — |
| [`monitor-bell`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L932) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | flag | — |
| [`monitor-silence`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L939) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | 0..2147483647 | — |
| [`mouse`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L549) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | flag | — |
| [`other-pane-height`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L950) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | string | — |
| [`other-pane-width`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L958) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | string | — |
| [`pane-active-border-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L966) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b | window | style string | — |
| [`pane-active-border-style`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L1315) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | style string | — |
| [`pane-base-index`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L975) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | 0..65535 | — |
| [`pane-border-format`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L984) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | string | — |
| [`pane-border-indicators`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L992) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | `off`, `colour`, `arrows`, `both` | — |
| [`pane-border-lines`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1001) | 3.3a, 3.4, 3.5, 3.5a | window | `single`, `double`, `heavy`, `simple`, [`number`]() | — |
| [`pane-border-lines`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L1274) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d | window | `single`, `double`, `heavy`, `simple`, [`number`](), `spaces` | — |
| [`pane-border-lines`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1603) | 3.8 | window, pane | `single`, `double`, `heavy`, `simple`, [`number`](), `spaces`, [`none`]() | — |
| [`pane-border-lines`](https://github.com/tmux/tmux/blob/b17d3da7cd84114e4c58630637f0b80428c0aa34/options-table.c#L1618) | next-3.9 | window, pane | `single`, `double`, `heavy`, `simple`, [`number`](), `spaces`, [`none`](), `rounded` | — |
| [`pane-border-status`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1010) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d | window | `off`, `top`, `bottom` | — |
| [`pane-border-status`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1612) | 3.8, next-3.9 | window, pane | `off`, `top`, `bottom`, `top-floating`, `bottom-floating` | — |
| [`pane-border-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1018) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b | window | style string | — |
| [`pane-border-style`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L1374) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | style string | — |
| [`pane-colours`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1027) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | colour; sparse array | `" ,"` |
| [`pane-scrollbars`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L1308) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d | window | `off`, `modal`, `on` | — |
| [`pane-scrollbars`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1637) | 3.8, next-3.9 | window | `off`, `modal`, `on`, `auto-hide` | — |
| [`pane-scrollbars-position`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L1325) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | `right`, `left` | — |
| [`pane-scrollbars-style`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L1316) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | style string | — |
| [`pane-scrollbars-timeout`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1645) | 3.8, next-3.9 | window | 0..2147483647 | — |
| [`pane-status-current-style`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L924) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`pane-status-style`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L933) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`popup-border-lines`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1053) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8 | window | `single`, `double`, `heavy`, `simple`, `rounded`, `padded`, [`none`]() | — |
| [`popup-border-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1044) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8 | window | style string | — |
| [`popup-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1035) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8 | window | style string | — |
| [`prefix`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L558) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | key | — |
| [`prefix-timeout`](https://github.com/tmux/tmux/blob/ac44566c9c7e3e94d23be6def4c7ae83472543f5/options-table.c#L388) | 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | 0..2147483647 | — |
| [`prefix2`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L565) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | key | — |
| [`prompt-command-cursor-colour`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1165) | 3.8, next-3.9 | session | colour | — |
| [`prompt-command-cursor-style`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L997) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | `default`, `blinking-block`, `block`, `blinking-underline`, `underline`, `blinking-bar`, `bar` | — |
| [`prompt-cursor-colour`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L943) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d | session | colour | — |
| [`prompt-cursor-colour`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1157) | 3.8, next-3.9 | session | colour | — |
| [`prompt-cursor-style`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L950) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | `default`, `blinking-block`, `block`, `blinking-underline`, `underline`, `blinking-bar`, `bar` | — |
| [`prompt-history-limit`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L332) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | 0..2147483647 | — |
| [`remain-on-exit`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1062) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b | window, pane | `off`, `on`, `failed` | — |
| [`remain-on-exit`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L1443) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d | window, pane | `off`, `on`, `failed`, `key` | — |
| [`remain-on-exit`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1699) | 3.8, next-3.9 | window, pane | `off`, `on`, `failed`, `key`, `failed-key` | — |
| [`remain-on-exit-format`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1071) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | string | — |
| [`renumber-windows`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L572) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | flag | — |
| [`repeat-time`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L580) | 3.3a, 3.4, 3.5, 3.5a | session | 0..32767 | — |
| [`repeat-time`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L759) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | 0..2000000 | — |
| [`scroll-on-clear`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1084) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | flag | — |
| [`session-status-current-style`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L958) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`session-status-style`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L967) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`set-clipboard`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L341) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | `off`, `external`, `on` | — |
| [`set-titles`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L591) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | flag | — |
| [`set-titles-string`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L598) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | string | — |
| [`silence-action`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L605) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | [`none`](), [`any`](), `current`, `other` | — |
| [`status`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L613) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | `off`, `on`, `2`, `3`, `4`, `5` | — |
| [`status-bg`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L621) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | colour | — |
| [`status-fg`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L629) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | colour | — |
| [`status-format`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L637) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | string; sparse array | `" ,"` |
| [`status-interval`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L649) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | 0..2147483647 | — |
| [`status-justify`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L659) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | `left`, `centre`, `right`, `absolute-centre` | — |
| [`status-keys`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L667) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | `emacs`, `vi` | — |
| [`status-left`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L675) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | string | — |
| [`status-left-length`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L682) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | 0..32767 | — |
| [`status-left-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L691) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | style string | — |
| [`status-position`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L700) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | `top`, `bottom` | — |
| [`status-right`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L708) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | string | — |
| [`status-right-length`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L718) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | 0..32767 | — |
| [`status-right-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L727) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | style string | — |
| [`status-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L736) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | style string | — |
| [`switch-mode-match-style`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1731) | 3.8, next-3.9 | window, pane | style string | — |
| [`synchronize-panes`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1092) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | flag | — |
| [`terminal-features`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L360) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | string; sparse array | `","` |
| [`terminal-overrides`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L351) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | string; sparse array | `","` |
| [`theme`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L565) | 3.8, next-3.9 | server | `detect`, `terminal`, `light`, `dark` | — |
| [`tiled-layout-max-columns`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L1397) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | 0..65535 | — |
| [`tree-mode-border-style`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1757) | 3.8, next-3.9 | window | style string | — |
| [`tree-mode-preview-format`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L1491) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | string | — |
| [`tree-mode-preview-style`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L1500) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`tree-mode-selection-style`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1788) | 3.8, next-3.9 | window | style string | — |
| [`update-environment`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L745) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | string; sparse array | `" ,"` |
| [`user-keys`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L371) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | string; sparse array | `","` |
| [`variation-selector-always-wide`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L532) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | server | flag | — |
| [`visual-activity`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L755) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | `off`, `on`, `both` | — |
| [`visual-bell`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L764) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | `off`, `on`, `both` | — |
| [`visual-silence`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L773) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | `off`, `on`, `both` | — |
| [`window-active-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1099) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | style string | — |
| [`window-default-command`](https://github.com/tmux/tmux/blob/b17d3da7cd84114e4c58630637f0b80428c0aa34/options-table.c#L1794) | next-3.9 | window | string | — |
| [`window-pane-current-status-format`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L1522) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | string | — |
| [`window-pane-status-format`](https://github.com/tmux/tmux/blob/81f88f8517c9fc5371b56cf117530c6b477c96ac/options-table.c#L1529) | 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | string | — |
| [`window-size`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1108) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | [`largest`](), [`smallest`](), `manual`, `latest` | — |
| [`window-status-activity-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1129) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`window-status-bell-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1138) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`window-status-current-format`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1147) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | string | — |
| [`window-status-current-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1154) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`window-status-format`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1163) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | string | — |
| [`window-status-last-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1171) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`window-status-separator`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1180) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | string | — |
| [`window-status-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1187) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | style string | — |
| [`window-style`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1120) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | style string | — |
| [`word-separators`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L782) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | string | — |
| [`wrap-search`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1197) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | flag | — |
| [`xterm-keys`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1205) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | flag | — |
## Hooks
| Name | Releases | Scope | Value | Array separator |
| --- | --- | --- | --- | --- |
| [`after-bind-key`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1214) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-capture-pane`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1215) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-copy-mode`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1216) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-display-message`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1217) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-display-panes`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1218) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-kill-pane`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1219) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-list-buffers`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1220) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-list-clients`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1221) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-list-keys`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1222) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-list-panes`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1223) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-list-sessions`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1224) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-list-windows`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1225) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-load-buffer`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1226) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-lock-server`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1227) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-new-session`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1228) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-new-window`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1229) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-paste-buffer`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1230) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-pipe-pane`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1231) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-queue`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1232) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d | session | command; sparse array | empty |
| [`after-refresh-client`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1233) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-rename-session`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1234) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-rename-window`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1235) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-resize-pane`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1236) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-resize-window`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1237) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-save-buffer`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1238) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-select-layout`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1239) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-select-pane`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1240) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-select-window`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1241) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-send-keys`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1242) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-set-buffer`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1243) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-set-environment`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1244) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-set-hook`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1245) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-set-option`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1246) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-show-environment`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1247) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-show-messages`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1248) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-show-options`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1249) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-split-window`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1250) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-swap-window`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1963) | 3.8, next-3.9 | session | command; sparse array | empty |
| [`after-unbind-key`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1251) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`alert-activity`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1252) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`alert-bell`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1253) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`alert-silence`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1254) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`client-active`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1255) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`client-attached`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1256) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`client-closed`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1978) | 3.8, next-3.9 | session | command; sparse array | empty |
| [`client-created`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1976) | 3.8, next-3.9 | session | command; sparse array | empty |
| [`client-dark-theme`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L1571) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`client-detached`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1257) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`client-focus-in`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1258) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`client-focus-out`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1259) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`client-light-theme`](https://github.com/tmux/tmux/blob/0dac7fe434d029a4f0b819cba8eb7963df291990/options-table.c#L1570) | 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`client-resized`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1260) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`client-session-changed`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1261) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`command-error`](https://github.com/tmux/tmux/blob/ac44566c9c7e3e94d23be6def4c7ae83472543f5/options-table.c#L1350) | 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`marked-pane-changed`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1996) | 3.8, next-3.9 | session | command; sparse array | empty |
| [`pane-activity`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L1998) | 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-bell`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2000) | 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-command-finished`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2002) | 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-command-started`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2004) | 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-created`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2006) | 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-died`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1262) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-exited`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1263) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-focus-in`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1264) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-focus-out`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1265) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-mode-changed`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1266) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-mode-entered`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2021) | 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-mode-exited`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2023) | 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-moved`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2025) | 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-prompt-closed`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2027) | 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-prompt-opened`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2029) | 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-resized`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2031) | 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-set-clipboard`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1267) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-shell-prompt`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2036) | 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`pane-title-changed`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1268) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window, pane | command; sparse array | empty |
| [`session-added-to-group`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2044) | 3.8, next-3.9 | session | command; sparse array | empty |
| [`session-closed`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1269) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`session-created`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1270) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`session-removed-from-group`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2048) | 3.8, next-3.9 | session | command; sparse array | empty |
| [`session-renamed`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1271) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`session-window-changed`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1272) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`window-closed`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2054) | 3.8, next-3.9 | window | command; sparse array | empty |
| [`window-created`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2052) | 3.8, next-3.9 | window | command; sparse array | empty |
| [`window-layout-changed`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1273) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | command; sparse array | empty |
| [`window-linked`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1274) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`window-pane-changed`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1275) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | command; sparse array | empty |
| [`window-renamed`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1276) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | command; sparse array | empty |
| [`window-resized`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1277) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | window | command; sparse array | empty |
| [`window-unlinked`](https://github.com/tmux/tmux/blob/0b355ae8114511e1ff6359272b164f1cdf718e80/options-table.c#L1278) | 3.3a, 3.4, 3.5, 3.5a, 3.6, 3.6a, 3.6b, 3.7, 3.7a, 3.7b, 3.7c, 3.7d, 3.8, next-3.9 | session | command; sparse array | empty |
| [`window-unzoomed`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2067) | 3.8, next-3.9 | window | command; sparse array | empty |
| [`window-zoomed`](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/options-table.c#L2069) | 3.8, next-3.9 | window | command; sparse array | empty |
---
# Topology operations
Source: https://libtmux.org/en/lua/v0.1.1/guides/topology/
> Topology operations: libtmux documentation.
Session, Window, Pane and WindowLink handles perform explicit mutations through
the PROCESS endpoint. Each operation returns a Request that resolves to
`true` when tmux successfully processes it. Refresh or capture a snapshot
explicitly to inspect the resulting state; existing records do not change
in place.
```lua
assert(session:rename("build"):await())
assert(window:resize({ width = 120, height = 40 }):await())
assert(window:layout({ named = "tiled" }):await())
```
The [integration fixture](https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/tests/integration/topology.lua) includes setup,
native-state assertions and cleanup through both runtime adapters.
## Names and removal
[`session:rename(name)`]() and [`window:rename(name)`]() use their stable native IDs.
Names are nonempty NUL-free strings up to 1,024 bytes. Session names also
exclude dots, colons, ASCII controls and DEL. Format markers remain literal;
native name validation and cleaning still apply. Releases differ in accepted
bytes and escaping, so success does not promise byte-exact storage. Exact
tmux 3.7 also rejects dots and colons in Window names. Renaming a Window turns
off its automatic rename option.
[`session:kill()`]() destroys that session and its links. A linked window can
survive in another session. [`window:kill()`]() destroys the window and **every**
link to it, potentially removing sessions left without windows. Neither
method targets all other sessions or windows. Use these only for intended
mutations; Request cancellation never implies either operation.
## Window navigation
[`session:navigate_window(direction)`]() accepts `"next"`, `"previous"` or
`"last"`. Next/previous support `activity = true` to select a window with a
native alert. Last rejects the `activity` option, including explicit false.
Navigation changes the session's active window and follows native hooks and
grouped-session behavior.
[`session:renumber_windows()`]() renumbers from the session's [`base-index`](https://libtmux.org/en/tmux/latest/catalog/options/base-index/) option.
It preserves Window IDs but invalidates captured link indices. It is a
separate operation from moving one window.
## Window placements
A WindowLink identifies one placement by session, index and Window ID. Use
[`creation.window_link`]() or a handle from [`snapshot.window_links`]() when an
operation needs that exact placement, including duplicate links in one
session. `link:select()` selects its index within its session.
`link:link(destination)` creates another placement;
[`link:move(destination)`]() also removes this source placement. Destinations
accept one of these plain records:
- `{ session = session, index = 5 }` chooses an explicit index. Omitting
`index` requests a native free index from [`base-index`](https://libtmux.org/en/tmux/latest/catalog/options/base-index/), not append.
- `{ link = anchor, position = "before"|"after" }` inserts relative to an
existing placement and may shift indices.
- `{ link = victim, position = "at" }` requires `{ replace = true }` as the
operation options. Replacement can destroy the victim Window if it has no
other links. A numeric index alone never authorizes replacement.
Both operations default to `select = false`. Removal of an active source or
replacement of an active destination can still force native selection.
Occupied numeric destinations return native errors; the library never
searches for a different destination or retries.
`link:swap(other)` exchanges the Windows in two placements. By default,
selected **slots** remain selected, although their Window identities change.
`select = true` selects the destination slot, and the source slot when the
sessions differ. Swapping two placements of the same Window is a native no-op.
[`link:unlink()`]() removes only this placement and refuses native last-link
destruction. `kill_if_last = true` permits that destruction. Grouped sessions
retain tmux's synchronization and last-link rules. Native refusal is not
rollback: insertion can shift indices before a later grouped-session error.
Each operation checks the stored source tuple, and any destination link
tuple, in the native command queue immediately before the mutation. A
recognized mismatch returns `stale_target`, `effect = "not_sent"`, and the
native receipt. Old handles never rebind automatically after index reuse,
movement or swapping. Recreating the identical tuple cannot be distinguished
from continuous identity; native command aliases can also change these checks.
The [native-command contract](https://libtmux.org/en/lua/v0.1.1/guides/commands/) applies to the generated guards
and their mutation branches. They are not a transaction or an unconditional
compare-and-swap guarantee.
Success returns `true`; capture a new snapshot explicitly to find resulting
placements. No predicted index or hidden post-mutation read constructs a new
WindowLink handle.
## Window size and layout
[`window:resize(options)`]() accepts exactly one form:
- `width` and/or `height`, integers from 1 to 10,000.
- `direction = "left"|"right"|"up"|"down"`, with `amount` from 1 to
10,000, defaulting to one.
- `largest = true` or `smallest = true`, using tmux's native client-size rule.
Native resizing sets [`window-size`](https://libtmux.org/en/tmux/latest/catalog/options/window-size/) to manual. Layout constraints and available
client sizes can affect the result; the command's success is not a dimensions
oracle. Resizing affects every link to the Window.
[`window:layout(options)`]() also accepts exactly one form:
- [`named`](): `even-horizontal`, `even-vertical`, `main-horizontal`,
`main-vertical` or `tiled`. The mirrored main layouts require tmux 3.5+.
- `layout`: an exported native layout string, bounded at 65,536 bytes: the
checksum form (four hexadecimal digits, comma and body), or on tmux 3.8 and
later the JSON form.
- `next = true`, `previous = true` or `restore = true`.
Malformed custom-layout headers return `invalid_layout` before dispatch.
This avoids faulty error handling in tmux 3.3a and short-header reads in
older native parsers. Use [`named`]() for standard layout names. A JSON layout
also returns `invalid_layout` on tmux older than 3.8, the first release that
accepts one (see [compatibility](https://libtmux.org/en/lua/v0.1.1/guides/compatibility/)). tmux 3.8 exports
[`window_layout`](https://libtmux.org/en/tmux/latest/catalog/formats/window_layout/) as JSON, except to a control-mode client that has not set the
`new-layouts` flag, which still receives the checksum form
([tmux 3.8 CHANGES](https://github.com/tmux/tmux/blob/7f2a35ad3321f9ba57a1062ca73b1f3ff26aca53/CHANGES#L38-L40)).
Layout operations unzoom before native checksum and body validation. A rejected
layout can therefore change zoom state. A nonzero native exit carries its receipt
and `effect = "completed"`; it does not establish rollback. Custom layout
syntax is tmux's grammar and is not evaluated as Lua or shell text.
## Restart a window
`window:respawn({ context = link, ... })` requires a WindowLink naming this
Window. Its session supplies the native launch context, including inherited
environment. The link is checked in the native queue before respawn; the
method never chooses an arbitrary session from a global Window ID.
Launch options match [creation](https://libtmux.org/en/lua/v0.1.1/guides/creation/): literal `argv` or explicit
`shell`, absolute `cwd` and a per-process `environment` map. Omitting launch
text reuses the previous command. Working-directory validation is asynchronous
and completes before dispatch. `kill = true` permits replacement of running
processes; otherwise tmux refuses an active window.
Respawn retains the Window ID and its first Pane, removes sibling panes, and
resets layout through every link to the Window. It can fail after destructive
preparation; a native error does not establish rollback. Existing sibling
Pane handles do not become references to the restarted first Pane.
## Move a pane
[`pane:move_to(target, options)`]() moves the same Pane into the target Pane's
Window. It defaults to a vertical split with `select = false`. Choose
`direction = "horizontal"`, `size` from 1 to 10,000 cells, or `percent` from
1 to 100. Size and percent exclude one another. `before = true` changes native
geometry; it does not promise a matching pane-index order. `full_size = true`
extends the split across the Window.
`select = true` requires `target_link = link`, identifying the exact placement
whose session and index will be selected. An optional target link also checks
membership when selection is disabled. The library checks that placement and
the target Pane's current Window separately in the native queue, then submits
the compound target. A moved target Pane produces `stale_target`; a target
that tmux cannot resolve can instead retain its native command error.
Movement changes global pane membership through all Window links. Moving the
last Pane destroys the old Window and all its placements. Native layout and
selection changes can happen before a later error. Moving a Pane preserves
its ID and running process; it does not restart that process.
## Break a pane into a window
[`pane:break_out(source_link, destination, options)`]() requires the Pane's exact
source WindowLink. Destinations accept a Session with an optional numeric
index, or an anchor WindowLink with `position = "before"|"after"`, as described
under [window placements](https://libtmux.org/en/lua/v0.1.1/guides/topology/#window-placements). Replacement is not supported;
an occupied numeric destination returns the native error.
The source placement and current Pane membership are checked in the native
queue, along with any destination anchor. The operation preserves the Pane ID
and running process. With multiple panes, tmux creates a new Window and keeps
the source Window's links. With one pane, it moves the specified placement of
the existing Window; other links to that Window survive. `select` defaults to
false, though removal of an active placement can force native selection.
`name` follows the Window name rules above. Omitting it preserves native
naming: a singleton retains its existing Window name and options; a newly
created Window takes the native default name and inherited options. An
explicit name disables automatic rename for the resulting Window.
Exact tmux 3.7 has a native multi-pane naming defect, so a literal
[`break-pane`](https://libtmux.org/en/tmux/latest/manual/break-pane/) through [`server:command`]() is refused there (see
[commands](https://libtmux.org/en/lua/v0.1.1/guides/commands/)). The typed operation keeps its repair: it supplies a
placeholder when no name is requested, avoiding the faulty native null-name
path. For a named multi-pane break, it follows the break with a rename of the
same Pane's Window. This repair fires native rename notifications and
[`after-rename-window`](https://libtmux.org/en/tmux/latest/catalog/hooks/after-rename-window/) hooks. Singleton breaks and other releases need no
repair. A repair failure can occur after the Pane has moved; it is not rollback.
## Effects and boundaries
Options are copied before dispatch and must be plain records. These methods
accept the same nested `process` limits as [Pane operations](https://libtmux.org/en/lua/v0.1.1/guides/panes/).
Input is bounded at one MiB per operation. A stale generation or invalid
target fails before dispatch. If continuity is lost after successful native
completion, the error preserves `effect = "completed"` and that receipt.
Mutations are never retried automatically.
Native [aliases and hooks](https://libtmux.org/en/lua/v0.1.1/guides/commands/) remain observable. These APIs do not
promise transactions or protection against aliases that replace a built-in
command.
---
# Linking and consuming our docs
Source: https://libtmux.org/en/lua/v0.1.1/meta/linking/
> Find documentation exports for search engines, bots, LLMs and other documentation sites.
We welcome bots, search engines, SEO tools, LLMs and other clients to use our
documentation. Read a page in your browser, fetch its Markdown, discover
pages through a manifest, or link to documented objects from another site.
## Choose an export
The page footer links to the exports for its documentation tree. Use those
links to select a language, version or preview.
| File or format | Use it for |
| --- | --- |
| [llms.txt](https://libtmux.org/en/llms.txt) | Discover guides, API references and agent prompts through a Markdown index. |
| [llms-full.txt](https://libtmux.org/en/llms-full.txt) | Fetch guides and MCP contracts together as Markdown. API references are linked separately. |
| [docs.json](https://libtmux.org/en/docs.json) | Discover page titles, URLs, descriptions, headings and Markdown URLs in a structured manifest. |
| Markdown | Read one page as text using its footer's **Markdown** link. |
| Raw source | Inspect the source file using its footer's **Raw source** link, where available. |
| [objects-full.inv](https://libtmux.org/en/objects-full.inv) | Resolve Sphinx references across shared docs, each port's default version, or its latest until the default has published a catalog, and tmux reference versions. |
| objects.inv | Resolve Sphinx references within one port and version, or one tmux documentation tree. |
| [targets.json](https://libtmux.org/en/targets.json) | Browse inventory keys, display names and destination URLs as JSON. A scoped catalog sits beside each root inventory. The root one lists fallbacks and ports left out. |
The root exports above cover the assembled site. Port exports describe the
selected port and version. For a single API declaration, start with
`docs.json` and follow its reference and symbol-index links.
## Link from Sphinx
The [Intersphinx guide](https://libtmux.org/en/meta/intersphinx/) explains how to configure
inventories, choose native roles or portable labels, and preserve references
when a page moves or changes its title.
Browse [Intersphinx examples](https://libtmux.org/en/meta/intersphinx/examples/) for copyable RST
and MyST references to library APIs, tmux C declarations, hooks, format
variables, CLI commands and schema fields, paired with their destinations.
## Discover and index pages
Use the [sitemap](https://libtmux.org/en/sitemap-index.xml) to discover indexable pages. Follow
[robots.txt](https://libtmux.org/robots.txt) and each page's robots metadata:
pull-request previews, component demos and search-index shards are excluded
from crawling, and alternate versions can carry `noindex`.
Choose a versioned documentation tree when a reference needs a particular
release. The full inventory follows each port's advertised default; a
port's `objects.inv` describes the selected version.
---
# Link to libtmux from Sphinx
Source: https://libtmux.org/en/lua/v0.1.1/meta/intersphinx/
> Use Intersphinx inventories to reference libtmux APIs and documentation.
Sphinx can resolve references to libtmux APIs, guides, headings, MCP objects,
schema fields, and other documented targets. The footer links to the full
inventory and the inventory for the page's port or tmux version.
Browse [Intersphinx examples](https://libtmux.org/en/meta/intersphinx/examples/) for copyable RST
and MyST references paired with their destinations.
For Markdown exports, manifests and crawler discovery, see
[Linking and consuming our docs](https://libtmux.org/en/meta/linking/).
## Configure Intersphinx
Enable the built-in extension in your project's `conf.py`:
`None` discovers `objects.inv` at the configured base URL. The port mapping
above selects the Python `latest` tree. Copy the base URL of another port
or version to select its inventory.
The full inventory includes shared documentation, the configured default
version of each assembled port, and distinct tmux reference versions.
It is generated after site assembly. Each port inventory includes the
rendered targets in that exact version.
The tmux inventory includes the shared tmux guides and the latest CLI manual,
options, hooks, formats, and C source reference. A version mapping such as
`tmux-3-7c` includes only that release's manual, catalog, and C declarations.
Manual and C reference pages link to the same version inventory in the footer.
Use mapping names without dots when writing MyST reference roles.
## Choose a reference
Every exported target has a portable label that works with `std:ref`, without
installing a language or MCP domain. Open `targets.json` beside the inventory
and copy its `key`. Its `href` and `display` identify the destination.
For example, the Python [`libtmux.Pane`]() declaration has this reStructuredText
reference:
```rst
:external+libtmux:ref:`Pane `
```
With MyST enabled in your project, the same label works in Markdown:
```markdown
{external+libtmux:ref}`Pane `
```
Native Python, C++, JavaScript, and C objects also have aliases for their
built-in roles. A scoped Python inventory supports:
```rst
:external+libtmux-python:py:class:`libtmux.Pane`
```
The tmux mapping provides native C roles and portable manual references:
```rst
:external+tmux:c:struct:`cmd`
:external+tmux:ref:`capture-pane `
```
Command options also work with Sphinx's program context:
```rst
.. program:: tmuxp load
:external+libtmux-python:option:`--append`
```
The full inventory qualifies native names by port, such as
`py:libtmux.Pane`. A fully qualified alias includes the product too:
`py:core:libtmux.Pane`. Short aliases are offered only when they identify
one destination. Configuration values, command options, environment
variables, and glossary terms use standard-domain types where their
renderers identify those semantics.
## Stable labels
A portable key contains `scope:product:category:identity`. Its encoding
preserves uppercase letters, punctuation, and Unicode, because `std:ref`
lowercases targets. `%50ane` and `pane` therefore remain distinct.
Copy the key from the catalog without decoding its percent escapes.
Keys are independent of display titles and destination URLs. API public IDs,
protocol wire identities, JSON Pointers, named parameters, and native method
identities supply their names. Authored documents can retain `inventoryId`
and explicit HTML fragment IDs when their titles or routes change.
Contributors preserve renamed keys in the inventory alias catalog and use
the existing page redirect mechanism for retired routes.
### Preserve published links
If `meta/intersphinx.md` moves to `meta/linking.md`, retain its logical ID
and list the retired route in the new page's frontmatter:
```yaml
inventoryId: intersphinx
aliases:
- meta/intersphinx
```
The document key remains `site:core:doc:intersphinx`, and the old route
redirects to the new page. Retain existing heading fragment IDs when their
text changes.
When an identity or fragment changes intentionally, map the former keys to
current targets in `site/src/data/inventory-aliases.json`. For example,
choosing `inventoryId: linking` and changing `stable-labels` to
`stable-references` needs these entries:
```json
[
{
"scope": "site",
"from": "site:core:doc:intersphinx",
"to": "site:core:doc:linking"
},
{
"scope": "site",
"from": "site:core:heading:intersphinx%23stable-labels",
"to": "site:core:heading:linking%23stable-references",
"fragment": "stable-labels"
}
]
```
The document entry preserves `std:ref` and `std:doc` references. The heading
entry preserves `std:ref`; `fragment` also installs the retired HTML anchor
at the new destination. Keep the route alias too: inventory aliases do not
redirect retired URLs.
Copy `to` from the current target catalog. Retain earlier `from` entries
and update their destinations when renaming again. Former native role names,
such as a Python class name, need preservation in the native metadata.
Existing `objects.inv` and `reference/objects.inv` endpoints remain compatibility
exports. New integrations should use the full inventory, a port's root
inventory, or a tmux root inventory to obtain the complete target catalog
and case-safe labels.
See the [Sphinx Intersphinx documentation](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html)
for named inventories and cross-reference syntax.
---
# Intersphinx examples
Source: https://libtmux.org/en/lua/v0.1.1/meta/intersphinx/examples/
> Compare Sphinx and MyST references to APIs, tmux C declarations, hooks, format variables, CLI commands and schema fields.
import { referenceHref } from '../../../../lib/api-models'
Copy a reference and compare its destination below. These examples cover
native language roles, portable labels, full and scoped inventories, and
links into tmux C declarations, hooks, format variables and CLI commands.
## Configure the inventories
Add these mappings to your Sphinx project's `conf.py`:
`None` discovers `objects.inv` at the mapping's base URL. The full inventory
uses each port's advertised default version. The `py` mapping explicitly
selects `latest`; `tmux` selects the latest tmux manual and C reference.
Use the root URL from an inventory's footer link when selecting a preview
or another release.
## Native Python roles
A named inventory selects the Python tree:
```rst
:external+py:py:class:`libtmux.Pane`
```
Destination: [Pane](https://libtmux.org/en/py/latest/reference/libtmux-pane/#libtmux.Pane).
The full inventory qualifies native names by port:
```rst
:external+full:py:class:`py:libtmux.Pane`
```
Destination: Pane in the Python default version.
For automatic lookup, use the ordinary role. A local definition takes
precedence over Intersphinx:
```rst
:py:class:`libtmux.Pane`
```
Destination: [Pane](https://libtmux.org/en/py/latest/reference/libtmux-pane/#libtmux.Pane).
## Portable labels
Portable labels work with the standard reference role, including languages
that have no built-in Sphinx domain. Copy the key from `targets.json`.
```rst
:external+full:ref:`Pane `
:external+py:ref:`Pane `
```
Destinations: Full inventory: Pane,
[Scoped inventory: Pane](https://libtmux.org/en/py/latest/reference/libtmux-pane/#libtmux.Pane).
The external role searches the configured inventories without selecting one.
This native name is unqualified only in the scoped Python inventory:
```rst
:external:py:class:`libtmux.Pane`
```
Destination: [Pane](https://libtmux.org/en/py/latest/reference/libtmux-pane/#libtmux.Pane).
## MyST roles and inventory URLs
Enable `myst_parser` alongside `sphinx.ext.intersphinx` for Markdown sources.
Named roles accept the same targets as reStructuredText:
```markdown
{external+py:py:class}`libtmux.Pane`
```
Destination: [Pane](https://libtmux.org/en/py/latest/reference/libtmux-pane/#libtmux.Pane).
Portable labels retain their percent escapes inside reference roles:
```markdown
{external+full:ref}`Pane `
```
Destination: Pane in the Python default version.
MyST's inventory URL syntax also supports native aliases:
```markdown
[Pane](inv:py:py:class#libtmux.Pane)
```
Destination: [Pane](https://libtmux.org/en/py/latest/reference/libtmux-pane/#libtmux.Pane).
Use role syntax for percent-encoded portable keys: MyST normalizes escapes
in `inv:` URLs. Keep mapping names free of dots, as in `tmux-3-7c`, so MyST
can parse the role name. When using an inventory URL, specify its domain and
object type if a name is both a document and a label.
## tmux C declarations
The tmux mapping provides Sphinx's built-in C roles:
```rst
:external+tmux:c:struct:`cmd`
:external+tmux:c:func:`cmd_find_target`
```
Destinations: [cmd](https://libtmux.org/en/tmux/latest/reference/c-struct-cmd/#c%3Astruct%3Acmd),
[cmd_find_target](https://libtmux.org/en/tmux/latest/reference/c-function-cmd_find_target/#c%3Afunction%3Acmd_find_target).
Select a release with its own mapping. The full inventory also offers
version-qualified native aliases:
```rst
:external+tmux-3-7c:c:func:`cmd_find_target`
:external+full:c:func:`tmux@3.7c:cmd_find_target`
:external+full:c:func:`tmux@latest:cmd_find_target`
```
Destinations: [Scoped: cmd_find_target in 3.7c](https://libtmux.org/en/tmux/3.7c/reference/c-function-cmd_find_target/#c%3Afunction%3Acmd_find_target),
[Full: cmd_find_target in 3.7c](https://libtmux.org/en/tmux/3.7c/reference/c-function-cmd_find_target/#c%3Afunction%3Acmd_find_target),
[Full: cmd_find_target in latest](https://libtmux.org/en/tmux/latest/reference/c-function-cmd_find_target/#c%3Afunction%3Acmd_find_target).
MyST supports the same C roles and a typed inventory URL:
```markdown
{external+tmux:c:struct}`cmd`
{external+tmux:c:func}`cmd_find_target`
{external+full:c:func}`tmux@3.7c:cmd_find_target`
[cmd_find_target](inv:tmux:c:function#cmd_find_target)
```
Destinations: [MyST: cmd](https://libtmux.org/en/tmux/latest/reference/c-struct-cmd/#c%3Astruct%3Acmd),
[MyST: cmd_find_target](https://libtmux.org/en/tmux/latest/reference/c-function-cmd_find_target/#c%3Afunction%3Acmd_find_target),
[MyST full: cmd_find_target in 3.7c](https://libtmux.org/en/tmux/3.7c/reference/c-function-cmd_find_target/#c%3Afunction%3Acmd_find_target),
[Inventory URL: cmd_find_target](https://libtmux.org/en/tmux/latest/reference/c-function-cmd_find_target/#c%3Afunction%3Acmd_find_target).
The C reference links each declaration to its source file and revision.
Portable labels also address its signatures, parameters, and sections.
## tmux hooks
Link a hook name to its catalog page with a portable label. The same key
works in the scoped tmux inventory and the full inventory:
```rst
:external+tmux:ref:`after-new-session `
:external+full:ref:`after-new-session `
```
Destinations: [Scoped: after-new-session](https://libtmux.org/en/tmux/latest/catalog/hooks/after-new-session/),
[Full: after-new-session](https://libtmux.org/en/tmux/latest/catalog/hooks/after-new-session/).
In MyST, use the same key inside a reference role. Preserve its percent
escapes:
```markdown
{external+tmux:ref}`after-new-session `
{external+full:ref}`after-new-session `
```
Destinations: [MyST scoped: after-new-session](https://libtmux.org/en/tmux/latest/catalog/hooks/after-new-session/),
[MyST full: after-new-session](https://libtmux.org/en/tmux/latest/catalog/hooks/after-new-session/).
## tmux formats
Link a format variable such as [`#{session_name}`](https://libtmux.org/en/tmux/latest/catalog/formats/session_name/) to its catalog entry:
```rst
:external+tmux:ref:`session_name `
:external+full:ref:`session_name `
```
Destinations: [Scoped: session_name](https://libtmux.org/en/tmux/latest/catalog/formats/session_name/),
[Full: session_name](https://libtmux.org/en/tmux/latest/catalog/formats/session_name/).
The MyST references select the same scoped or full inventory:
```markdown
{external+tmux:ref}`session_name `
{external+full:ref}`session_name `
```
Destinations: [MyST scoped: session_name](https://libtmux.org/en/tmux/latest/catalog/formats/session_name/),
[MyST full: session_name](https://libtmux.org/en/tmux/latest/catalog/formats/session_name/).
## tmux CLI manual
The same tmux inventory covers command pages:
```rst
:external+tmux:ref:`capture-pane `
```
Destination: [capture-pane](https://libtmux.org/en/tmux/latest/manual/capture-pane/).
The document role works when the target is a whole page:
```rst
:external+tmux:doc:`Full manual `
```
Destination: [Full tmux manual](https://libtmux.org/en/tmux/latest/manual/full/).
Select a command's manual page with the document role. Its portable key
also works in the full inventory:
```rst
:external+tmux:doc:`tmux new-session `
:external+full:doc:`tmux new-session `
```
Destinations: [Scoped: new-session](https://libtmux.org/en/tmux/latest/manual/new-session/),
[Full: new-session](https://libtmux.org/en/tmux/latest/manual/new-session/).
Use the same document role in MyST:
```markdown
{external+tmux:doc}`tmux new-session `
{external+full:doc}`tmux new-session `
```
Destinations: [MyST scoped: new-session](https://libtmux.org/en/tmux/latest/manual/new-session/),
[MyST full: new-session](https://libtmux.org/en/tmux/latest/manual/new-session/).
## Command options, environment variables, and terms
The Python port's workspace documentation exports standard-domain objects.
Set the program context before referencing an option:
```rst
.. program:: tmuxp load
:external+py:option:`--append`
```
Destination: [tmuxp load --append](https://libtmux.org/en/py/latest/workspace/cli/load/#arguments-and-flags-a-append).
Environment variables and glossary terms use their own roles. Qualify the
product when a term appears in more than one glossary:
```rst
:external+py:envvar:`COLUMNS`
:external+py:term:`async `
```
Destinations: [COLUMNS](https://libtmux.org/en/py/latest/workspace/configuration/environment/#cli-and-runtime-variables-columns-lines-rows),
[async](https://libtmux.org/en/py/latest/reference/glossary/#async).
## MCP tools and schema fields
Portable labels also address protocol objects and individual JSON Schema
fields. No custom MCP domain is required:
```markdown
{external+py:ref}`Read tools batch `
{external+py:ref}`on_error `
```
Destinations: [Read tools batch](https://libtmux.org/en/py/latest/mcp/tools/call_read_tools_batch/#mcp.tool.call_read_tools_batch),
[on_error](https://libtmux.org/en/py/latest/mcp/tools/call_read_tools_batch/#mcp.tool.call_read_tools_batch.input%2Fproperties%2Fon_error).
## Shared documentation and headings
The full inventory includes the shared documentation:
```rst
:external+full:doc:`Inventory guide `
:external+full:ref:`Configure Intersphinx `
```
Destinations: [Inventory guide](https://libtmux.org/en/meta/intersphinx/),
[Configure Intersphinx](https://libtmux.org/en/meta/intersphinx/#configure-intersphinx).
## Local files and fallback locations
Download an inventory and pass its filename as the second mapping value.
The first value remains the documentation URL used in generated links:
An ordered list tries a local copy before the HTTP inventory:
See the [inventory guide](https://libtmux.org/en/meta/intersphinx/) for key stability and the
[Sphinx Intersphinx reference](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html)
for configuration options.
---
# API glossary
Source: https://libtmux.org/en/lua/v0.1.1/reference/glossary/
> Kinds, modifiers and package labels in the Lua API reference.
## Symbol kinds
Kinds identify declarations in the Lua API reference.
### module
A Lua module loaded through require, commonly returning a table of exported values.
References: [Lua modules](https://www.lua.org/manual/5.4/manual.html#pdf-require).
### class
A Lua tooling annotation describing a table or other value as a named object shape.
Lua does not have a class declaration keyword; the implementation supplies its runtime behavior.
References: [Lua class annotations](https://luals.github.io/wiki/annotations/#class).
### function
A Lua callable value with parameters and potentially multiple results.
References: [Lua function definitions](https://www.lua.org/manual/5.4/manual.html#3.4.11).
### method
A Lua function called with colon syntax, which passes the receiver as the first argument self.
References: [Lua method calls](https://www.lua.org/manual/5.4/manual.html#3.4.10).
### attribute
A Lua table field or annotated member. Reading a missing field may invoke a metatable lookup.
References: [Lua table access](https://www.lua.org/manual/5.4/manual.html#2.4).
### typealias
A Lua tooling alias describing a type expression in comments, without declaring a runtime type.
References: [Lua type aliases](https://luals.github.io/wiki/annotations/#alias).
## Modifiers
Modifiers add information about calling, implementing, or accessing a declaration. Their precise effect follows the language and the signature.
### overload
Alternative Lua function signatures supplied by documentation annotations, rather than runtime overload selection.
References: [Lua overload annotations](https://luals.github.io/wiki/annotations/#overload).
### inherited
A Lua member documented on an annotated parent type. Follow its declaring type for the original contract.
References: [Lua class inheritance](https://luals.github.io/wiki/annotations/#class).
## Package context
Package labels identify where an API is supplied.
### package
The Lua library distribution supplying these modules. A package name and the string passed to require need not match.
References: [Lua packages and require](https://www.lua.org/manual/5.4/manual.html#6.3).
---
# tmux MCP, built in Lua, is not published
Source: https://libtmux.org/en/lua/v0.1.1/mcp/
> The Lua repository contains an MCP scaffold, not a usable or published server.
Lua has no published libtmux MCP server. The repository's MCP directory is a
scaffold: it does not provide an installable server, executable, protocol
catalog, or supported tool API.
This page records availability so cross-language navigation does not turn a
source placeholder into a product claim. There is no launch command, client
configuration, tool reference, prompt catalog, or embedding reference to use.
Use the Lua core library for direct tmux access through its luv or Neovim
runtime. Choose another language's MCP server only as a separate process with
that server's own package, policy, and compatibility requirements.
---
# tmux workspace manager, forged in Lua, is not published
Source: https://libtmux.org/en/lua/v0.1.1/workspace/
> The Lua repository contains a workspace scaffold, not a loader or supported builder API.
Lua has no published libtmux workspace manager. The repository's workspace
directory is a scaffold: it does not provide an installable package, workspace
loader command, supported file format, or product API.
This page records availability without advertising placeholder code. There is
no Lua equivalent of `libtmux-workspace validate`, [`plan`](), or `load`, and no
workspace reference tree is generated.
Use the core Lua API to create sessions, windows, and panes explicitly. A
workspace tool from another language remains a separate application with its
own configuration contract; it is not a Lua feature.
---
# AI policy
Source: https://libtmux.org/en/lua/v0.1.1/meta/ai-policy/
> Use the libtmux packages with AI tools. When contributing, check what you submit and wait for a maintainer's invitation before preparing a pull request.
Last revised October 25, 2026
Use these packages with AI tools as you like. When contributing, check what
you submit and wait for a maintainer's invitation before preparing a pull
request.
This policy covers the libraries, ports, and documentation in the
[libtmux](https://github.com/libtmux) and
[tmux-python](https://github.com/tmux-python) organizations, including their
issues, comments, discussions, reviews, and pull requests.
## 1. For users: About these packages
We encourage you to use AI tools with our libraries and documentation,
including to generate code that calls the libraries. We want these projects to
be useful in the way you work. Some of what we publish supports that workflow:
- [MCP integrations](https://libtmux.org/en/py/latest/mcp/) that let assistants interact with tmux.
- Markdown documentation and `llms.txt` and `llms-full.txt` resources linked
from documentation pages.
- [`AGENTS.md`]() and other repository instructions for tools working on the
codebase.
Use the documentation for the package, language, and version you are working
with.
### How the ports are made
The ports build on [tmuxp](https://tmuxp.git-pull.com/), started in 2013, and
[libtmux](https://libtmux.git-pull.com/), started in 2016. Both projects
predate today's LLM coding tools. Current work on the original projects and the
ports uses AI assistance.
Maintainers guide the design, review changes, test behavior against real tmux,
and decide what ships. They remain responsible for what the projects include
and maintain.
### Stability
Packages in the [libtmux organization](https://github.com/libtmux) are
experimental unless their README says otherwise. Names and APIs may change
between releases. Pin an exact version and review changes before upgrading.
## 2. For contributors: How to report issues, ideas, suggestions, and security issues
A useful issue is a contribution in its own right. Your experience helps us see
what breaks, what feels awkward, and what is missing. You do not need to arrive
with a patch.
Open bugs, ideas, and suggestions in the repository of the package they
concern. Report suspected security vulnerabilities privately using the route
below.
### Bugs
Tell us what you tried, what happened, and what you expected. Include a small
example we can run, the library and tmux versions, and the actual output.
Include relevant logs and error messages as they appeared, and distinguish what
you observed from possible explanations.
Bug reports are welcome whether the code you were running was handwritten or
generated. Include the code that ran. A conversation transcript is usually
unnecessary; include relevant prompts or tool calls when they are needed to
reproduce the problem.
### Ideas and suggestions
Explain what you wanted to accomplish and where the current design gets in
your way. We welcome feedback on:
- Usability: what was hard to find or get right, and where the documentation
misled you.
- Language conventions: whether a port feels natural in the language you use.
- Aesthetics: how an API, a page, or an error message reads.
- Missing capabilities: what you could not accomplish with the current API.
If an API you expected is missing, describe the task and why that API would
help.
### Security issues
Report suspected security vulnerabilities privately. Use **Report a
vulnerability** on the affected repository's security page where available.
Include the affected package and version, the tmux version, what you observed,
and reproduction steps or relevant code references if available. Distinguish
verified behavior from suspected impact. Please coordinate public disclosure
with us so we can investigate and, where needed, prepare a fix.
Command execution explicitly requested through documented features is expected
behavior and does not, by itself, establish a vulnerability. Explain any
additional failure, such as data being interpreted as commands unexpectedly or
an intended security boundary being crossed.
### Writing your report
Short reports, typos, and imperfect English are fine. Translation and writing
assistance are welcome; check that the result says what you mean and preserves
the facts you observed. Your experience matters more than a polished report.
### Using AI tools
If AI materially helped prepare your issue, comment, discussion, review, or
pull request, say which tools you used, what they did, and what you checked
yourself. Using these tools does not count against a contribution. You remain
responsible for what you submit.
Do not send generated code, reports, or explanations you have not checked.
### Pull requests
Before preparing a pull request, open an issue or comment on an existing issue
about the proposed change. Wait for a maintainer to invite a PR for an agreed
scope. Opening an issue alone is not an invitation. PRs submitted without that
agreement may be closed without review. Arrange security fixes through the
private reporting route.
Even when we agree that something should change, we may prefer to write the
implementation ourselves. Review must consider correctness, supported tmux
versions, language conventions, documentation, and ongoing maintenance.
Checking those can take more time than writing the change, whether it was
handwritten or generated.
If we invite a PR, understand the changes, test them, and be able to explain
them. Follow the project's contribution instructions, and describe the tests
you ran and the versions you used. Generated code and tests can share the same
mistake, so passing tests alone do not show that a change fits the project.
Submit only material you have the right to contribute on terms compatible with
the project's license. Identify outside code, tests, or text incorporated into
the contribution, including material adapted with AI assistance, and provide
its source and license. Keep required notices, and raise unclear permissions
before including the material. These source and licensing requirements apply
to maintainers too.