From 10b0d73144fe9e3a763a24b49b65db71e3355e28 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Sat, 17 Oct 2026 03:38:52 -0500
Subject: [PATCH 01/53] fix(site) Raise the documented tmux minimum to 3.3a
why: The libtmux ports, MCP servers and workspace builders now support
tmux 3.3a and newer, judged by the connected daemon. Pages, example
prerequisites and port install notes still said 3.2 or 3.2a, so a
reader on 3.2a would follow instructions the libraries refuse.
what:
- Move every "tmux 3.2 or newer" and "3.2a or newer" statement in the
shared and per-port content to 3.3a, including the JVM "3.2a through
3.7c" range and Ruby's "3.3 or newer" so 3.3 no longer reads as
supported
- Update the generated example introductions, home quickstart
prerequisites and the Julia install note to the same floor
- State on each workspace compatibility page and the MCP entry pages
that a daemon older than 3.3a is refused before any effect
- Add a tmux support guide that gives the version rules and links
from the guides index
- Leave historical records alone: manual archives for 3.2a, example
runs on 3.2a and 3.7c, and tmux facts such as the 3.2 hook origin
Port guides and API data under site/src/data come from pinned port
revisions and change when those ports publish their own floor.
Verified: gen-mentions output is unchanged; test results follow.
---
.../api-model/src/languages/jvm-examples.ts | 2 +-
.../workspace/guides/installation.md | 10 +---
site/src/content/docs/concepts/queries.md | 2 +-
.../concepts/server-session-window-pane.md | 2 +-
site/src/content/docs/concepts/transports.md | 2 +-
site/src/content/docs/concepts/workspaces.md | 2 +-
.../docs/examples/attach-and-send-keys.md | 2 +-
.../docs/examples/capture-pane-output.md | 2 +-
.../docs/examples/workspace-from-file.md | 2 +-
.../content/docs/guides/attaching-to-tmux.md | 2 +-
.../content/docs/guides/capturing-output.md | 2 +-
.../content/docs/guides/getting-started.md | 2 +-
site/src/content/docs/guides/index.md | 3 ++
.../docs/guides/querying-and-filtering.md | 2 +-
site/src/content/docs/guides/sending-keys.md | 2 +-
.../docs/guides/testing-with-libtmux.md | 2 +-
site/src/content/docs/guides/tmux-support.md | 48 +++++++++++++++++++
.../workspace/reference/compatibility.md | 2 +-
.../cxx/workspace/reference/compatibility.md | 2 +-
site/src/content/docs/ports/go/mcp/index.md | 2 +-
.../go/workspace/reference/compatibility.md | 2 +-
.../ports/java/guides/attaching-to-tmux.md | 2 +-
.../content/docs/ports/java/mcp/examples.md | 2 +-
.../src/content/docs/ports/java/mcp/guides.md | 2 +-
.../java/workspace/reference/compatibility.md | 2 +-
.../docs/ports/kotlin/concepts/queries.md | 2 +-
.../concepts/server-session-window-pane.md | 2 +-
.../docs/ports/kotlin/concepts/transports.md | 2 +-
.../docs/ports/kotlin/concepts/workspaces.md | 2 +-
.../ports/kotlin/guides/attaching-to-tmux.md | 2 +-
.../content/docs/ports/py/concepts/queries.md | 4 +-
.../docs/ports/py/guides/attaching-to-tmux.md | 2 +-
site/src/content/docs/ports/py/mcp/guides.md | 2 +-
site/src/content/docs/ports/py/mcp/index.md | 2 +-
.../docs/ports/py/topics/options-and-hooks.md | 4 +-
.../content/docs/ports/py/workspace/guides.md | 2 +-
.../py/workspace/reference/compatibility.md | 2 +-
site/src/content/docs/ports/rs/mcp/index.md | 2 +-
.../rs/workspace/reference/compatibility.md | 2 +-
.../src/content/docs/ports/ruby/mcp/guides.md | 2 +-
site/src/content/docs/ports/ruby/mcp/index.md | 2 +-
.../docs/ports/scala/concepts/queries.md | 2 +-
.../concepts/server-session-window-pane.md | 2 +-
.../docs/ports/scala/concepts/transports.md | 2 +-
.../docs/ports/scala/concepts/workspaces.md | 2 +-
.../ports/scala/guides/attaching-to-tmux.md | 2 +-
.../workspace/reference/compatibility.md | 2 +-
.../ts/workspace/reference/compatibility.md | 2 +-
site/src/content/docs/topics/architecture.md | 2 +-
.../content/docs/topics/context-managers.md | 2 +-
site/src/content/docs/topics/environment.md | 2 +-
.../docs/topics/errors-and-exceptions.md | 2 +-
site/src/content/docs/topics/format-tokens.md | 2 +-
.../content/docs/topics/options-and-hooks.md | 2 +-
.../content/docs/topics/pane-interaction.md | 2 +-
.../content/docs/topics/socket-and-servers.md | 2 +-
site/src/content/docs/topics/traversal.md | 2 +-
.../content/docs/topics/waiting-and-retry.md | 2 +-
site/src/data/home-examples.json | 2 +-
site/src/lib/ports.ts | 2 +-
site/test/browse-cards.test.ts | 2 +-
61 files changed, 113 insertions(+), 68 deletions(-)
create mode 100644 site/src/content/docs/guides/tmux-support.md
diff --git a/packages/api-model/src/languages/jvm-examples.ts b/packages/api-model/src/languages/jvm-examples.ts
index eac0579f6..0030a846c 100644
--- a/packages/api-model/src/languages/jvm-examples.ts
+++ b/packages/api-model/src/languages/jvm-examples.ts
@@ -76,7 +76,7 @@ export function attachCompleteJvmExamples(
}
const blocks: NonNullable = [{
lang: 'console',
- intro: `${program.description.replace(/\n/g, ' ')} Use JDK 25, Git, and tmux 3.2a through 3.7c on Linux, with /bin/cat and /bin/sh available. In an empty directory, fetch the documented library revision:`,
+ intro: `${program.description.replace(/\n/g, ' ')} Use JDK 25, Git, and tmux 3.3a through 3.7c on Linux, with /bin/cat and /bin/sh available. In an empty directory, fetch the documented library revision:`,
code: `$ git clone https://github.com/${source.repo}.git libtmux-source && \\\n git -C libtmux-source checkout ${source.revision}\n`,
}]
for (const file of files) blocks.push({
diff --git a/site/src/content/_workspace-shared/workspace/guides/installation.md b/site/src/content/_workspace-shared/workspace/guides/installation.md
index f5eb92b4a..6b2c49550 100644
--- a/site/src/content/_workspace-shared/workspace/guides/installation.md
+++ b/site/src/content/_workspace-shared/workspace/guides/installation.md
@@ -11,7 +11,7 @@ title: Install and load a workspace
The runnable terminal loader is the separate Python application tmuxp. Its
-documented prerequisites are Python 3.10 or newer and tmux 3.2 or newer. Install
+documented prerequisites are Python 3.10 or newer and tmux 3.3a or newer. Install
it in an isolated tool environment with uv:
```console
$ uv tool install tmuxp
@@ -69,13 +69,7 @@ $ tmux -L workspace-guide kill-session -t '=workspace-guide'
Build the documented `tmux-workspace` revision, then load a small session on a
-private socket.
-
-Use a Unix shell with tmux 3.3a or newer on `PATH`.
-
-
-Use a Unix shell with tmux 3.2a or newer on `PATH`.
-
+private socket. Use a Unix shell with tmux 3.3a or newer on `PATH`.
## Build the command
diff --git a/site/src/content/docs/concepts/queries.md b/site/src/content/docs/concepts/queries.md
index 27dd44dad..b4a2aa2fb 100644
--- a/site/src/content/docs/concepts/queries.md
+++ b/site/src/content/docs/concepts/queries.md
@@ -18,7 +18,7 @@ rows; an empty listing is a successful command.
## Match names and choose fields
-Save this complete script as `queries.sh`. It requires tmux 3.2a or newer and
+Save this complete script as `queries.sh`. It requires tmux 3.3a or newer and
a POSIX shell. It creates a private server, runs the queries, and stops that
server on exit.
diff --git a/site/src/content/docs/concepts/server-session-window-pane.md b/site/src/content/docs/concepts/server-session-window-pane.md
index 4644cf13b..0ea4f550e 100644
--- a/site/src/content/docs/concepts/server-session-window-pane.md
+++ b/site/src/content/docs/concepts/server-session-window-pane.md
@@ -47,7 +47,7 @@ one server lifetime: another server using the same socket path can reuse IDs.
The [target syntax](/tmux/latest/manual/full/#COMMANDS) describes how commands
resolve IDs, names, and indexes.
-Save this complete script as `hierarchy.sh`. It requires tmux 3.2a or newer
+Save this complete script as `hierarchy.sh`. It requires tmux 3.3a or newer
and a POSIX shell. It renames a session and a window, checks their IDs, and
links the window into another session on its private server.
diff --git a/site/src/content/docs/concepts/transports.md b/site/src/content/docs/concepts/transports.md
index 8872412e9..89844052f 100644
--- a/site/src/content/docs/concepts/transports.md
+++ b/site/src/content/docs/concepts/transports.md
@@ -22,7 +22,7 @@ reports replies and events on standard output.
## Group commands and open control mode
-Save this complete script as `transports.sh`. It requires tmux 3.2a or newer
+Save this complete script as `transports.sh`. It requires tmux 3.3a or newer
and a POSIX shell. It creates a private server with a command group, sends
commands through a control client, and cleans up the server.
diff --git a/site/src/content/docs/concepts/workspaces.md b/site/src/content/docs/concepts/workspaces.md
index b08d0ecf3..976c69582 100644
--- a/site/src/content/docs/concepts/workspaces.md
+++ b/site/src/content/docs/concepts/workspaces.md
@@ -19,7 +19,7 @@ programs running.
## Build a pane layout
-Save this complete script as `layout.sh`. It requires tmux 3.2a or newer and
+Save this complete script as `layout.sh`. It requires tmux 3.3a or newer and
a POSIX shell. It creates a three-pane editor window and a one-pane logs
window on a private server, then stops that server on exit.
diff --git a/site/src/content/docs/examples/attach-and-send-keys.md b/site/src/content/docs/examples/attach-and-send-keys.md
index 033af8148..83e55ea09 100644
--- a/site/src/content/docs/examples/attach-and-send-keys.md
+++ b/site/src/content/docs/examples/attach-and-send-keys.md
@@ -13,7 +13,7 @@ A script can drive a shell it never shows. It starts a detached session, types
into the pane with `send-keys`, and reads the screen back with `capture-pane`.
The steps below add one command each. Every block is a range of lines from the
finished `send-command.sh`, so each step shows code that runs. [The complete
-script](#the-complete-script) follows the last step. It needs tmux 3.2a or
+script](#the-complete-script) follows the last step. It needs tmux 3.3a or
newer and a POSIX shell.
## 1. Choose a private socket
diff --git a/site/src/content/docs/examples/capture-pane-output.md b/site/src/content/docs/examples/capture-pane-output.md
index f129593bb..a56c0d0c3 100644
--- a/site/src/content/docs/examples/capture-pane-output.md
+++ b/site/src/content/docs/examples/capture-pane-output.md
@@ -14,7 +14,7 @@ its result are separate operations: the pane's shell may still be processing
input when the first capture runs. The steps below build `capture.sh` around
that gap. It sends a command, captures the screen until one complete line
appears, and removes its server. [The complete script](#the-complete-script)
-follows the last step. It requires tmux 3.2 or newer and `sleep` with
+follows the last step. It requires tmux 3.3a or newer and `sleep` with
fractional seconds.
## 1. Choose a private socket
diff --git a/site/src/content/docs/examples/workspace-from-file.md b/site/src/content/docs/examples/workspace-from-file.md
index a6ed71bd7..7223535f1 100644
--- a/site/src/content/docs/examples/workspace-from-file.md
+++ b/site/src/content/docs/examples/workspace-from-file.md
@@ -12,7 +12,7 @@ tableOfContents: true
A tmux command file can create a session, arrange its windows, and split its
panes. This example builds two windows with three panes, prints their names
and pane counts, then removes its private server. The first four steps write
-the command file, and the last four load and inspect it. It requires tmux 3.2
+the command file, and the last four load and inspect it. It requires tmux 3.3a
or newer and a POSIX shell.
## 1. Create a detached session
diff --git a/site/src/content/docs/guides/attaching-to-tmux.md b/site/src/content/docs/guides/attaching-to-tmux.md
index 3af1aac06..b3732e87b 100644
--- a/site/src/content/docs/guides/attaching-to-tmux.md
+++ b/site/src/content/docs/guides/attaching-to-tmux.md
@@ -69,7 +69,7 @@ its name. Each command stays in the calling shell; no terminal is attached.
It stops its own server on success or failure.
Save it as `connect.sh` and run `sh connect.sh`, or paste the whole block into
-a POSIX shell. It requires tmux 3.2a or newer.
+a POSIX shell. It requires tmux 3.3a or newer.
```sh title="connect.sh"
(
diff --git a/site/src/content/docs/guides/capturing-output.md b/site/src/content/docs/guides/capturing-output.md
index a2718162c..cb101df0f 100644
--- a/site/src/content/docs/guides/capturing-output.md
+++ b/site/src/content/docs/guides/capturing-output.md
@@ -19,7 +19,7 @@ This example forces output into scrollback: it prints 40 numbered lines in a
pane with 10 rows. A normal capture shows the last screenful. Adding `-S -`
also retrieves earlier lines, including `row-1`.
-Save the script as `history.sh`. It needs tmux 3.2a or newer, a POSIX shell and
+Save the script as `history.sh`. It needs tmux 3.3a or newer, a POSIX shell and
fractional `sleep` support.
```sh title="history.sh"
diff --git a/site/src/content/docs/guides/getting-started.md b/site/src/content/docs/guides/getting-started.md
index 0b74a5115..58c41f170 100644
--- a/site/src/content/docs/guides/getting-started.md
+++ b/site/src/content/docs/guides/getting-started.md
@@ -15,7 +15,7 @@ same tmux objects that the language libraries control.
## Install tmux
Install tmux with your platform's package manager. These examples require tmux
-3.2a or newer and a POSIX shell. Confirm the installed version:
+3.3a or newer and a POSIX shell. Confirm the installed version:
```console
$ tmux -V
diff --git a/site/src/content/docs/guides/index.md b/site/src/content/docs/guides/index.md
index f9b4351f4..b0c677a71 100644
--- a/site/src/content/docs/guides/index.md
+++ b/site/src/content/docs/guides/index.md
@@ -33,6 +33,9 @@ cards:
- label: Testing
href: testing-with-libtmux/
body: Use isolated tmux servers and manage test cleanup.
+ - label: tmux support
+ href: tmux-support/
+ body: Find the tmux release every port requires and how an older daemon is refused.
---
Use these guides to run tmux tasks from a terminal or a shell script. Start
diff --git a/site/src/content/docs/guides/querying-and-filtering.md b/site/src/content/docs/guides/querying-and-filtering.md
index b1fa6c319..2498a5dec 100644
--- a/site/src/content/docs/guides/querying-and-filtering.md
+++ b/site/src/content/docs/guides/querying-and-filtering.md
@@ -21,7 +21,7 @@ Prefix a session target with `=` to require an exact name. `has-session` reports
whether it exists; it does not return a pane. This script selects panes in
`work` and rejects both zero matches and multiple matches before using an ID.
-Save the complete script as `query.sh`. It requires tmux 3.2a or newer and a
+Save the complete script as `query.sh`. It requires tmux 3.3a or newer and a
POSIX shell. It creates and cleans up its own server.
```sh title="query.sh"
diff --git a/site/src/content/docs/guides/sending-keys.md b/site/src/content/docs/guides/sending-keys.md
index 4e1c7704d..0b98c6bbf 100644
--- a/site/src/content/docs/guides/sending-keys.md
+++ b/site/src/content/docs/guides/sending-keys.md
@@ -17,7 +17,7 @@ separate operations.
This complete script types the word `Enter` into a pane running `cat`, then
presses the Enter key. Neither command starts an interactive tmux client.
-Save it as `send.sh` and run it in a POSIX shell with tmux 3.2a or newer and
+Save it as `send.sh` and run it in a POSIX shell with tmux 3.3a or newer and
fractional `sleep` support.
```sh title="send.sh"
diff --git a/site/src/content/docs/guides/testing-with-libtmux.md b/site/src/content/docs/guides/testing-with-libtmux.md
index c281d43d9..1b3b03684 100644
--- a/site/src/content/docs/guides/testing-with-libtmux.md
+++ b/site/src/content/docs/guides/testing-with-libtmux.md
@@ -16,7 +16,7 @@ a test run separate from your interactive sessions.
## Run an isolated test
This complete shell test creates a session and a window, checks their names,
-and prints `tmux fixture passed` on success. It requires tmux 3.2a or newer and
+and prints `tmux fixture passed` on success. It requires tmux 3.3a or newer and
a POSIX shell. Save it as `test-tmux.sh`.
```sh title="test-tmux.sh"
diff --git a/site/src/content/docs/guides/tmux-support.md b/site/src/content/docs/guides/tmux-support.md
new file mode 100644
index 000000000..1d7c9b117
--- /dev/null
+++ b/site/src/content/docs/guides/tmux-support.md
@@ -0,0 +1,48 @@
+---
+supportedPorts: []
+title: tmux support
+description: The tmux release every libtmux port requires and how a library refuses an older daemon.
+sidebar:
+ label: tmux support
+ group: Guides
+ order: 8
+tableOfContents: true
+---
+
+Every libtmux port, the MCP servers and the workspace builders support tmux
+3.3a and newer. A daemon older than 3.3a is refused before the requested
+operation has any effect.
+
+## The core minimum
+
+The minimum for ordinary reads, writes, batches, raw commands, workspace
+loading and MCP tools is tmux 3.3a. Releases compare in full, including patch
+letters, so 3.3 is below the minimum and 3.3a is the first supported release.
+A development build such as `next-3.9` ranks below the release it precedes, and
+a release candidate ranks below its release. A version the library cannot
+read is refused, not assumed to be new enough.
+
+Libraries judge the daemon that answers on the selected socket, not the `tmux`
+executable that sends the command. The two can differ, for example when a
+newer client binary talks to a server started by an older one. The rules are:
+
+- An existing server is checked by the version it reports. A newer client
+ binary does not authorize an older daemon.
+- With no server on the socket, the library validates the executable that
+ would start one.
+- A server that restarts on the same socket is checked again before ordinary
+ operations use it.
+- Typed methods, raw commands, command batches, workspace loading and MCP
+ tools all pass the same check. A lenient listing call reports the refusal
+ instead of returning an empty list.
+- The refusal raises the port's version error and happens before the command
+ runs, so a refused call leaves no session, window, option or buffer behind.
+
+Running `tmux -V` or `tmux -h` on an older executable still works; see the
+[command reference](/tmux/latest/manual/full/#COMMANDS). Their output does not
+authorize later operations.
+
+The check assumes tmux's built-in commands keep their meaning. A
+[`command-alias`](/tmux/latest/manual/full/#OPTIONS) that redefines a built-in command the library uses to
+identify or guard the daemon is outside this guarantee, as are the contents
+of user-written aliases and shell programs a library only forwards.
diff --git a/site/src/content/docs/ports/csharp/workspace/reference/compatibility.md b/site/src/content/docs/ports/csharp/workspace/reference/compatibility.md
index 39993b7aa..94546b660 100644
--- a/site/src/content/docs/ports/csharp/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/csharp/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the .NET command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.3a or newer.
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
## Runtime and execution
diff --git a/site/src/content/docs/ports/cxx/workspace/reference/compatibility.md b/site/src/content/docs/ports/cxx/workspace/reference/compatibility.md
index 8772061c9..de70d083f 100644
--- a/site/src/content/docs/ports/cxx/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/cxx/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the C++ command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.3a or newer.
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
## Runtime and execution
diff --git a/site/src/content/docs/ports/go/mcp/index.md b/site/src/content/docs/ports/go/mcp/index.md
index b4669ed1b..cdbcf6543 100644
--- a/site/src/content/docs/ports/go/mcp/index.md
+++ b/site/src/content/docs/ports/go/mcp/index.md
@@ -26,7 +26,7 @@ is a separate Go module that exposes
tmux through MCP. Its executable is `libtmux-mcp`. Installing the core
tmux module does not install this server or its protocol dependencies.
-The server requires Go 1.26 or newer to build and tmux 3.3a or newer to run.
+The server requires Go 1.26 or newer to build and tmux 3.3a or newer to run. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
The MCP client launches `libtmux-mcp` and exchanges messages over stdin and
stdout. The server selects one tmux endpoint and its offered tools at startup.
Reconnect after changing that configuration.
diff --git a/site/src/content/docs/ports/go/workspace/reference/compatibility.md b/site/src/content/docs/ports/go/workspace/reference/compatibility.md
index 3375bb96b..eabae1d35 100644
--- a/site/src/content/docs/ports/go/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/go/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the Go command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.3a or newer.
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
## Runtime and execution
diff --git a/site/src/content/docs/ports/java/guides/attaching-to-tmux.md b/site/src/content/docs/ports/java/guides/attaching-to-tmux.md
index eaf698352..3f52fa373 100644
--- a/site/src/content/docs/ports/java/guides/attaching-to-tmux.md
+++ b/site/src/content/docs/ports/java/guides/attaching-to-tmux.md
@@ -56,7 +56,7 @@ public final class Connect {
## Setup and run
-Use an empty directory on Linux with Git and tmux 3.2a or newer installed.
+Use an empty directory on Linux with Git and tmux 3.3a or newer installed.
This example was checked with JDK 25.0.3, library bytecode target Java 21.
diff --git a/site/src/content/docs/ports/java/mcp/examples.md b/site/src/content/docs/ports/java/mcp/examples.md
index 8fd619e9f..c69fd5ce9 100644
--- a/site/src/content/docs/ports/java/mcp/examples.md
+++ b/site/src/content/docs/ports/java/mcp/examples.md
@@ -19,7 +19,7 @@ For a client configured to launch the server itself, use the
## Create the project
-Use JDK 25, Git, tmux 3.2a or newer, and a Unix host with `env -u`. Create an
+Use JDK 25, Git, tmux 3.3a or newer, and a Unix host with `env -u`. Create an
empty project and fetch the source revision used by this example:
```console
diff --git a/site/src/content/docs/ports/java/mcp/guides.md b/site/src/content/docs/ports/java/mcp/guides.md
index 53d9708ec..2b6ecb55d 100644
--- a/site/src/content/docs/ports/java/mcp/guides.md
+++ b/site/src/content/docs/ports/java/mcp/guides.md
@@ -15,7 +15,7 @@ private server when the MCP process exits.
## Build the launcher
-Use JDK 25, Git, and tmux 3.2a or newer on a Unix host. Create an empty directory:
+Use JDK 25, Git, and tmux 3.3a or newer on a Unix host. Create an empty directory:
```console
$ mkdir java-mcp-client && cd java-mcp-client
diff --git a/site/src/content/docs/ports/java/workspace/reference/compatibility.md b/site/src/content/docs/ports/java/workspace/reference/compatibility.md
index cb3958bb7..f87e9921d 100644
--- a/site/src/content/docs/ports/java/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/java/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the Java command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.2a or newer.
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
## Runtime and execution
diff --git a/site/src/content/docs/ports/kotlin/concepts/queries.md b/site/src/content/docs/ports/kotlin/concepts/queries.md
index 12cdb13e1..f08f9de67 100644
--- a/site/src/content/docs/ports/kotlin/concepts/queries.md
+++ b/site/src/content/docs/ports/kotlin/concepts/queries.md
@@ -16,7 +16,7 @@ Filter captured objects in Kotlin, handle result counts explicitly, and match se
## Setup and run
-Use an empty directory on Linux with Git, tmux 3.2a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
+Use an empty directory on Linux with Git, tmux 3.3a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
The pinned source checkout supplies the Gradle wrapper and the library dependency.
diff --git a/site/src/content/docs/ports/kotlin/concepts/server-session-window-pane.md b/site/src/content/docs/ports/kotlin/concepts/server-session-window-pane.md
index c310a42c9..bafdad26e 100644
--- a/site/src/content/docs/ports/kotlin/concepts/server-session-window-pane.md
+++ b/site/src/content/docs/ports/kotlin/concepts/server-session-window-pane.md
@@ -18,7 +18,7 @@ A session holds window placements; a window holds panes. A linked window can app
## Setup and run
-Use an empty directory on Linux with Git, tmux 3.2a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
+Use an empty directory on Linux with Git, tmux 3.3a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
The pinned source checkout supplies the Gradle wrapper and the library dependency.
diff --git a/site/src/content/docs/ports/kotlin/concepts/transports.md b/site/src/content/docs/ports/kotlin/concepts/transports.md
index 665791ab0..8f3cef7a3 100644
--- a/site/src/content/docs/ports/kotlin/concepts/transports.md
+++ b/site/src/content/docs/ports/kotlin/concepts/transports.md
@@ -16,7 +16,7 @@ Choose command calls for bounded operations and a control connection when you ne
## Setup and run
-Use an empty directory on Linux with Git, tmux 3.2a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
+Use an empty directory on Linux with Git, tmux 3.3a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
The pinned source checkout supplies the Gradle wrapper and the library dependency.
diff --git a/site/src/content/docs/ports/kotlin/concepts/workspaces.md b/site/src/content/docs/ports/kotlin/concepts/workspaces.md
index c272442b2..37697a1ed 100644
--- a/site/src/content/docs/ports/kotlin/concepts/workspaces.md
+++ b/site/src/content/docs/ports/kotlin/concepts/workspaces.md
@@ -14,7 +14,7 @@ Build a tmux layout from Kotlin by creating a window, splitting a pane and selec
## Setup and run
-Use an empty directory on Linux with Git, tmux 3.2a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
+Use an empty directory on Linux with Git, tmux 3.3a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
The pinned source checkout supplies the Gradle wrapper and the library dependency.
diff --git a/site/src/content/docs/ports/kotlin/guides/attaching-to-tmux.md b/site/src/content/docs/ports/kotlin/guides/attaching-to-tmux.md
index a0dfc8686..2b1b0aa5f 100644
--- a/site/src/content/docs/ports/kotlin/guides/attaching-to-tmux.md
+++ b/site/src/content/docs/ports/kotlin/guides/attaching-to-tmux.md
@@ -52,7 +52,7 @@ fun main() = runBlocking {
## Setup and run
-Use an empty directory on Linux with Git and tmux 3.2a or newer installed.
+Use an empty directory on Linux with Git and tmux 3.3a or newer installed.
This example was checked with JDK 25.0.3, Kotlin 2.4.10.
diff --git a/site/src/content/docs/ports/py/concepts/queries.md b/site/src/content/docs/ports/py/concepts/queries.md
index 27598bf25..b2c096437 100644
--- a/site/src/content/docs/ports/py/concepts/queries.md
+++ b/site/src/content/docs/ports/py/concepts/queries.md
@@ -56,8 +56,8 @@ to the server instead, so libtmux builds objects only for the matches:
>>> server.search_sessions(filter='#{==:#{session_name},alpha-1}')
```
-Python-side lookups work with the library's supported tmux versions. The tmux
-filter grammar requires tmux 3.2 or newer. An unknown format token expands to an
+Python-side lookups work with the library's supported tmux versions, and the
+tmux filter grammar is available on all of them. An unknown format token expands to an
empty value, so a malformed filter can look like a valid filter with no matches.
If `search_*()` unexpectedly returns no results, try `#{m:*,#{session_name}}` to
check that the session data is available.
diff --git a/site/src/content/docs/ports/py/guides/attaching-to-tmux.md b/site/src/content/docs/ports/py/guides/attaching-to-tmux.md
index 4a007a2c0..d7f0624ff 100644
--- a/site/src/content/docs/ports/py/guides/attaching-to-tmux.md
+++ b/site/src/content/docs/ports/py/guides/attaching-to-tmux.md
@@ -38,7 +38,7 @@ print(session.session_name)
## Setup and run
-Use an empty directory on Linux with Git and tmux 3.2a or newer installed.
+Use an empty directory on Linux with Git and tmux 3.3a or newer installed.
This example was checked with Python 3.14.6.
diff --git a/site/src/content/docs/ports/py/mcp/guides.md b/site/src/content/docs/ports/py/mcp/guides.md
index 72925dd3f..3985fe063 100644
--- a/site/src/content/docs/ports/py/mcp/guides.md
+++ b/site/src/content/docs/ports/py/mcp/guides.md
@@ -10,7 +10,7 @@ sidebar:
---
Configure the client to launch `libtmux-mcp` with a named tmux socket.
-Install [uv](https://docs.astral.sh/uv/) first, and make tmux 3.2a or newer
+Install [uv](https://docs.astral.sh/uv/) first, and make tmux 3.3a or newer
available in the environment the client passes to the server.
## Launch the server
diff --git a/site/src/content/docs/ports/py/mcp/index.md b/site/src/content/docs/ports/py/mcp/index.md
index 7c724af94..176a0870b 100644
--- a/site/src/content/docs/ports/py/mcp/index.md
+++ b/site/src/content/docs/ports/py/mcp/index.md
@@ -13,7 +13,7 @@ run commands, and wait for their results. The distribution and executable are
`libtmux-mcp`; Python imports use `libtmux_mcp`.
The server runs over standard input and output. It requires Python 3.10 or
-newer and tmux 3.2a or newer. Its default toolsets are `inspect`, `manage`,
+newer and tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/). Its default toolsets are `inspect`, `manage`,
and `execute`; deletion tools require an explicit selection.
## Start here
diff --git a/site/src/content/docs/ports/py/topics/options-and-hooks.md b/site/src/content/docs/ports/py/topics/options-and-hooks.md
index 44c04cfda..aea739c2b 100644
--- a/site/src/content/docs/ports/py/topics/options-and-hooks.md
+++ b/site/src/content/docs/ports/py/topics/options-and-hooks.md
@@ -82,8 +82,8 @@ The compatibility notes list these tmux requirements:
| Feature | Minimum tmux |
|---------|-------------|
-| All options/hooks features | 3.2+ |
-| Window/pane hook *scope flags* (`-w`, `-p`) accepted | 3.2+; see the supported-scope caveat above |
+| All options/hooks features | 3.3a+ |
+| Window/pane hook *scope flags* (`-w`, `-p`) accepted | 3.3a+; see the supported-scope caveat above |
| `client-active`, `window-resized` hooks | 3.3+ |
| `pane-title-changed` hook | 3.2+ |
diff --git a/site/src/content/docs/ports/py/workspace/guides.md b/site/src/content/docs/ports/py/workspace/guides.md
index 0eab3f88e..b52c391c5 100644
--- a/site/src/content/docs/ports/py/workspace/guides.md
+++ b/site/src/content/docs/ports/py/workspace/guides.md
@@ -9,7 +9,7 @@ sidebar:
tableOfContents: true
---
-Install tmuxp as a Python tool, with Python 3.10 or newer and tmux 3.2 or newer
+Install tmuxp as a Python tool, with Python 3.10 or newer and tmux 3.3a or newer
available on the host:
```console
diff --git a/site/src/content/docs/ports/py/workspace/reference/compatibility.md b/site/src/content/docs/ports/py/workspace/reference/compatibility.md
index fa6b4a74f..b6d202e71 100644
--- a/site/src/content/docs/ports/py/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/py/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
These pages document tmuxp 1.74.0 at the source revision linked below. Install
tmuxp in its own Python environment and let its dependency resolver select a
compatible libtmux release. The walkthroughs use Python 3.10 or newer and
-tmux 3.2a or newer.
+tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
## Configuration and extensions
diff --git a/site/src/content/docs/ports/rs/mcp/index.md b/site/src/content/docs/ports/rs/mcp/index.md
index d5e8a13fe..bd0a139df 100644
--- a/site/src/content/docs/ports/rs/mcp/index.md
+++ b/site/src/content/docs/ports/rs/mcp/index.md
@@ -12,7 +12,7 @@ sidebar:
terminal capture, command execution, bounded waits, and a static capability
resource.
-Building requires Rust 1.88 or newer. Running requires tmux 3.3a or newer.
+Building requires Rust 1.88 or newer. Running requires tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
Toolsets select inspection, management, execution, and teardown. Read
`tmux://capabilities` for the effective startup selection.
diff --git a/site/src/content/docs/ports/rs/workspace/reference/compatibility.md b/site/src/content/docs/ports/rs/workspace/reference/compatibility.md
index c04c8b6d2..c55377497 100644
--- a/site/src/content/docs/ports/rs/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/rs/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the Rust command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.3a or newer.
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
## Runtime and execution
diff --git a/site/src/content/docs/ports/ruby/mcp/guides.md b/site/src/content/docs/ports/ruby/mcp/guides.md
index bcc7b376d..ce04ea07a 100644
--- a/site/src/content/docs/ports/ruby/mcp/guides.md
+++ b/site/src/content/docs/ports/ruby/mcp/guides.md
@@ -39,7 +39,7 @@ When launching the installed `libtmux-mcp` executable directly, pass
`--enable-tool tmux_capture` or `--enable-tool tmux_wait` as command arguments.
`tmux_wait` can observe screen text or a process exit. Strong process tracking
-requires tmux 3.3 or newer and a supported native identity backend. A refusal
+requires tmux 3.3a or newer and a supported native identity backend. A refusal
means the required evidence is unavailable; it is not a successful wait.
See the [tool reference](../tools/) for arguments and results.
diff --git a/site/src/content/docs/ports/ruby/mcp/index.md b/site/src/content/docs/ports/ruby/mcp/index.md
index 3a531c9c0..111a384c0 100644
--- a/site/src/content/docs/ports/ruby/mcp/index.md
+++ b/site/src/content/docs/ports/ruby/mcp/index.md
@@ -27,6 +27,6 @@ calling an undisclosed name.
- [Language API](./reference/) documents the Ruby embedding surface.
The server requires Ruby 3.3 or newer. Strong process tracking for waits and
-authored runs requires tmux 3.3 or newer plus native process identity support.
+authored runs requires tmux 3.3a or newer plus native process identity support.
The [MCP server guide](./source-guide/) is staged from the same revision
as the generated reference.
diff --git a/site/src/content/docs/ports/scala/concepts/queries.md b/site/src/content/docs/ports/scala/concepts/queries.md
index f9d7b4678..595cf5ec1 100644
--- a/site/src/content/docs/ports/scala/concepts/queries.md
+++ b/site/src/content/docs/ports/scala/concepts/queries.md
@@ -16,7 +16,7 @@ Filter captured objects in Scala, handle result counts explicitly, and match ses
## Setup and run
-Use an empty directory on Linux with Git, tmux 3.2a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
+Use an empty directory on Linux with Git, tmux 3.3a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
The pinned source checkout supplies the Gradle wrapper and the library dependency.
diff --git a/site/src/content/docs/ports/scala/concepts/server-session-window-pane.md b/site/src/content/docs/ports/scala/concepts/server-session-window-pane.md
index 59ab9d550..508bcecea 100644
--- a/site/src/content/docs/ports/scala/concepts/server-session-window-pane.md
+++ b/site/src/content/docs/ports/scala/concepts/server-session-window-pane.md
@@ -18,7 +18,7 @@ A session holds window placements; a window holds panes. A linked window can app
## Setup and run
-Use an empty directory on Linux with Git, tmux 3.2a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
+Use an empty directory on Linux with Git, tmux 3.3a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
The pinned source checkout supplies the Gradle wrapper and the library dependency.
diff --git a/site/src/content/docs/ports/scala/concepts/transports.md b/site/src/content/docs/ports/scala/concepts/transports.md
index 1e1b6ec89..a85027ad9 100644
--- a/site/src/content/docs/ports/scala/concepts/transports.md
+++ b/site/src/content/docs/ports/scala/concepts/transports.md
@@ -16,7 +16,7 @@ The direct [`Server`](../../reference/io-github-libtmux-scaladsl-server/) API bl
## Setup and run
-Use an empty directory on Linux with Git, tmux 3.2a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
+Use an empty directory on Linux with Git, tmux 3.3a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
The pinned source checkout supplies the Gradle wrapper and the library dependency.
diff --git a/site/src/content/docs/ports/scala/concepts/workspaces.md b/site/src/content/docs/ports/scala/concepts/workspaces.md
index 5b4fe5825..72900c360 100644
--- a/site/src/content/docs/ports/scala/concepts/workspaces.md
+++ b/site/src/content/docs/ports/scala/concepts/workspaces.md
@@ -14,7 +14,7 @@ Build a tmux layout from Scala by creating a window, splitting a pane and select
## Setup and run
-Use an empty directory on Linux with Git, tmux 3.2a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
+Use an empty directory on Linux with Git, tmux 3.3a or newer, and JDK 25. Save the project files and launcher below, then save any complete program on this page. Each program has its own imports and entry point.
The pinned source checkout supplies the Gradle wrapper and the library dependency.
diff --git a/site/src/content/docs/ports/scala/guides/attaching-to-tmux.md b/site/src/content/docs/ports/scala/guides/attaching-to-tmux.md
index c22bb1017..b8403244b 100644
--- a/site/src/content/docs/ports/scala/guides/attaching-to-tmux.md
+++ b/site/src/content/docs/ports/scala/guides/attaching-to-tmux.md
@@ -52,7 +52,7 @@ object Connect {
## Setup and run
-Use an empty directory on Linux with Git and tmux 3.2a or newer installed.
+Use an empty directory on Linux with Git and tmux 3.3a or newer installed.
This example was checked with JDK 25.0.3, Scala 3.9.0.
diff --git a/site/src/content/docs/ports/swift/workspace/reference/compatibility.md b/site/src/content/docs/ports/swift/workspace/reference/compatibility.md
index cfe1f09b8..6ea4a1e20 100644
--- a/site/src/content/docs/ports/swift/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/swift/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the Swift command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.3a or newer.
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
## Runtime and execution
diff --git a/site/src/content/docs/ports/ts/workspace/reference/compatibility.md b/site/src/content/docs/ports/ts/workspace/reference/compatibility.md
index cc4f09989..aa32fabb1 100644
--- a/site/src/content/docs/ports/ts/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/ts/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the TypeScript command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.3a or newer.
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
## Runtime and execution
diff --git a/site/src/content/docs/topics/architecture.md b/site/src/content/docs/topics/architecture.md
index 5b21d0024..d052c2fcb 100644
--- a/site/src/content/docs/topics/architecture.md
+++ b/site/src/content/docs/topics/architecture.md
@@ -16,7 +16,7 @@ server. A command client can exit while the server and pane programs continue.
## Observe the server across client commands
-Save this complete script as `architecture.sh`. It requires tmux 3.2a or
+Save this complete script as `architecture.sh`. It requires tmux 3.3a or
newer and a POSIX shell. It starts a private server, reads it through separate
clients, and verifies that its session survives with no attached clients.
diff --git a/site/src/content/docs/topics/context-managers.md b/site/src/content/docs/topics/context-managers.md
index 3d1a49edd..5536acfc6 100644
--- a/site/src/content/docs/topics/context-managers.md
+++ b/site/src/content/docs/topics/context-managers.md
@@ -22,7 +22,7 @@ panes, and every session link to that window.
[`kill-session`](/tmux/latest/manual/kill-session/) destroys the session and
its window links. A window linked to another surviving session can remain.
-Save this complete script as `cleanup.sh`. It requires tmux 3.2a or newer and
+Save this complete script as `cleanup.sh`. It requires tmux 3.3a or newer and
a POSIX shell. It removes a temporary pane, window, and session while keeping
an independent session on the same private server.
diff --git a/site/src/content/docs/topics/environment.md b/site/src/content/docs/topics/environment.md
index a08f457d0..276edf8b5 100644
--- a/site/src/content/docs/topics/environment.md
+++ b/site/src/content/docs/topics/environment.md
@@ -16,7 +16,7 @@ processes. It does not change the environment of processes already running.
## Set defaults and a one-pane override
-Save this complete script as `environment.sh`. It requires tmux 3.2a or newer
+Save this complete script as `environment.sh`. It requires tmux 3.3a or newer
and a POSIX shell. It inspects global and session values, launches new panes,
and checks the environment each process receives on a private server.
diff --git a/site/src/content/docs/topics/errors-and-exceptions.md b/site/src/content/docs/topics/errors-and-exceptions.md
index 6c91d8831..2c6dd4c9e 100644
--- a/site/src/content/docs/topics/errors-and-exceptions.md
+++ b/site/src/content/docs/topics/errors-and-exceptions.md
@@ -16,7 +16,7 @@ can be handled as a branch in a shell script.
## Check absence and partial work
-Save this complete script as `failures.sh`. It requires tmux 3.2a or newer
+Save this complete script as `failures.sh`. It requires tmux 3.3a or newer
and a POSIX shell. It checks a missing session, deliberately fails a grouped
command, and inspects what remains on its private server.
diff --git a/site/src/content/docs/topics/format-tokens.md b/site/src/content/docs/topics/format-tokens.md
index 3b3d12b30..fd45b46fc 100644
--- a/site/src/content/docs/topics/format-tokens.md
+++ b/site/src/content/docs/topics/format-tokens.md
@@ -16,7 +16,7 @@ expansion and listing commands' `-F` flag to choose fields for each row.
## Read fields from a pane
-Save this complete script as `formats.sh`. It requires tmux 3.2a or newer and
+Save this complete script as `formats.sh`. It requires tmux 3.3a or newer and
a POSIX shell. It reads the context of a private pane, evaluates a conditional,
and checks the format inventory before cleaning up.
diff --git a/site/src/content/docs/topics/options-and-hooks.md b/site/src/content/docs/topics/options-and-hooks.md
index 12c987424..050023c7e 100644
--- a/site/src/content/docs/topics/options-and-hooks.md
+++ b/site/src/content/docs/topics/options-and-hooks.md
@@ -16,7 +16,7 @@ different effects.
## Set options and observe an event
-Save this complete script as `options.sh`. It requires tmux 3.2a or newer and
+Save this complete script as `options.sh`. It requires tmux 3.3a or newer and
a POSIX shell. It checks a global default and local overrides, then registers
and removes a session hook on its private server.
diff --git a/site/src/content/docs/topics/pane-interaction.md b/site/src/content/docs/topics/pane-interaction.md
index 44d1631d9..5c8bc2d1c 100644
--- a/site/src/content/docs/topics/pane-interaction.md
+++ b/site/src/content/docs/topics/pane-interaction.md
@@ -16,7 +16,7 @@ and observing its result as separate operations.
## Send a command and capture its result
-Save this complete script as `pane-io.sh`. It requires tmux 3.2a or newer and
+Save this complete script as `pane-io.sh`. It requires tmux 3.3a or newer and
a POSIX shell. It starts a shell with an empty prompt, sends a command, polls
for both result lines, and cleans up its private server.
diff --git a/site/src/content/docs/topics/socket-and-servers.md b/site/src/content/docs/topics/socket-and-servers.md
index 345dc7e8b..00838a677 100644
--- a/site/src/content/docs/topics/socket-and-servers.md
+++ b/site/src/content/docs/topics/socket-and-servers.md
@@ -20,7 +20,7 @@ an explicit socket path; when supplied, it takes precedence over `-L`. Without
an explicit selection, a client inside tmux can use the server recorded in
`TMUX`; an outside client uses the default socket.
-Save this complete script as `sockets.sh`. It requires tmux 3.2a or newer and
+Save this complete script as `sockets.sh`. It requires tmux 3.3a or newer and
a POSIX shell. It starts two private servers with the same session name,
changes one, and verifies that the other is unaffected.
diff --git a/site/src/content/docs/topics/traversal.md b/site/src/content/docs/topics/traversal.md
index 432d5d509..4822bea8e 100644
--- a/site/src/content/docs/topics/traversal.md
+++ b/site/src/content/docs/topics/traversal.md
@@ -16,7 +16,7 @@ address those objects.
## Read a hierarchy with a shared window
-Save this complete script as `traversal.sh`. It requires tmux 3.2a or newer
+Save this complete script as `traversal.sh`. It requires tmux 3.3a or newer
and a POSIX shell. It creates a shared window on a private server and checks
both listing-row counts and unique pane counts.
diff --git a/site/src/content/docs/topics/waiting-and-retry.md b/site/src/content/docs/topics/waiting-and-retry.md
index 76037055d..48aac41fb 100644
--- a/site/src/content/docs/topics/waiting-and-retry.md
+++ b/site/src/content/docs/topics/waiting-and-retry.md
@@ -16,7 +16,7 @@ cooperate, or poll an observable condition with a deadline.
## Signal completion and bound the wait
-Save this complete script as `waiting.sh`. It requires tmux 3.2a or newer,
+Save this complete script as `waiting.sh`. It requires tmux 3.3a or newer,
a POSIX shell, and the GNU coreutils `timeout` command. It starts a producer
on a private server, waits for its signal, checks a deadline, and releases
a cooperative lock before cleanup.
diff --git a/site/src/data/home-examples.json b/site/src/data/home-examples.json
index 24d28a1a6..33bba2b83 100644
--- a/site/src/data/home-examples.json
+++ b/site/src/data/home-examples.json
@@ -18,7 +18,7 @@
"code": "from __future__ import annotations\n\nfrom pathlib import Path\nimport shutil\nimport tempfile\nimport time\n\nimport libtmux\n\ndirectory = Path(tempfile.mkdtemp(prefix=\"libtmux-py-home-\"))\nsocket = directory / \"tmux.sock\"\nserver = libtmux.Server(socket_path=socket, config_file=\"/dev/null\")\n\ntry:\n session = server.new_session(session_name=\"demo\")\n window = session.active_window\n assert window is not None\n pane = window.split(shell=\"sh\")\n\n pane.send_keys(\"printf '\\\\nHello world\\\\n'\", enter=True)\n\n deadline = time.monotonic() + 5\n while \"Hello world\" not in pane.capture_pane():\n if time.monotonic() >= deadline:\n raise TimeoutError(\"The pane did not print Hello world\")\n time.sleep(0.02)\n\n print(\"Hello world\")\nexcept Exception as error:\n raise RuntimeError(\"tmux quickstart failed\") from error\nfinally:\n if socket.exists():\n server.kill()\n shutil.rmtree(directory)\n"
}
],
- "prerequisites": "POSIX shell, Git, tmux 3.2a or newer, Python 3.14.6 and uv (tested 0.12.0).",
+ "prerequisites": "POSIX shell, Git, tmux 3.3a or newer, Python 3.14.6 and uv (tested 0.12.0).",
"commands": [
"git init -q source\ngit -C source fetch -q --depth=1 \\\n https://github.com/tmux-python/libtmux.git \\\n 9fdd083a8181a827889337b63cd4e6daea661a8c\ngit -C source checkout -q --detach FETCH_HEAD\nuv venv .venv\nuv pip install --python .venv/bin/python ./source",
"unset TMUX TMUX_PANE\nexport ENV=/dev/null BASH_ENV=/dev/null SHELL=/bin/sh\n.venv/bin/python quickstart.py"
diff --git a/site/src/lib/ports.ts b/site/src/lib/ports.ts
index f24343670..39f25d928 100644
--- a/site/src/lib/ports.ts
+++ b/site/src/lib/ports.ts
@@ -648,7 +648,7 @@ const CORE_PORTS: readonly Port[] = [
// Unselected source installs follow the default branch.
git: { code: 'using Pkg\nPkg.add(PackageSpec(url="https://github.com/libtmux/libtmux-julia.git", rev="master"))', lang: 'julia' },
},
- installNote: 'Requires Julia 1.13.1 and tmux 3.7c or newer. JSON layouts require tmux 3.8. Companion packages install from the same revision as the core.',
+ installNote: 'Requires Julia 1.13.1 and tmux 3.3a or newer. JSON layouts require tmux 3.8. Companion packages install from the same revision as the core.',
},
{
slug: 'elixir',
diff --git a/site/test/browse-cards.test.ts b/site/test/browse-cards.test.ts
index 15a32a85d..4a399e962 100644
--- a/site/test/browse-cards.test.ts
+++ b/site/test/browse-cards.test.ts
@@ -28,7 +28,7 @@ const cards = (section: string, port?: string) =>
describe('shared browse cards', () => {
it.each([
- ['guides', 6], ['concepts', 4], ['topics', 10], ['examples', 3],
+ ['guides', 7], ['concepts', 4], ['topics', 10], ['examples', 3],
] as const)('keeps the %s destinations in shared and native version mounts', (section, count) => {
const shared = cards(section)
expect(shared).toHaveLength(count)
From 8f8c38edc85a5fa7e65ed1268be9c1193d28fc3a Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Sat, 17 Oct 2026 03:40:00 -0500
Subject: [PATCH 02/53] test(site) Check that tmux minimum statements name 3.3a
why: Scattered "tmux X or newer" statements across content,
example prerequisites and install notes had no check, so a page could
keep an old floor after the support contract moved.
what:
- Scan the content, home quickstart data, port install notes and example
introductions for "tmux X or newer", "tmux X+" and "tmux X through Y"
and require X to be 3.3a
- Skip facts about tmux itself, which follow "on", and staged port
guides, which carry the pinned port's own floor
- Reword the legacy 88-colour flag note so it states a tmux fact and not
a minimum
Verified: the check passes; restoring one "tmux 3.2a or newer" line in
topics/traversal.md makes it fail naming that file, and restoring the
line makes it pass.
---
.../_workspace-shared/workspace/cli/load.md | 2 +-
site/test/tmux-minimum.test.ts | 63 +++++++++++++++++++
2 files changed, 64 insertions(+), 1 deletion(-)
create mode 100644 site/test/tmux-minimum.test.ts
diff --git a/site/src/content/_workspace-shared/workspace/cli/load.md b/site/src/content/_workspace-shared/workspace/cli/load.md
index 19528fe54..d38a023c0 100644
--- a/site/src/content/_workspace-shared/workspace/cli/load.md
+++ b/site/src/content/_workspace-shared/workspace/cli/load.md
@@ -66,7 +66,7 @@ settings](../../configuration/environment/) for environment bindings and
| `-d` | flag; False | load the session without attaching it |
| `-a`, `--append` | flag; False | load workspace, appending windows to the current session |
| `-2` | flag; None | force tmux to assume the terminal supports 256 colours. |
-| `-8` | flag; None | legacy 88-colour flag; unsupported by tmux 3.2a+ |
+| `-8` | flag; None | legacy 88-colour flag; unsupported since tmux 3.2a |
| `--log-file` | value; None | file to log errors/output to |
| `--progress-format` | value; None | Spinner line format: preset name (default, minimal, window, pane, verbose) or a format string with tokens {session}, {window}, {progress}, {window_progress}, {pane_progress}, etc. Env: TMUXP_PROGRESS_FORMAT |
| `--progress-lines` | value; None | Number of script-output lines shown in the spinner panel (default: 3). 0 hides the panel entirely (script output goes to stdout). -1 shows unlimited lines (capped to terminal height). Env: TMUXP_PROGRESS_LINES |
diff --git a/site/test/tmux-minimum.test.ts b/site/test/tmux-minimum.test.ts
new file mode 100644
index 000000000..a1311601b
--- /dev/null
+++ b/site/test/tmux-minimum.test.ts
@@ -0,0 +1,63 @@
+import { readFileSync, readdirSync } from 'node:fs'
+import { dirname, join } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { describe, expect, it } from 'vitest'
+
+/**
+ * Every statement of a tmux minimum names the core floor.
+ *
+ * A requirement phrased "tmux X or newer", "tmux X+" or "tmux X through Y"
+ * is a support promise. These pages, example prerequisites and install notes
+ * must agree with the floor in the core tmux support contract. Facts about
+ * tmux itself, such as the release that added a format field, use other
+ * phrasing, or follow "on", and are not matched. Staged port guides come from
+ * pinned port revisions and carry their own floor.
+ */
+const FLOOR = '3.3a'
+const ROOT = join(dirname(fileURLToPath(import.meta.url)), '../..')
+const RANGES = [
+ 'site/src/content',
+ 'site/src/data/home-examples.json',
+ 'site/src/lib/ports.ts',
+ 'packages/api-model/src/languages',
+]
+
+function files(path: string): string[] {
+ const absolute = join(ROOT, path)
+ let entries
+ try { entries = readdirSync(absolute, { withFileTypes: true }) } catch { return [path] }
+ return entries.flatMap((entry) => files(join(path, entry.name)))
+}
+
+/** A minimum promise: the version after "tmux" is followed by a floor phrase. */
+export function minimums(text: string): string[] {
+ const found: string[] = []
+ const pattern = /(? {
+ it('recognizes each phrasing of a minimum', () => {
+ expect(minimums('Use tmux 3.2a or newer.')).toEqual(['3.2a'])
+ expect(minimums('Use tmux 3.2\nor newer.')).toEqual(['3.2'])
+ expect(minimums('Use tmux 3.2a through 3.7c.')).toEqual(['3.2a'])
+ expect(minimums('tmux 3.2a+ is a target')).toEqual(['3.2a'])
+ expect(minimums('A field present on tmux 3.3 or\nnewer is optional.')).toEqual([])
+ expect(minimums('The example ran on tmux 3.2a and 3.7c.')).toEqual([])
+ })
+
+ it('names the core floor everywhere a minimum is stated', () => {
+ const stale: string[] = []
+ let seen = 0
+ for (const path of RANGES.flatMap(files)) {
+ if (!/\.(md|mdx|json|ts)$/.test(path) || path.includes('/_staged/')) continue
+ for (const version of minimums(readFileSync(join(ROOT, path), 'utf8'))) {
+ seen += 1
+ if (version !== FLOOR) stale.push(`${path}: tmux ${version}`)
+ }
+ }
+ expect(seen).toBeGreaterThan(50)
+ expect(stale).toEqual([])
+ })
+})
From ad364579b9eaac2f4b3e443be1df7501be3fb57a Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Sat, 17 Oct 2026 11:33:51 -0500
Subject: [PATCH 03/53] fix(site) Link port pages to the shared tmux support
guide
why: The assembled-site link check failed on PR #150 with 11 broken
links. Port pages linked `/guides/tmux-support/`, which resolves inside
each port's own docs (`/en//latest/guides/tmux-support/`), and no
port has its own copy of that guide. Shared guides are served under
`/en/tmux/guides/`, which existing port pages reach by relative path.
what:
- Point the workspace compatibility pages at
`../../../../../tmux/guides/tmux-support/`
- Point the Python, Go and Rust MCP entry pages at
`../../../tmux/guides/tmux-support/`
---
.../docs/ports/csharp/workspace/reference/compatibility.md | 2 +-
.../content/docs/ports/cxx/workspace/reference/compatibility.md | 2 +-
site/src/content/docs/ports/go/mcp/index.md | 2 +-
.../content/docs/ports/go/workspace/reference/compatibility.md | 2 +-
.../docs/ports/java/workspace/reference/compatibility.md | 2 +-
site/src/content/docs/ports/py/mcp/index.md | 2 +-
.../content/docs/ports/py/workspace/reference/compatibility.md | 2 +-
site/src/content/docs/ports/rs/mcp/index.md | 2 +-
.../content/docs/ports/rs/workspace/reference/compatibility.md | 2 +-
.../docs/ports/swift/workspace/reference/compatibility.md | 2 +-
.../content/docs/ports/ts/workspace/reference/compatibility.md | 2 +-
11 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/site/src/content/docs/ports/csharp/workspace/reference/compatibility.md b/site/src/content/docs/ports/csharp/workspace/reference/compatibility.md
index 94546b660..f15329f99 100644
--- a/site/src/content/docs/ports/csharp/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/csharp/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the .NET command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](../../../../../tmux/guides/tmux-support/).
## Runtime and execution
diff --git a/site/src/content/docs/ports/cxx/workspace/reference/compatibility.md b/site/src/content/docs/ports/cxx/workspace/reference/compatibility.md
index de70d083f..07be32990 100644
--- a/site/src/content/docs/ports/cxx/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/cxx/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the C++ command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](../../../../../tmux/guides/tmux-support/).
## Runtime and execution
diff --git a/site/src/content/docs/ports/go/mcp/index.md b/site/src/content/docs/ports/go/mcp/index.md
index cdbcf6543..cfd2ce0bf 100644
--- a/site/src/content/docs/ports/go/mcp/index.md
+++ b/site/src/content/docs/ports/go/mcp/index.md
@@ -26,7 +26,7 @@ is a separate Go module that exposes
tmux through MCP. Its executable is `libtmux-mcp`. Installing the core
tmux module does not install this server or its protocol dependencies.
-The server requires Go 1.26 or newer to build and tmux 3.3a or newer to run. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
+The server requires Go 1.26 or newer to build and tmux 3.3a or newer to run. A daemon older than 3.3a is refused before any effect; see [tmux support](../../../tmux/guides/tmux-support/).
The MCP client launches `libtmux-mcp` and exchanges messages over stdin and
stdout. The server selects one tmux endpoint and its offered tools at startup.
Reconnect after changing that configuration.
diff --git a/site/src/content/docs/ports/go/workspace/reference/compatibility.md b/site/src/content/docs/ports/go/workspace/reference/compatibility.md
index eabae1d35..8a1cda596 100644
--- a/site/src/content/docs/ports/go/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/go/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the Go command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](../../../../../tmux/guides/tmux-support/).
## Runtime and execution
diff --git a/site/src/content/docs/ports/java/workspace/reference/compatibility.md b/site/src/content/docs/ports/java/workspace/reference/compatibility.md
index f87e9921d..6dea7e6a2 100644
--- a/site/src/content/docs/ports/java/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/java/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the Java command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](../../../../../tmux/guides/tmux-support/).
## Runtime and execution
diff --git a/site/src/content/docs/ports/py/mcp/index.md b/site/src/content/docs/ports/py/mcp/index.md
index 176a0870b..0279535d7 100644
--- a/site/src/content/docs/ports/py/mcp/index.md
+++ b/site/src/content/docs/ports/py/mcp/index.md
@@ -13,7 +13,7 @@ run commands, and wait for their results. The distribution and executable are
`libtmux-mcp`; Python imports use `libtmux_mcp`.
The server runs over standard input and output. It requires Python 3.10 or
-newer and tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/). Its default toolsets are `inspect`, `manage`,
+newer and tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](../../../tmux/guides/tmux-support/). Its default toolsets are `inspect`, `manage`,
and `execute`; deletion tools require an explicit selection.
## Start here
diff --git a/site/src/content/docs/ports/py/workspace/reference/compatibility.md b/site/src/content/docs/ports/py/workspace/reference/compatibility.md
index b6d202e71..7d0735957 100644
--- a/site/src/content/docs/ports/py/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/py/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
These pages document tmuxp 1.74.0 at the source revision linked below. Install
tmuxp in its own Python environment and let its dependency resolver select a
compatible libtmux release. The walkthroughs use Python 3.10 or newer and
-tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
+tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](../../../../../tmux/guides/tmux-support/).
## Configuration and extensions
diff --git a/site/src/content/docs/ports/rs/mcp/index.md b/site/src/content/docs/ports/rs/mcp/index.md
index bd0a139df..be7a05d69 100644
--- a/site/src/content/docs/ports/rs/mcp/index.md
+++ b/site/src/content/docs/ports/rs/mcp/index.md
@@ -12,7 +12,7 @@ sidebar:
terminal capture, command execution, bounded waits, and a static capability
resource.
-Building requires Rust 1.88 or newer. Running requires tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
+Building requires Rust 1.88 or newer. Running requires tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](../../../tmux/guides/tmux-support/).
Toolsets select inspection, management, execution, and teardown. Read
`tmux://capabilities` for the effective startup selection.
diff --git a/site/src/content/docs/ports/rs/workspace/reference/compatibility.md b/site/src/content/docs/ports/rs/workspace/reference/compatibility.md
index c55377497..9370a113d 100644
--- a/site/src/content/docs/ports/rs/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/rs/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the Rust command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](../../../../../tmux/guides/tmux-support/).
## Runtime and execution
diff --git a/site/src/content/docs/ports/swift/workspace/reference/compatibility.md b/site/src/content/docs/ports/swift/workspace/reference/compatibility.md
index 6ea4a1e20..32d608cf0 100644
--- a/site/src/content/docs/ports/swift/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/swift/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the Swift command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](../../../../../tmux/guides/tmux-support/).
## Runtime and execution
diff --git a/site/src/content/docs/ports/ts/workspace/reference/compatibility.md b/site/src/content/docs/ports/ts/workspace/reference/compatibility.md
index aa32fabb1..4d13beb11 100644
--- a/site/src/content/docs/ports/ts/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/ts/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
`tmux-workspace` is the TypeScript command for loading and capturing tmux
workspaces. The [installation guide](../../guides/installation/) builds the
documented source revision and runs a session on a private socket. The
-walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](/guides/tmux-support/).
+walkthroughs require tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](../../../../../tmux/guides/tmux-support/).
## Runtime and execution
From 151eac033bf93b973d0288d0929f010eb40fc38d Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Sat, 17 Oct 2026 13:24:56 -0500
Subject: [PATCH 04/53] chore(just) Clean ignored build output
why: .gitignore already names rebuildable output. A shell rm
list drifts across Windows and Unix, and git clean -x keeps
only positive -e patterns, so a negated .env exclude still
deletes .env.
what:
- Add clean and clean-dry with git clean -fdX, keeping .env
- Add nuke with git clean -fdx and a confirm prompt, naming
.env so it stays
---
justfile | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 justfile
diff --git a/justfile b/justfile
new file mode 100644
index 000000000..a5c2edf2c
--- /dev/null
+++ b/justfile
@@ -0,0 +1,23 @@
+# Remove ignored build output. .gitignore decides what that is.
+# https://just.systems/
+
+# List available commands
+default:
+ @just --list
+
+# Remove ignored build artifacts and caches. Untracked files and .env stay.
+[group: 'clean']
+clean:
+ git clean -fdX -e '!.env' -e '!.env.*'
+
+# Preview what clean will delete.
+[group: 'clean']
+clean-dry:
+ git clean -ndX -e '!.env' -e '!.env.*'
+
+# Remove ignored and untracked files. .env and .env.* stay.
+# git clean -x ignores .gitignore and only preserves -e patterns, so .env is named here rather than negated.
+[group: 'clean']
+[confirm("This will delete all untracked and ignored files. Continue?")]
+nuke:
+ git clean -fdx -e '.env' -e '.env.*'
From 2a662970ed97f9fccacb4b804214fce8216c178d Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Mon, 19 Oct 2026 20:20:39 -0500
Subject: [PATCH 05/53] feat(scripts[tmux-usage]) Record which library methods
send a tmux command
why: A tmux command page linked one library symbol per language, picked
from the concept map. That listed methods that only read a snapshot and
missed the ones that run the command. Which symbol runs list-panes, and
at which scope, is a fact of each port's source, and the API models
carry only the first line of a declaration, not its body.
what:
- Scan each port's source at the revision its API model was extracted
from, with tree-sitter (ruby and lua join the grammar table) and a
text scan for Julia, and keep every command-name literal with the
flags written beside it; docstrings, default values, error messages
and the Windows-only branch of the C++ port are not sends
- Credit the public symbol whose own body holds the literal, or the one
that calls the private helper that does; leave out a helper that many
public symbols call or that lists at several scopes
- Check reviewed claims for the sends a scan cannot see (a command named
by a template, a scope carried by a typed argument, a snapshot call, a
wrapper over another port) line by line against the pinned source, so
generation fails when one stops holding
- Give list-panes its server, session and window scopes and C functions,
checked against the call edges of both pinned tmux models and the
guard before each call
- Write site/src/data/tmux-usage/.json for list-panes, run
gen-tmux-usage --check in the medium loop and its negative check in
the publication audit
Verified: gen-tmux-usage --check --source regenerates all fifteen ports
byte for byte from the checkouts. The derivation tests fail when the
default-value, neighbour-flag, _WIN32, fan-out, one-hop and scope rules
are broken one at a time, and pass with them restored.
---
packages/api-model/src/parser.ts | 2 +
scripts/README.md | 32 ++
scripts/gen-tmux-usage.mjs | 260 ++++++++++++++++
scripts/gen-tmux-usage.negative.mjs | 85 ++++++
scripts/lib/tmux-usage-derive.mjs | 208 +++++++++++++
scripts/lib/tmux-usage-scan.mjs | 358 +++++++++++++++++++++++
scripts/lib/tmux-usage-scopes.mjs | 55 ++++
scripts/test-all.sh | 9 +
scripts/test-loop.mjs | 1 +
scripts/tmux-usage/claims.json | 116 ++++++++
site/src/data/tmux-usage/csharp.json | 97 ++++++
site/src/data/tmux-usage/cxx.json | 38 +++
site/src/data/tmux-usage/fsharp.json | 10 +
site/src/data/tmux-usage/go.json | 57 ++++
site/src/data/tmux-usage/java.json | 111 +++++++
site/src/data/tmux-usage/julia.json | 23 ++
site/src/data/tmux-usage/kotlin.json | 10 +
site/src/data/tmux-usage/lua.json | 24 ++
site/src/data/tmux-usage/powershell.json | 49 ++++
site/src/data/tmux-usage/py.json | 74 +++++
site/src/data/tmux-usage/rs.json | 56 ++++
site/src/data/tmux-usage/ruby.json | 44 +++
site/src/data/tmux-usage/scala.json | 10 +
site/src/data/tmux-usage/scopes.json | 12 +
site/src/data/tmux-usage/swift.json | 29 ++
site/src/data/tmux-usage/ts.json | 25 ++
site/test/tmux-usage-derive.test.ts | 245 ++++++++++++++++
27 files changed, 2040 insertions(+)
create mode 100644 scripts/gen-tmux-usage.mjs
create mode 100644 scripts/gen-tmux-usage.negative.mjs
create mode 100644 scripts/lib/tmux-usage-derive.mjs
create mode 100644 scripts/lib/tmux-usage-scan.mjs
create mode 100644 scripts/lib/tmux-usage-scopes.mjs
create mode 100644 scripts/tmux-usage/claims.json
create mode 100644 site/src/data/tmux-usage/csharp.json
create mode 100644 site/src/data/tmux-usage/cxx.json
create mode 100644 site/src/data/tmux-usage/fsharp.json
create mode 100644 site/src/data/tmux-usage/go.json
create mode 100644 site/src/data/tmux-usage/java.json
create mode 100644 site/src/data/tmux-usage/julia.json
create mode 100644 site/src/data/tmux-usage/kotlin.json
create mode 100644 site/src/data/tmux-usage/lua.json
create mode 100644 site/src/data/tmux-usage/powershell.json
create mode 100644 site/src/data/tmux-usage/py.json
create mode 100644 site/src/data/tmux-usage/rs.json
create mode 100644 site/src/data/tmux-usage/ruby.json
create mode 100644 site/src/data/tmux-usage/scala.json
create mode 100644 site/src/data/tmux-usage/scopes.json
create mode 100644 site/src/data/tmux-usage/swift.json
create mode 100644 site/src/data/tmux-usage/ts.json
create mode 100644 site/test/tmux-usage-derive.test.ts
diff --git a/packages/api-model/src/parser.ts b/packages/api-model/src/parser.ts
index 9bb441248..2fec1d696 100644
--- a/packages/api-model/src/parser.ts
+++ b/packages/api-model/src/parser.ts
@@ -31,6 +31,8 @@ const GRAMMAR = {
swift: 'swift',
kotlin: 'kotlin',
scala: 'scala',
+ ruby: 'ruby',
+ lua: 'lua',
} as const
export type GrammarName = keyof typeof GRAMMAR
diff --git a/scripts/README.md b/scripts/README.md
index afebf4608..a950b89ac 100644
--- a/scripts/README.md
+++ b/scripts/README.md
@@ -165,6 +165,38 @@ $ node scripts/gen-tmux-catalog.mjs --check --source ~/study/c/tmux
`gen-tmux-catalog.negative.mjs` proves the check fails on stale data.
+### Which library methods send a tmux command
+
+`gen-tmux-usage.mjs` records, per port, the public symbols whose source sends
+each tmux command and at which scope, in `site/src/data/tmux-usage/.json`.
+It reads each port's source at the revision its API model was extracted from,
+through the port checkouts named in `ports.ts` or
+`LIBTMUX_DOCS_CHECKOUT_`. A symbol is credited when a command-name
+literal, with the flags beside it, sits in its own body or in one private
+helper it calls. A command named by a template, a scope carried by a typed
+argument, or a call into a snapshot is a reviewed claim in
+`scripts/tmux-usage/claims.json`; each claim cites the lines that make it true
+and generation fails when one no longer holds. The commands covered are
+`COMMANDS` in the script; `site/src/data/tmux-usage/scopes.json` gives a
+command its scopes and C functions, checked against both pinned C models.
+
+```console
+$ node scripts/gen-tmux-usage.mjs
+```
+
+Verify the committed data. Without `--source` this checks shape and revisions;
+with it, the script regenerates from the checkouts and fails when the data is
+stale. `--report` lists the sends that no public symbol was credited with, and
+`--commands a,b` (or `all`) records other commands, which is how a command is
+added to the pages.
+
+```console
+$ node scripts/gen-tmux-usage.mjs --check --source
+```
+
+`gen-tmux-usage.negative.mjs` proves the check fails on each kind of stale
+data.
+
### Site checks
Four scripts assert things the build itself cannot notice. None of them needs
diff --git a/scripts/gen-tmux-usage.mjs b/scripts/gen-tmux-usage.mjs
new file mode 100644
index 000000000..f9179eac5
--- /dev/null
+++ b/scripts/gen-tmux-usage.mjs
@@ -0,0 +1,260 @@
+#!/usr/bin/env node
+/**
+ * Record which public symbols of each library send each tmux command.
+ *
+ * Every port's source is read at the revision its API model was extracted
+ * from. A send site is a command-name literal in code, with the flags written
+ * beside it; the scope those flags select decides which of the command's C
+ * functions the symbol answers. Sends a scan cannot see (a command named by a
+ * template, a scope passed as a typed argument) are reviewed claims in
+ * `scripts/tmux-usage/claims.json`; each one must still be true of the pinned
+ * source or generation fails.
+ *
+ * The result is `site/src/data/tmux-usage/.json`, keyed by public symbol.
+ *
+ * gen-tmux-usage.mjs regenerate from the port checkouts
+ * gen-tmux-usage.mjs --check verify shape and revision binding, no checkout
+ * gen-tmux-usage.mjs --check --source also regenerate and compare
+ * gen-tmux-usage.mjs --report list the sends no public symbol was credited with
+ * gen-tmux-usage.mjs --data read and write another copy of the data directory
+ * gen-tmux-usage.mjs --commands a,b record these commands (or `all`) instead of COMMANDS
+ */
+import { spawnSync } from 'node:child_process'
+import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
+import { homedir } from 'node:os'
+import { dirname, join, resolve } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { GRAMMARS, isLibrarySource, scanSource } from './lib/tmux-usage-scan.mjs'
+import { deriveUsage, verifyClaims } from './lib/tmux-usage-derive.mjs'
+import { libraryScopes, scopeProblems } from './lib/tmux-usage-scopes.mjs'
+
+const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
+const dataDir = join(root, 'site/src/data')
+const defaultUsageDir = join(dataDir, 'tmux-usage')
+const claimsPath = join(root, 'scripts/tmux-usage/claims.json')
+export const SCHEMA_VERSION = 1
+/** The commands whose usage is recorded; the rollout adds names here. */
+export const COMMANDS = ['list-panes']
+
+const args = process.argv.slice(2)
+const option = (name) => args[args.indexOf(name) + 1]
+const check = args.includes('--check')
+const regenerate = !check || args.includes('--source')
+const usageDir = args.includes('--data') ? resolve(option('--data')) : defaultUsageDir
+
+// The Swift grammar is a very large WASM module; V8's optimizing tier runs out of memory compiling it.
+if (regenerate && !process.execArgv.includes('--liftoff-only') && import.meta.url === `file://${process.argv[1]}`) {
+ const child = spawnSync(process.execPath, ['--liftoff-only', ...process.argv.slice(1)], { stdio: 'inherit' })
+ process.exit(child.status ?? 1)
+}
+
+const readJson = (path) => JSON.parse(readFileSync(path, 'utf8'))
+const expand = (path) => (path.startsWith('~/') ? join(homedir(), path.slice(2)) : path)
+const manualCommands = () => [...new Set(readJson(join(dataDir, 'tmux/versions.json')).versions.flatMap(({ version }) =>
+ readJson(join(dataDir, `tmux/${version}.json`)).commands.map((command) => command.name)))].sort()
+const commandsToRecord = !args.includes('--commands') ? COMMANDS
+ : option('--commands') === 'all' ? manualCommands() : option('--commands').split(',')
+
+function git(checkout, ...gitArgs) {
+ const result = spawnSync('git', ['-C', checkout, ...gitArgs], { maxBuffer: 1 << 30 })
+ if (result.status !== 0) throw new Error(`git ${gitArgs.join(' ')} in ${checkout}: ${result.stderr}`)
+ return result.stdout
+}
+
+/** Every file of the revision that is library source, keyed by path. */
+function librarySources(checkout, revision, grammar) {
+ const listing = git(checkout, 'ls-tree', '-r', revision).toString('utf8').split('\n').filter(Boolean)
+ .map((line) => { const [meta, path] = line.split('\t'); return { sha: meta.split(' ')[2], path } })
+ .filter((entry) => isLibrarySource(entry.path, grammar))
+ const blobs = spawnSync('git', ['-C', checkout, 'cat-file', '--batch'], { input: `${listing.map((entry) => entry.sha).join('\n')}\n`, maxBuffer: 1 << 30 }).stdout
+ const files = new Map()
+ let position = 0
+ for (const entry of listing) {
+ const newline = blobs.indexOf(10, position)
+ const size = Number(blobs.subarray(position, newline).toString().split(' ')[2])
+ files.set(entry.path, blobs.subarray(newline + 1, newline + 1 + size).toString('utf8'))
+ position = newline + 1 + size + 1
+ }
+ return files
+}
+
+/** The tmux commands and aliases a literal may spell, from every pinned manual. */
+function knownCommands() {
+ const names = new Set()
+ for (const version of readJson(join(dataDir, 'tmux/versions.json')).versions) {
+ for (const command of readJson(join(dataDir, `tmux/${version.version}.json`)).commands) {
+ names.add(command.name)
+ if (command.alias) names.add(command.alias)
+ }
+ }
+ return names
+}
+
+const sortKeys = (value) => Array.isArray(value) ? value.map(sortKeys)
+ : value && typeof value === 'object' ? Object.fromEntries(Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, item]) => [key, sortKeys(item)])) : value
+
+/** A consumer example declares symbols of its own that the library does not. */
+const EXAMPLES = /(?:^|\/)(?:examples?|tests?|benchmarks?|docs?)\//
+
+/** Callable public symbols, in the shape the derivation reads. */
+function publicSymbols(model) {
+ const byId = new Map(model.symbols.map((symbol) => [symbol.id, symbol]))
+ return model.symbols
+ .filter((symbol) => symbol.apiScope !== 'internal' && symbol.source?.file && !EXAMPLES.test(symbol.source.file)
+ && ['function', 'method', 'property', 'attribute'].includes(symbol.kind))
+ .map((symbol) => ({
+ id: symbol.publicId ?? symbol.id,
+ name: symbol.name,
+ qualified: symbol.qualifiedName,
+ parentName: symbol.parent ? byId.get(symbol.parent)?.name : undefined,
+ file: symbol.source.file,
+ line: symbol.source.line ?? 0,
+ overloaded: symbol.modifiers?.includes('overload'),
+ }))
+}
+
+export function portDocument(port, model, found, commands) {
+ const symbols = {}
+ for (const entry of found) {
+ ;(symbols[entry.symbol] ??= []).push({
+ command: entry.command, scope: entry.scope, evidence: entry.evidence,
+ ...(entry.reviewed ? { reviewed: true } : {}), ...(entry.via ? { via: entry.via } : {}),
+ })
+ }
+ for (const list of Object.values(symbols)) list.sort((a, b) => a.command.localeCompare(b.command) || String(a.scope).localeCompare(String(b.scope)))
+ return sortKeys({ schemaVersion: SCHEMA_VERSION, port, repo: model.repo, revision: model.revision, commands: [...commands].sort(), symbols })
+}
+
+async function derivePort({ port, model, commands, scopes, claims, checkout, known, report, sends }) {
+ const grammar = GRAMMARS[port]
+ const symbols = publicSymbols(model)
+ const functions = []
+ const types = []
+ const sources = grammar ? librarySources(checkout, model.revision, grammar) : new Map()
+ const wanted = new Set(commands)
+ for (const [path, text] of sources) {
+ const scanned = await scanSource({ grammar, text, commands: wanted, known })
+ for (const fn of scanned.functions) functions.push({ ...fn, file: path })
+ for (const type of scanned.types) types.push({ ...type, file: path })
+ }
+ const cache = new Map()
+ const readSource = (path) => {
+ if (sources.has(path)) return sources.get(path)
+ if (!cache.has(path)) {
+ const result = spawnSync('git', ['-C', checkout, 'show', `${model.revision}:${path}`], { maxBuffer: 1 << 28 })
+ cache.set(path, result.status === 0 ? result.stdout.toString('utf8') : undefined)
+ }
+ return cache.get(path)
+ }
+ const found = new Map()
+ const problems = []
+ for (const command of commands) {
+ const spec = scopes.commands[command] && { scopes: libraryScopes(scopes.commands[command]) }
+ const derived = deriveUsage({ command, spec, functions, symbols })
+ const reviewed = verifyClaims({
+ claims: claims.filter((claim) => claim.port === port && claim.command === command), spec, functions, types, symbols, readSource, sends,
+ })
+ problems.push(...reviewed.problems)
+ for (const entry of [...derived.entries, ...reviewed.entries]) {
+ const key = `${entry.symbol}\0${entry.command}\0${entry.scope}`
+ if (!found.has(key) || found.get(key).hops > entry.hops) found.set(key, entry)
+ }
+ for (const item of derived.unresolved) report.push(`${port} ${command}: ${item.file}:${item.line} in ${item.function}: ${item.reason}`)
+ }
+ return { found: [...found.values()], problems }
+}
+
+/** Ports that have a model, in the order the site lists them. */
+async function portsWithModels() {
+ const { PORTS } = await import(`file://${join(root, 'site/src/lib/ports.ts')}`)
+ return PORTS.filter((port) => existsSync(join(dataDir, `api/${port.slug}.json`)))
+}
+
+function checkoutFor(port) {
+ const override = process.env[`LIBTMUX_DOCS_CHECKOUT_${port.slug.toUpperCase()}`]
+ return expand(override || port.checkout)
+}
+
+/** What a committed file must satisfy without any checkout. */
+export function documentProblems(document, model, scopes, commands) {
+ const problems = []
+ if (document.schemaVersion !== SCHEMA_VERSION) problems.push(`schemaVersion ${document.schemaVersion}`)
+ if (document.revision !== model.revision) problems.push(`records ${document.revision}, but the API model is at ${model.revision}`)
+ if (JSON.stringify(document.commands) !== JSON.stringify([...commands].sort())) problems.push(`covers ${JSON.stringify(document.commands)}, expected ${JSON.stringify([...commands].sort())}`)
+ const ids = new Set(model.symbols.map((symbol) => symbol.publicId ?? symbol.id))
+ for (const [symbol, uses] of Object.entries(document.symbols)) {
+ if (!ids.has(symbol)) problems.push(`${symbol}: not a symbol of the API model`)
+ for (const use of uses) {
+ const scoped = scopes.commands[use.command]?.scopes
+ if (!commands.includes(use.command)) problems.push(`${symbol}: ${use.command} is not a recorded command`)
+ if (scoped ? !scoped.some((scope) => scope.id === use.scope) : use.scope !== null) problems.push(`${symbol}: ${use.scope} is not a scope of ${use.command}`)
+ if (!use.evidence?.length || use.evidence.some((item) => !/^[^:\s][^:]*:\d+$/.test(item))) problems.push(`${symbol}: evidence must be file:line`)
+ }
+ }
+ return problems
+}
+
+export async function main() {
+ const scopes = readJson(join(usageDir, 'scopes.json'))
+ const claims = existsSync(claimsPath) ? readJson(claimsPath).claims : []
+ const ports = await portsWithModels()
+ const report = []
+ const failures = []
+ const known = regenerate ? knownCommands() : new Set()
+ mkdirSync(usageDir, { recursive: true })
+
+ for (const command of commandsToRecord) {
+ if (!scopes.commands[command]) continue
+ const versions = readJson(join(dataDir, 'tmux/versions.json')).versions
+ const tmuxCheckout = process.env.LIBTMUX_DOCS_CHECKOUT_TMUX && expand(process.env.LIBTMUX_DOCS_CHECKOUT_TMUX)
+ for (const { version } of versions) {
+ const model = readJson(join(dataDir, `tmux/api/${version}.json`))
+ const read = tmuxCheckout && existsSync(tmuxCheckout)
+ ? (file) => spawnSync('git', ['-C', tmuxCheckout, 'show', `${model.revision}:${file}`], { maxBuffer: 1 << 26 }).stdout.toString('utf8') : undefined
+ for (const problem of scopeProblems(scopes.commands[command], model, command, read)) failures.push(`tmux ${version}: ${problem}`)
+ }
+ }
+
+ /** A wrapper's claim stands on its parent library's own result, so parents run first. */
+ const byPort = new Map()
+ const sends = (port, symbol, command, scope) => byPort.get(port)?.some((entry) => entry.symbol === symbol && entry.command === command && entry.scope === scope) ?? false
+ const ordered = [...ports].sort((a, b) => Number(Boolean(a.parentLibrary)) - Number(Boolean(b.parentLibrary)))
+ .sort((a, b) => Number(claims.some((claim) => claim.port === a.slug && claim.via)) - Number(claims.some((claim) => claim.port === b.slug && claim.via)))
+ let compared = 0
+ for (const port of ordered) {
+ const model = readJson(join(dataDir, `api/${port.slug}.json`))
+ const path = join(usageDir, `${port.slug}.json`)
+ if (check) {
+ if (!existsSync(path)) { failures.push(`${port.slug}: no ${path}`); continue }
+ const committed = readJson(path)
+ for (const problem of documentProblems(committed, model, scopes, commandsToRecord)) failures.push(`${port.slug}: ${problem}`)
+ if (!args.includes('--source')) continue
+ }
+ const checkout = checkoutFor(port)
+ if (!existsSync(join(checkout, '.git')) && !existsSync(join(checkout, 'HEAD'))) {
+ if (check) { console.log(`gen-tmux-usage: ${port.slug}: no checkout at ${checkout}; skipped regeneration`); continue }
+ throw new Error(`${port.slug}: no checkout at ${checkout}; set LIBTMUX_DOCS_CHECKOUT_${port.slug.toUpperCase()}`)
+ }
+ const { found, problems } = await derivePort({ port: port.slug, model, commands: commandsToRecord, scopes, claims, checkout, known, report, sends })
+ byPort.set(port.slug, found)
+ failures.push(...problems)
+ const document = portDocument(port.slug, model, found, commandsToRecord)
+ const text = `${JSON.stringify(document, null, 2)}\n`
+ if (check) {
+ if (text !== readFileSync(path, 'utf8')) failures.push(`${port.slug}: stale; run node scripts/gen-tmux-usage.mjs`)
+ compared++
+ } else {
+ writeFileSync(path, text)
+ console.log(`gen-tmux-usage: ${port.slug}: ${Object.keys(document.symbols).length} symbols at ${model.revision.slice(0, 8)}`)
+ }
+ }
+ if (args.includes('--report')) console.log(report.join('\n'))
+ if (failures.length) {
+ console.error(failures.map((failure) => `gen-tmux-usage: ${failure}`).join('\n'))
+ process.exitCode = 1
+ return
+ }
+ if (check) console.log(`gen-tmux-usage: ${ports.length} ports fresh${compared ? ` (${compared} regenerated and compared)` : ' (shape and revisions only; pass --source to regenerate)'}`)
+}
+
+if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) await main()
diff --git a/scripts/gen-tmux-usage.negative.mjs b/scripts/gen-tmux-usage.negative.mjs
new file mode 100644
index 000000000..890c4fa43
--- /dev/null
+++ b/scripts/gen-tmux-usage.negative.mjs
@@ -0,0 +1,85 @@
+#!/usr/bin/env node
+/*
+ * Proof that `gen-tmux-usage.mjs --check` fails on usage data that no longer
+ * fits the API models.
+ *
+ * The control is the committed data, because a check that always failed would
+ * satisfy every other case. Each case is a different way to be stale: a
+ * revision that moved on, a symbol the model dropped, a scope the command does
+ * not have, evidence that is not a line, and a port whose file went missing.
+ */
+import { cpSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { dirname, join } from 'node:path'
+import { execFileSync } from 'node:child_process'
+import { fileURLToPath } from 'node:url'
+
+const here = dirname(fileURLToPath(import.meta.url))
+const script = join(here, 'gen-tmux-usage.mjs')
+const committed = join(here, '..', 'site/src/data/tmux-usage')
+
+function run(dir) {
+ try {
+ return { code: 0, out: execFileSync('node', [script, '--check', '--data', dir], { encoding: 'utf8', stdio: 'pipe' }) }
+ } catch (error) {
+ return { code: error.status, out: `${error.stdout ?? ''}${error.stderr ?? ''}` }
+ }
+}
+
+const dirs = []
+function fixture() {
+ const dir = mkdtempSync(join(tmpdir(), 'gen-tmux-usage-'))
+ cpSync(committed, dir, { recursive: true })
+ dirs.push(dir)
+ return dir
+}
+
+function edit(dir, port, change) {
+ const file = join(dir, `${port}.json`)
+ const document = JSON.parse(readFileSync(file, 'utf8'))
+ change(document)
+ writeFileSync(file, `${JSON.stringify(document, null, 2)}\n`)
+}
+
+let failures = 0
+const check = (name, ok, detail) => {
+ if (ok) console.log(`ok ${name}`)
+ else { console.error(`FAIL ${name} - ${detail}`); failures += 1 }
+}
+const first = (document) => Object.entries(document.symbols)[0]
+
+const control = run(fixture())
+check('the committed data passes', control.code === 0, control.out)
+
+const moved = fixture()
+edit(moved, 'py', (document) => { document.revision = '0'.repeat(40) })
+const movedRun = run(moved)
+check('a revision that moved on fails', movedRun.code !== 0 && /py: records 0{40}/.test(movedRun.out), movedRun.out)
+
+const dropped = fixture()
+edit(dropped, 'go', (document) => { document.symbols['tmux.Server.NoSuchMethod'] = first(document)[1] })
+const droppedRun = run(dropped)
+check('a symbol the model lacks fails', droppedRun.code !== 0 && /go: tmux.Server.NoSuchMethod: not a symbol of the API model/.test(droppedRun.out), droppedRun.out)
+
+const scoped = fixture()
+edit(scoped, 'csharp', (document) => { first(document)[1][0].scope = 'pane' })
+const scopedRun = run(scoped)
+check('a scope the command lacks fails', scopedRun.code !== 0 && /pane is not a scope of list-panes/.test(scopedRun.out), scopedRun.out)
+
+const evidence = fixture()
+edit(evidence, 'swift', (document) => { first(document)[1][0].evidence = ['Sources/LibTmux/Server.swift'] })
+const evidenceRun = run(evidence)
+check('evidence that is not a line fails', evidenceRun.code !== 0 && /swift: .*evidence must be file:line/.test(evidenceRun.out), evidenceRun.out)
+
+const missing = fixture()
+rmSync(join(missing, 'rs.json'))
+const missingRun = run(missing)
+check('a port without a file fails', missingRun.code !== 0 && /rs: no /.test(missingRun.out), missingRun.out)
+
+const unrecorded = fixture()
+edit(unrecorded, 'ruby', (document) => { first(document)[1][0].command = 'kill-pane' })
+const unrecordedRun = run(unrecorded)
+check('a command the file does not cover fails', unrecordedRun.code !== 0 && /kill-pane is not a recorded command/.test(unrecordedRun.out), unrecordedRun.out)
+
+for (const dir of dirs) rmSync(dir, { recursive: true, force: true })
+if (failures) process.exit(1)
diff --git a/scripts/lib/tmux-usage-derive.mjs b/scripts/lib/tmux-usage-derive.mjs
new file mode 100644
index 000000000..f5ffb78d6
--- /dev/null
+++ b/scripts/lib/tmux-usage-derive.mjs
@@ -0,0 +1,208 @@
+/**
+ * Decide which public symbols send a tmux command, and at which scope.
+ *
+ * A symbol sends a command when a send site sits in its own body or in a
+ * private helper it calls. The walk goes up the callers of a helper and stops
+ * at the first public symbol on each path, so a method that only reads what
+ * another public method captured is not credited with the capture.
+ */
+
+/** Calls between a send site and the public symbol that wraps it. */
+export const MAX_HOPS = 1
+
+/**
+ * A helper that this many public symbols call is infrastructure, such as a
+ * refresh after every mutation, and crediting each caller would list methods
+ * whose purpose is another command.
+ */
+export const MAX_SHARED_BY = 4
+
+/** The scope a site's flags select, `null` for a command without scopes, `unknown` when no flag settles it. */
+export function classify(spec, flags) {
+ if (!spec?.scopes) return null
+ for (const scope of spec.scopes) if ([...scope.flags].every((flag) => flags.includes(flag))) return scope.id
+ return 'unknown'
+}
+
+/** `panes(where:)`, `Server.panes` and `Server#list_panes` all name their last identifier. */
+export function bareName(name) {
+ return name.replace(/\(.*$/s, '').split(/[.:#\\]+/).filter(Boolean).at(-1) ?? name
+}
+
+/**
+ * @typedef {import('./tmux-usage-scan.mjs').ScannedFunction & { file: string }} LocatedFunction
+ * @typedef {{ id: string, name: string, qualified?: string, parentName?: string, file: string, line: number, overloaded?: boolean }} UsageSymbol
+ * @typedef {{ symbol: string, command: string, scope: string | null, evidence: string[], hops: number }} UsageEntry
+ * @typedef {{ file: string, line: number, function: string, reason: string }} Unresolved
+ */
+
+/**
+ * The functions that are each public symbol's own definition, overloads included.
+ * @param {LocatedFunction[]} functions
+ * @param {UsageSymbol[]} symbols
+ * @returns {Map}
+ */
+export function definitionsOf(functions, symbols) {
+ const byFile = Map.groupBy(functions, (fn) => fn.file)
+ const byName = Map.groupBy(functions, (fn) => fn.name)
+ const definitions = new Map()
+ for (const symbol of symbols) {
+ const name = bareName(symbol.name)
+ const inFile = (byFile.get(symbol.file) ?? []).filter((fn) => fn.name === name)
+ let hits = inFile.filter((fn) => symbol.line >= fn.start && symbol.line <= fn.nameLine)
+ if (!hits.length) hits = inFile.filter((fn) => symbol.line >= fn.start && symbol.line <= fn.end)
+ if (hits.length && symbol.overloaded) hits = inFile.filter((fn) => hits.some((hit) => hit.owner === fn.owner))
+ const owner = symbol.parentName && bareName(symbol.parentName)
+ // A type annotation can sit apart from the function it describes, in the same file.
+ if (!hits.length && owner) hits = inFile.filter((fn) => fn.owner === owner)
+ // A declaration in a header is defined in another file under the same type name.
+ if (!hits.length && owner && !inFile.length) {
+ hits = (byName.get(name) ?? []).filter((fn) => fn.owner === owner
+ && (fn.namespace === undefined || symbol.qualified === undefined || symbol.qualified === `${fn.namespace}::${owner}::${name}`))
+ }
+ for (const fn of hits) definitions.set(fn, [...(definitions.get(fn) ?? []), symbol])
+ }
+ // Several declarations can share one definition's name; the header named like the source file owns it.
+ const stem = (path) => path.replace(/^.*\//, '').replace(/\.[^.]+$/, '')
+ for (const [fn, owned] of definitions) {
+ const matching = owned.filter((symbol) => symbol.file !== fn.file && stem(symbol.file) === stem(fn.file))
+ if (owned.length > 1 && matching.length) definitions.set(fn, owned.filter((symbol) => symbol.file === fn.file || matching.includes(symbol)))
+ }
+ return definitions
+}
+
+/**
+ * @param {{ command: string, spec?: { scopes?: { id: string, flags: string }[] }, functions: LocatedFunction[], symbols: UsageSymbol[] }} input
+ * @returns {{ entries: UsageEntry[], unresolved: Unresolved[] }}
+ */
+export function deriveUsage({ command, spec, functions, symbols }) {
+ const byName = Map.groupBy(functions, (fn) => fn.name)
+ const definitions = definitionsOf(functions, symbols)
+
+ const callersOf = (fn) => {
+ const callers = (functions.filter((other) => other !== fn && other.calls.has(fn.name)))
+ const sameFile = callers.filter((other) => other.file === fn.file)
+ if (sameFile.length) return sameFile
+ return (byName.get(fn.name) ?? []).length === 1 ? callers : []
+ }
+
+ /** Public symbols reached from `fn`, each with the call sites walked to reach it. */
+ const reach = (fn, trail, depth) => {
+ const own = definitions.get(fn)
+ if (own) return own.map((symbol) => ({ symbol, trail }))
+ if (depth >= MAX_HOPS) return []
+ return callersOf(fn).flatMap((caller) => reach(caller, [...trail, `${caller.file}:${caller.calls.get(fn.name)}`], depth + 1))
+ }
+
+ const entries = new Map()
+ const unresolved = []
+ for (const fn of functions) {
+ const sites = fn.sites.filter((site) => site.command === command)
+ if (!sites.length) continue
+ const scoped = sites.map((site) => ({ site, scope: classify(spec, site.flags) }))
+ for (const { site, scope } of scoped) {
+ if (scope === 'unknown') {
+ unresolved.push({ file: fn.file, line: site.line, function: fn.name, reason: 'no scope flag beside the command' })
+ }
+ }
+ const known = scoped.filter(({ scope }) => scope !== 'unknown')
+ const isPublic = definitions.has(fn)
+ // A helper that lists at several scopes cannot say which one its caller wants.
+ const ambiguous = !isPublic && new Set(known.map(({ scope }) => scope)).size > 1
+ if (ambiguous) {
+ unresolved.push({ file: fn.file, line: known[0].site.line, function: fn.name, reason: 'a shared helper lists at several scopes' })
+ continue
+ }
+ for (const { site, scope } of known) {
+ const reached = reach(fn, [], 0)
+ if (!reached.length) {
+ unresolved.push({ file: fn.file, line: site.line, function: fn.name, reason: 'no public symbol reaches it' })
+ continue
+ }
+ if (!isPublic && new Set(reached.map(({ symbol }) => symbol.id)).size > MAX_SHARED_BY) {
+ unresolved.push({ file: fn.file, line: site.line, function: fn.name, reason: `a helper shared by ${new Set(reached.map(({ symbol }) => symbol.id)).size} public symbols` })
+ continue
+ }
+ for (const { symbol, trail } of reached) {
+ const key = `${symbol.id}\0${scope}`
+ const entry = { symbol: symbol.id, command, scope, evidence: [`${fn.file}:${site.line}`, ...trail.toReversed()], hops: trail.length }
+ if (!entries.has(key) || entries.get(key).hops > entry.hops) entries.set(key, entry)
+ }
+ }
+ }
+ return {
+ entries: [...entries.values()].sort((a, b) => a.symbol.localeCompare(b.symbol) || String(a.scope).localeCompare(String(b.scope))),
+ unresolved,
+ }
+}
+
+/**
+ * Reviewed claims for the sends a scan cannot see: a command named by a
+ * template, a scope carried by a typed argument, or a call into a snapshot.
+ * Each claim cites the lines that make it true, and the line text must still
+ * say so at the pinned revision.
+ *
+ * A wrapper's claim can name the library symbol it calls, `via`, and then
+ * stands only while that symbol sends the command at the same scope.
+ *
+ * @typedef {{ at: string, has?: string[], in?: string }} Evidence
+ * @typedef {{ port: string, symbol: string, command: string, scope: string | null, evidence: Evidence[], via?: { port: string, symbol: string } }} Claim
+ * @param {{
+ * claims: Claim[],
+ * spec?: { scopes?: { id: string }[] },
+ * functions: LocatedFunction[],
+ * types: { file: string, name?: string, start: number, end: number }[],
+ * symbols: UsageSymbol[],
+ * readSource: (path: string) => string | undefined,
+ * sends?: (port: string, symbol: string, command: string, scope: string | null) => boolean,
+ * }} input
+ * @returns {{ entries: UsageEntry[], problems: string[] }}
+ */
+export function verifyClaims({ claims, spec, functions, types, symbols, readSource, sends = () => false }) {
+ const definitions = definitionsOf(functions, symbols)
+ const bySymbol = new Map(symbols.map((symbol) => [symbol.id, symbol]))
+ const entries = []
+ const problems = []
+ for (const claim of claims) {
+ const label = `${claim.port}: ${claim.symbol} ${claim.command} ${claim.scope}`
+ const fail = (message) => problems.push(`${label}: ${message}`)
+ const symbol = bySymbol.get(claim.symbol)
+ if (!symbol) { fail('no such public symbol in the API model'); continue }
+ if (spec?.scopes ? !spec.scopes.some((scope) => scope.id === claim.scope) : claim.scope !== null) {
+ fail('not a scope of this command')
+ continue
+ }
+ if (!claim.evidence?.length) { fail('cites no evidence'); continue }
+ let anchored = false
+ let broken = false
+ for (const item of claim.evidence) {
+ const [file, line] = [item.at.slice(0, item.at.lastIndexOf(':')), Number(item.at.slice(item.at.lastIndexOf(':') + 1))]
+ const text = readSource(file)
+ const sourceLine = text?.split('\n')[line - 1]
+ if (sourceLine === undefined) { fail(`${item.at} is not a line of the pinned source`); broken = true; continue }
+ for (const needle of item.has ?? []) {
+ if (!sourceLine.includes(needle)) { fail(`${item.at} does not contain ${JSON.stringify(needle)}`); broken = true }
+ }
+ if (item.in !== undefined) {
+ if (item.in !== claim.symbol) { fail(`${item.at} anchors to ${item.in}, not the claimed symbol`); broken = true; continue }
+ const inside = [...definitions].some(([fn, owned]) => owned.includes(symbol) && fn.file === file && line >= fn.start && line <= fn.end)
+ || (![...definitions.values()].some((owned) => owned.includes(symbol))
+ && types.some((type) => type.file === file && symbol.file === file && symbol.line >= type.start && symbol.line <= type.end && line >= type.start && line <= type.end))
+ if (inside) anchored = true
+ else { fail(`${item.at} is outside the body of ${claim.symbol}`); broken = true }
+ }
+ }
+ if (!broken && !anchored) { fail('no evidence line is anchored in the symbol with "in"'); broken = true }
+ if (!broken && claim.via && !sends(claim.via.port, claim.via.symbol, claim.command, claim.scope)) {
+ fail(`${claim.via.port} ${claim.via.symbol} does not send ${claim.command} at that scope`)
+ broken = true
+ }
+ if (!broken) {
+ entries.push({
+ symbol: claim.symbol, command: claim.command, scope: claim.scope, evidence: claim.evidence.map((item) => item.at),
+ hops: claim.evidence.length - 1, reviewed: true, ...(claim.via ? { via: claim.via } : {}),
+ })
+ }
+ }
+ return { entries, problems }
+}
diff --git a/scripts/lib/tmux-usage-scan.mjs b/scripts/lib/tmux-usage-scan.mjs
new file mode 100644
index 000000000..075515e0b
--- /dev/null
+++ b/scripts/lib/tmux-usage-scan.mjs
@@ -0,0 +1,358 @@
+/**
+ * Find where a library's source sends a tmux command.
+ *
+ * A send site is a string literal that spells a command name, in code rather
+ * than in a comment or a docstring. The scan attributes each site to the
+ * innermost named function around it and keeps the flag literals that travel
+ * with the command, because the flags choose the scope tmux lists.
+ */
+import { parserFor } from '../../packages/api-model/src/parser.ts'
+
+/** Port to the tree-sitter grammar that reads its source. PowerShell cmdlets are C#. */
+export const GRAMMARS = {
+ py: 'python', ts: 'typescript', rs: 'rust', go: 'go', java: 'java', kotlin: 'kotlin', scala: 'scala',
+ csharp: 'csharp', powershell: 'csharp', cxx: 'cpp', swift: 'swift', ruby: 'ruby', lua: 'lua', julia: 'julia',
+}
+
+/** Source extensions per grammar, minus declaration-only files. */
+export const EXTENSIONS = {
+ python: /\.py$/, typescript: /(? EXTENSIONS[grammar].test(path) && !NOT_LIBRARY.test(path)
+
+const FUNCTIONS = {
+ python: ['function_definition'],
+ typescript: ['method_definition', 'function_declaration', 'generator_function_declaration', 'function_expression', 'arrow_function'],
+ rust: ['function_item'],
+ go: ['function_declaration', 'method_declaration'],
+ java: ['method_declaration', 'constructor_declaration'],
+ kotlin: ['function_declaration', 'property_declaration', 'secondary_constructor'],
+ scala: ['function_definition', 'function_declaration', 'val_definition', 'var_definition'],
+ csharp: ['method_declaration', 'constructor_declaration', 'local_function_statement', 'property_declaration', 'accessor_declaration', 'indexer_declaration', 'operator_declaration'],
+ cpp: ['function_definition'],
+ swift: ['function_declaration', 'init_declaration', 'property_declaration', 'subscript_declaration'],
+ ruby: ['method', 'singleton_method'],
+ lua: ['function_definition_statement', 'local_function_definition_statement'],
+}
+
+/** Declarations that own functions, named so a method can be told from a same-named one elsewhere. */
+const OWNERS = {
+ python: ['class_definition'],
+ typescript: ['class_declaration', 'abstract_class_declaration', 'interface_declaration', 'class'],
+ rust: ['impl_item', 'trait_item'],
+ go: [],
+ java: ['class_declaration', 'interface_declaration', 'enum_declaration', 'record_declaration'],
+ kotlin: ['class_declaration', 'object_declaration'],
+ scala: ['class_definition', 'object_definition', 'trait_definition'],
+ csharp: ['class_declaration', 'struct_declaration', 'interface_declaration', 'record_declaration', 'record_struct_declaration'],
+ cpp: ['class_specifier', 'struct_specifier', 'namespace_definition'],
+ swift: ['class_declaration', 'protocol_declaration'],
+ ruby: ['class', 'module'],
+ lua: [],
+}
+
+const STRINGS = {
+ python: ['string'], typescript: ['string', 'template_string'], rust: ['string_literal', 'raw_string_literal'],
+ go: ['interpreted_string_literal', 'raw_string_literal'], java: ['string_literal'], kotlin: ['string_literal'],
+ scala: ['string'], csharp: ['string_literal', 'verbatim_string_literal', 'raw_string_literal'], cpp: ['string_literal', 'raw_string_literal'],
+ swift: ['line_string_literal', 'multi_line_string_literal', 'raw_string_literal'], ruby: ['string'], lua: ['string'],
+}
+
+const CALLS = {
+ python: ['call'], typescript: ['call_expression'], rust: ['call_expression', 'macro_invocation'], go: ['call_expression'],
+ java: ['method_invocation', 'object_creation_expression'], kotlin: ['call_expression'], scala: ['call_expression'],
+ csharp: ['invocation_expression', 'object_creation_expression'], cpp: ['call_expression'], swift: ['call_expression'],
+ ruby: ['call'], lua: ['call'],
+}
+
+/**
+ * Nodes between a command literal and the statement that holds it. Climbing
+ * through them reaches the whole argument list, array, tuple or table the
+ * flags travel in, and stops at the statement.
+ */
+const WRAPPERS = new Set([
+ 'argument_list', 'arguments', 'argument', 'value_arguments', 'value_argument', 'call_suffix', 'keyword_argument',
+ 'array', 'list', 'tuple', 'initializer_list', 'collection_expression', 'array_literal', 'array_creation_expression',
+ 'implicit_array_creation_expression', 'tuple_expression', 'bracketed_argument_list', 'element_binding_expression',
+ 'object', 'pair', 'literal_value', 'literal_element', 'keyed_element', 'composite_literal', 'table', 'table_constructor',
+ 'field', 'field_list', 'expression_list', 'parenthesized_expression', 'array_initializer', 'object_creation_expression',
+ 'implicit_object_creation_expression', 'initializer_expression', 'new_expression', 'collection_literal', 'dictionary_literal',
+ 'element_access_expression', 'subscript_expression', 'type_arguments', 'as_expression', 'satisfies_expression',
+ 'method_invocation', 'invocation_expression', 'call_expression', 'call', 'macro_invocation', 'token_tree',
+ 'reference_expression', 'borrow_expression', 'unary_expression', 'prefix_expression', 'generic_function', 'field_expression',
+ 'member_access_expression', 'navigation_expression', 'navigation_suffix', 'selector_expression', 'member_expression',
+ 'attribute', 'binary_expression', 'string_concatenation', 'interpolated_string_expression',
+])
+
+/** A node that starts a new function-like scope; strings inside it do not describe the call around it. */
+const isScope = (grammar, node) => FUNCTIONS[grammar].includes(node.type) || /lambda|closure|function_expression|arrow_function|func_literal|anonymous_function|block$/.test(node.type)
+
+/**
+ * A branch compiled only for Windows runs against psmux, not tmux. The C++
+ * port keeps the two behind `_WIN32`, and the tmux path is the other branch.
+ */
+function onWindowsOnlyPath(node) {
+ for (let child = node, cursor = node.parent; cursor; child = cursor, cursor = cursor.parent) {
+ if (cursor.type !== 'preproc_if' && cursor.type !== 'preproc_ifdef') continue
+ const condition = cursor.childForFieldName('condition')?.text ?? cursor.childForFieldName('name')?.text ?? ''
+ if (!/_WIN32/.test(condition)) continue
+ const alternative = cursor.childForFieldName('alternative')
+ const inAlternative = alternative && child.id === alternative.id
+ const windowsFirst = !/!\s*defined|ifndef/.test(`${cursor.type === 'preproc_ifdef' ? cursor.text.slice(0, 8) : ''}${condition}`)
+ if (windowsFirst !== Boolean(inAlternative)) return true
+ }
+ return false
+}
+
+const QUOTE = /^[A-Za-z@$#]*("""|'''|"|'|`|\[=*\[)([\s\S]*?)(?:"""|'''|"|'|`|\]=*\])$/
+
+/** The text between a string literal's quotes, or nothing when the node is not quoted text. */
+export function stringValue(node) {
+ return QUOTE.exec(node.text)?.[2]
+}
+
+const FLAG = /^-[A-Za-z]+$/
+
+/** Letters of every flag a string spells: `-a`, `-st`, or the flags inside `list-panes -a -F x`. */
+function flagsIn(value) {
+ const letters = new Set()
+ for (const token of value.split(/\s+/)) if (FLAG.test(token)) for (const letter of token.slice(1)) letters.add(letter)
+ return letters
+}
+
+function lastIdentifier(text) {
+ const match = /([A-Za-z_][\w-]*)\s*(?:<[^()]*>)?\s*[!?]?$/.exec(text.replace(/\([\s\S]*$/, ''))
+ return match?.[1]
+}
+
+/** Names the node declares, with the owner chain that qualifies it. */
+function declaredName(grammar, node) {
+ const field = node.childForFieldName('name')
+ if (field && grammar === 'lua') {
+ const parts = field.text.split(/[.:]/)
+ return { name: parts.at(-1), owner: parts.length > 1 ? parts.at(-2) : undefined }
+ }
+ if (field) return { name: lastIdentifier(field.text) ?? field.text }
+ const named = (type) => node.namedChildren.find((child) => child.type === type)
+ if (grammar === 'cpp') {
+ let declarator = node.childForFieldName('declarator')
+ while (declarator && declarator.type !== 'qualified_identifier' && declarator.type !== 'identifier' && declarator.type !== 'field_identifier') {
+ declarator = declarator.childForFieldName('declarator') ?? declarator.namedChildren[0]
+ }
+ if (!declarator) return undefined
+ const parts = declarator.text.split('::')
+ return { name: parts.at(-1), owner: parts.at(-2), scope: parts.slice(0, -2) }
+ }
+ if (grammar === 'kotlin' || grammar === 'swift') {
+ const direct = named('simple_identifier')
+ if (direct) return { name: direct.text }
+ const pattern = named('variable_declaration') ?? named('pattern')
+ const inner = pattern?.namedChildren.find((child) => child.type === 'simple_identifier')
+ return inner ? { name: inner.text } : undefined
+ }
+ if (grammar === 'scala') {
+ const direct = named('identifier')
+ if (direct) return { name: direct.text }
+ const pattern = node.childForFieldName('pattern')
+ return pattern ? { name: pattern.text } : undefined
+ }
+ if (grammar === 'lua') {
+ const path = named('variable') ?? named('identifier')
+ if (!path) return undefined
+ const parts = path.text.split(/[.:]/)
+ return { name: parts.at(-1), owner: parts.length > 1 ? parts.at(-2) : undefined }
+ }
+ if (grammar === 'go') return undefined
+ if (grammar === 'typescript' && node.type === 'arrow_function') {
+ const holder = node.parent
+ const label = holder?.childForFieldName('name')
+ return label ? { name: label.text } : undefined
+ }
+ return undefined
+}
+
+/** What a call invokes: the last identifier of its callee, which is all a one-hop follow needs. */
+function calleeOf(grammar, node) {
+ if (node.type === 'object_creation_expression') return node.childForFieldName('type')?.text
+ const callee = node.childForFieldName('function') ?? node.childForFieldName('name') ?? node.childForFieldName('method')
+ ?? node.namedChildren[0]
+ if (!callee) return undefined
+ if (grammar === 'java' && node.type === 'method_invocation') return node.childForFieldName('name')?.text
+ if (grammar === 'ruby') return node.childForFieldName('method')?.text
+ return lastIdentifier(callee.text)
+}
+
+const ownerName = (grammar, node) => {
+ if (grammar === 'rust' && node.type === 'impl_item') return lastIdentifier(node.childForFieldName('type')?.text ?? '')
+ const name = node.childForFieldName('name') ?? node.namedChildren.find((child) => /identifier/.test(child.type))
+ return name ? lastIdentifier(name.text) : undefined
+}
+
+const row = (node) => node.startPosition.row + 1
+
+/**
+ * Julia has no grammar here, so a function is found by its text: a `function`
+ * line, and the `end` that closes it at the same indentation. A docstring
+ * directly above belongs to it. Sends in Julia are reviewed claims, so only
+ * the extents are needed.
+ */
+function scanJulia(text) {
+ const lines = text.split('\n')
+ const functions = []
+ for (let index = 0; index < lines.length; index++) {
+ const match = /^(\s*)function\s+(?:[A-Za-z_]\w*\.)*([A-Za-z_][\w!]*)\s*(?:\{[^}]*\})?\s*\(/.exec(lines[index])
+ if (!match) continue
+ const closer = new RegExp(`^${match[1]}end\\b`)
+ let end = index
+ for (let next = index + 1; next < lines.length; next++) if (closer.test(lines[next])) { end = next; break }
+ let start = index
+ if (lines[index - 1]?.trim() === '"""') {
+ let opener = index - 2
+ while (opener >= 0 && lines[opener].trim() !== '"""') opener--
+ if (opener >= 0) start = opener
+ }
+ functions.push({ name: match[2], start: start + 1, nameLine: index + 1, end: end + 1, kind: 'function', sites: [], calls: new Map() })
+ }
+ return { functions, types: [], orphans: [] }
+}
+
+/** A default value or type literal in a signature is not a call. */
+const PARAMETERS = /^(?:parameters?|formal_parameters?|parameter_list|function_value_parameters|class_parameters?|default_parameter|typed_default_parameter|optional_parameter|required_parameter|type_annotation|type_alias_declaration|type_arguments|type)$/
+function inSignature(node) {
+ for (let cursor = node.parent; cursor; cursor = cursor.parent) {
+ if (PARAMETERS.test(cursor.type)) return true
+ if (/(?:^|_)(?:block|body|statement_block|compound_statement|declaration_list)$/.test(cursor.type)) return false
+ }
+ return false
+}
+
+/**
+ * Every named function of a file with the command sites and calls inside it.
+ *
+ * @param {{ grammar: string, text: string, commands: ReadonlySet, known: ReadonlySet }} input
+ * `commands` are the names to find; `known` are all tmux command names, so
+ * a list that holds a different command is not read as this command's flags.
+ * @returns {Promise<{ functions: ScannedFunction[], types: { name?: string, start: number, end: number }[], orphans: Site[] }>}
+ * `types` are the declarations that own functions, so a claim can anchor to
+ * a class; `orphans` are the sites outside any named function.
+ */
+export async function scanSource({ grammar, text, commands, known }) {
+ if (grammar === 'julia') return scanJulia(text)
+ const parser = await parserFor(grammar)
+ // The Swift grammar predates typed throws; blanking the type keeps every line and column.
+ const tree = parser.parse(grammar === 'swift' ? text.replace(/\bthrows[ \t]*\([ \t]*[\w.]+[ \t]*\)/g, (match) => 'throws'.padEnd(match.length)) : text)
+ const functions = []
+ const types = []
+ const orphans = []
+ const stack = []
+ const owners = []
+ const namespaces = []
+ const FN = new Set(FUNCTIONS[grammar])
+ const OWN = new Set(OWNERS[grammar])
+ const STR = new Set(STRINGS[grammar])
+ const CALL = new Set(CALLS[grammar])
+ const isCommandLiteral = (node) => {
+ if (!STR.has(node.type) || node.parent?.type === 'expression_statement') return undefined
+ const value = stringValue(node)
+ if (value === undefined) return undefined
+ // A whole command line starts with the name and goes on with flags; a sentence that starts with one is an error message.
+ const [head, next] = value.split(/\s+/)
+ return known.has(head) && (next === undefined || next.startsWith('-')) ? { command: head, value } : undefined
+ }
+
+ /** The widest enclosing group that holds no other command, and the flags written inside it. */
+ const flagsAround = (literal, command) => {
+ let unit = literal
+ for (let cursor = literal.parent; cursor && WRAPPERS.has(cursor.type); cursor = cursor.parent) {
+ const others = cursor.descendantsOfType(STRINGS[grammar]).some((other) => {
+ const found = isCommandLiteral(other)
+ return found && found.command !== command
+ })
+ if (others) break
+ unit = cursor
+ }
+ const flags = new Set()
+ const visit = (node) => {
+ if (STR.has(node.type)) {
+ const value = stringValue(node)
+ if (value !== undefined) for (const letter of flagsIn(value)) flags.add(letter)
+ return
+ }
+ for (const child of node.namedChildren) if (node === unit || !isScope(grammar, child)) visit(child)
+ }
+ visit(unit)
+ return { flags, unit }
+ }
+
+ const walk = (node) => {
+ let pushed = false
+ let owned = false
+ let namespaced = false
+ if (OWN.has(node.type)) {
+ const name = ownerName(grammar, node)
+ if (node.type === 'namespace_definition') {
+ namespaces.push(name)
+ namespaced = true
+ } else {
+ owners.push(name)
+ owned = true
+ types.push({ name, start: row(node), end: node.endPosition.row + 1 })
+ }
+ }
+ if (grammar === 'go' && node.type === 'method_declaration') {
+ const receiver = node.childForFieldName('receiver')?.text
+ const name = node.childForFieldName('name')?.text
+ const type = receiver && /([A-Za-z_]\w*)\s*\)?$/.exec(receiver.replace(/\[.*\]/, ''))?.[1]
+ if (name) { pushFunction(name, type); pushed = true }
+ } else if (grammar === 'go' && node.type === 'function_declaration') {
+ pushFunction(node.childForFieldName('name').text, undefined)
+ pushed = true
+ } else if (FN.has(node.type)) {
+ const declared = declaredName(grammar, node)
+ if (declared?.name) { pushFunction(declared.name, declared.owner, declared.scope); pushed = true }
+ }
+
+ function pushFunction(name, owner, scope = []) {
+ const wrapper = node.parent && ['decorated_definition', 'export_statement'].includes(node.parent.type) ? node.parent : node
+ const fn = {
+ name, owner: owner ?? owners.filter(Boolean).at(-1), start: row(wrapper), nameLine: row(node.childForFieldName('name') ?? node),
+ end: node.endPosition.row + 1, kind: node.type, sites: [], calls: new Map(),
+ // A namespace opened by a macro is invisible here, so an empty chain is unknown, not global.
+ ...([...namespaces.filter(Boolean), ...scope].length ? { namespace: [...namespaces.filter(Boolean), ...scope].join('::') } : {}),
+ }
+ functions.push(fn)
+ stack.push(fn)
+ }
+
+ const literal = commands.size && isCommandLiteral(node)
+ if (literal && commands.has(literal.command) && !inSignature(node) && !onWindowsOnlyPath(node)) {
+ const { flags } = flagsAround(node, literal.command)
+ const site = { command: literal.command, line: row(node), flags: [...flags].sort().join('') }
+ ;(stack.at(-1)?.sites ?? orphans).push(site)
+ }
+ if (CALL.has(node.type) && stack.length) {
+ const callee = calleeOf(grammar, node)
+ if (callee && !stack.at(-1).calls.has(callee)) stack.at(-1).calls.set(callee, row(node))
+ }
+ for (const child of node.namedChildren) walk(child)
+ if (pushed) stack.pop()
+ if (owned) owners.pop()
+ if (namespaced) namespaces.pop()
+ }
+ walk(tree.rootNode)
+ tree.delete()
+ return { functions, types, orphans }
+}
+
+/**
+ * @typedef {{ name: string, owner?: string, start: number, nameLine: number, end: number, kind: string, sites: Site[], calls: Map, namespace?: string }} ScannedFunction
+ * @typedef {{ command: string, line: number, flags: string }} Site
+ */
diff --git a/scripts/lib/tmux-usage-scopes.mjs b/scripts/lib/tmux-usage-scopes.mjs
new file mode 100644
index 000000000..ea6fa4908
--- /dev/null
+++ b/scripts/lib/tmux-usage-scopes.mjs
@@ -0,0 +1,55 @@
+/**
+ * The scopes tmux gives one command, read from its C dispatch.
+ *
+ * `list-panes` lists the server with `-a`, a session with `-s`, and otherwise
+ * the target window. Each scope has a C function, so a libtmux method that
+ * sends the command at a scope can be linked to that function and back.
+ */
+
+/** The flags a library call must spell to count as a scope: the C flag, or the target flag of the default scope. */
+export function libraryScopes(entry) {
+ return entry.scopes.map((scope) => ({ id: scope.id, flags: scope.flag || scope.target || '' }))
+}
+
+/**
+ * The flag that guards the call on `line` (1-based) of a tmux source file:
+ * `a` for `if (args_has(args, 'a'))`, an empty string for a bare `else`.
+ * Anything else is not a dispatch this table can describe.
+ */
+export function guardFlag(source, line) {
+ const lines = source.split('\n')
+ for (let index = line - 2; index >= Math.max(0, line - 3); index--) {
+ const text = lines[index]
+ if (/^\s*$/.test(text)) continue
+ const flag = /args_has\(\s*args\s*,\s*'(\w)'\s*\)/.exec(text)
+ if (flag) return flag[1]
+ if (/^\s*(?:\}\s*)?else\s*(?:\{\s*)?$/.test(text)) return ''
+ return undefined
+ }
+ return undefined
+}
+
+/**
+ * Problems with one command's scope table against one release's C model.
+ * @param {{ scopes: { id: string, flag: string, function: string }[] }} entry
+ * @param {{ commands: { name: string, callback: string }[], symbols: { id: string, name: string, references?: { target: string, kind: string, sites?: { file: string, line: number }[] }[] }[] }} model
+ * @param {string} command
+ * @param {(file: string) => string | undefined} [readSource] The release's C source, when a checkout is at hand.
+ */
+export function scopeProblems(entry, model, command, readSource) {
+ const problems = []
+ const registered = model.commands.find((candidate) => candidate.name === command)
+ const exec = registered && model.symbols.find((symbol) => symbol.id === registered.callback)
+ if (!exec) return [`${command}: no registered callback`]
+ for (const scope of entry.scopes) {
+ const target = model.symbols.find((symbol) => symbol.name === scope.function && symbol.id.startsWith('c:function:'))
+ const call = target && exec.references?.find((reference) => reference.kind === 'call' && reference.target === target.id)
+ if (!call) { problems.push(`${command}: ${exec.name} does not call ${scope.function}`); continue }
+ const site = call.sites?.[0]
+ const source = site && readSource?.(site.file)
+ if (source === undefined || !site) continue
+ const flag = guardFlag(source, site.line)
+ if (flag !== scope.flag) problems.push(`${command}: ${scope.function} is called under ${flag === undefined ? 'no readable guard' : `'${flag}'`}, not '${scope.flag}'`)
+ }
+ return problems
+}
diff --git a/scripts/test-all.sh b/scripts/test-all.sh
index 05f906ff2..51fce25dc 100755
--- a/scripts/test-all.sh
+++ b/scripts/test-all.sh
@@ -151,6 +151,15 @@ fi
step 'tmux catalog (negative)'
node scripts/gen-tmux-catalog.negative.mjs
+# Which library symbols send which tmux command is read from each port's
+# source at the revision its API model was extracted from. Without the port
+# checkouts this verifies shape and revisions; with them it regenerates too.
+step 'tmux library usage'
+node scripts/gen-tmux-usage.mjs --check --source
+
+step 'tmux library usage (negative)'
+node scripts/gen-tmux-usage.negative.mjs
+
step 'shell port table'
node scripts/gen-shell-ports.mjs --check
diff --git a/scripts/test-loop.mjs b/scripts/test-loop.mjs
index 2287147b9..a1da48243 100644
--- a/scripts/test-loop.mjs
+++ b/scripts/test-loop.mjs
@@ -77,6 +77,7 @@ try {
node('scripts/gen-mentions.mjs', '--check'),
node('scripts/gen-workspace-entities.mjs', '--check'),
node('scripts/gen-tmux-catalog.mjs', '--check'),
+ node('scripts/gen-tmux-usage.mjs', '--check'),
node('scripts/gen-shell-ports.mjs', '--check'),
node('scripts/gen-brand-css.mjs', '--check'),
)
diff --git a/scripts/tmux-usage/claims.json b/scripts/tmux-usage/claims.json
new file mode 100644
index 000000000..f73555d69
--- /dev/null
+++ b/scripts/tmux-usage/claims.json
@@ -0,0 +1,116 @@
+{
+ "schemaVersion": 1,
+ "claims": [
+ {
+ "port": "rs", "symbol": "server.Server.panes", "command": "list-panes", "scope": "server",
+ "evidence": [
+ { "at": "crates/libtmux/src/internal/listing.rs:204", "has": ["LIST_COMMAND: &str = \"list-panes\""] },
+ { "at": "crates/libtmux/src/internal/listing.rs:58", "has": ["Self::Server", ".arg(\"-a\")"] },
+ { "at": "crates/libtmux/src/server/discovery.rs:41", "has": ["listing::panes", "Scope::Server"], "in": "server.Server.panes" }
+ ]
+ },
+ {
+ "port": "rs", "symbol": "session.Session.panes", "command": "list-panes", "scope": "session",
+ "evidence": [
+ { "at": "crates/libtmux/src/internal/listing.rs:204", "has": ["LIST_COMMAND: &str = \"list-panes\""] },
+ { "at": "crates/libtmux/src/internal/listing.rs:60", "has": ["Self::SessionTarget", ".arg(\"-s\")"] },
+ { "at": "crates/libtmux/src/session.rs:440", "has": ["listing::panes", "Scope::SessionTarget"], "in": "session.Session.panes" }
+ ]
+ },
+ {
+ "port": "rs", "symbol": "window.Window.panes", "command": "list-panes", "scope": "window",
+ "evidence": [
+ { "at": "crates/libtmux/src/internal/listing.rs:204", "has": ["LIST_COMMAND: &str = \"list-panes\""] },
+ { "at": "crates/libtmux/src/internal/listing.rs:59", "has": ["Self::Target", ".arg(\"-t\")"] },
+ { "at": "crates/libtmux/src/window/navigation.rs:23", "has": ["listing::panes", "Scope::Target"], "in": "window.Window.panes" }
+ ]
+ },
+ {
+ "port": "ts", "symbol": "server.Server.snapshot", "command": "list-panes", "scope": "server",
+ "evidence": [
+ { "at": "packages/libtmux/src/_internal/operations/acquire.ts:27", "has": ["\"list-panes\"", "[\"-a\"]"] },
+ { "at": "packages/libtmux/src/_internal/operations/acquire.ts:90", "has": ["ACQUISITION_LISTINGS"] },
+ { "at": "packages/libtmux/src/_internal/operations/acquire.ts:126", "has": ["acquireServerGraphAttempt"] },
+ { "at": "packages/libtmux/src/_internal/operations/snapshot.ts:42", "has": ["acquireServerGraph"] },
+ { "at": "packages/libtmux/src/server.ts:533", "has": ["buildServerSnapshot"], "in": "server.Server.snapshot" }
+ ]
+ },
+ {
+ "port": "ruby", "symbol": "LibTmux::Server#list_panes", "command": "list-panes", "scope": "server",
+ "evidence": [
+ { "at": "gems/libtmux/lib/libtmux/server.rb:470", "has": ["\"list-#{kind}s\""] },
+ { "at": "gems/libtmux/lib/libtmux/server.rb:163", "has": ["list_entities(:pane", "[\"-a\"]"], "in": "LibTmux::Server#list_panes" }
+ ]
+ },
+ {
+ "port": "ruby", "symbol": "LibTmux::Session#list_panes", "command": "list-panes", "scope": "session",
+ "evidence": [
+ { "at": "gems/libtmux/lib/libtmux/server.rb:470", "has": ["\"list-#{kind}s\""] },
+ { "at": "gems/libtmux/lib/libtmux/entity.rb:113", "has": [":list_entities, :pane", "[\"-s\", \"-t\""], "in": "LibTmux::Session#list_panes" }
+ ]
+ },
+ {
+ "port": "ruby", "symbol": "LibTmux::Window#list_panes", "command": "list-panes", "scope": "window",
+ "evidence": [
+ { "at": "gems/libtmux/lib/libtmux/server.rb:470", "has": ["\"list-#{kind}s\""] },
+ { "at": "gems/libtmux/lib/libtmux/entity.rb:123", "has": [":list_entities, :pane", "[\"-t\""], "in": "LibTmux::Window#list_panes" }
+ ]
+ },
+ {
+ "port": "lua", "symbol": "libtmux.Server:snapshot", "command": "list-panes", "scope": "server",
+ "evidence": [
+ { "at": "lua/libtmux/_internal/server.lua:22", "has": ["\"list-panes\"", "\"-a\""] },
+ { "at": "lua/libtmux/_internal/server.lua:177", "has": ["ipairs(specs)"] },
+ { "at": "lua/libtmux/_internal/server.lua:309", "has": ["acquire("] },
+ { "at": "lua/libtmux/_internal/server.lua:432", "has": ["capture("], "in": "libtmux.Server:snapshot" }
+ ]
+ },
+ {
+ "port": "java", "symbol": "io.github.libtmux.Server.Server.snapshot", "command": "list-panes", "scope": "server",
+ "evidence": [
+ { "at": "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:183", "has": ["\"list-panes\"", "\"-a\""] },
+ { "at": "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:103", "has": ["capture(process)"] },
+ { "at": "libtmux/src/main/java/io/github/libtmux/Server.java:878", "has": ["capture.attempt()"], "in": "io.github.libtmux.Server.Server.snapshot" }
+ ]
+ },
+ {
+ "port": "csharp", "symbol": "LibTmux.Server.CaptureSnapshotAsync", "command": "list-panes", "scope": "server",
+ "evidence": [
+ { "at": "src/LibTmux/Snapshots/ServerSnapshot.cs:120", "has": ["\"list-panes\"", "[\"-a\""] },
+ { "at": "src/LibTmux/Snapshots/ServerSnapshot.cs:55", "has": ["ReadRowsAsync"] },
+ { "at": "src/LibTmux/Server.Snapshots.cs:119", "has": [".ReadAsync(live, depth, sessionFilter"] },
+ { "at": "src/LibTmux/Server.Snapshots.cs:98", "has": ["CaptureSnapshotAsync(depth, timeProvider, sessionFilter: null"] },
+ { "at": "src/LibTmux/Server.Snapshots.cs:91", "has": ["CaptureSnapshotAsync(depth, TimeProvider.System"], "in": "LibTmux.Server.CaptureSnapshotAsync" }
+ ]
+ },
+ {
+ "port": "powershell", "symbol": "LibTmux\\Get-TmuxPane", "command": "list-panes", "scope": "window",
+ "via": { "port": "csharp", "symbol": "LibTmux.Window.GetPanesAsync" },
+ "evidence": [
+ { "at": "src/LibTmux.PowerShell/GetTmuxPaneCommand.cs:43", "has": ["Window!.GetPanesAsync"], "in": "LibTmux\\Get-TmuxPane" }
+ ]
+ },
+ {
+ "port": "powershell", "symbol": "LibTmux\\Get-TmuxPane", "command": "list-panes", "scope": "session",
+ "via": { "port": "csharp", "symbol": "LibTmux.Session.GetPanesAsync" },
+ "evidence": [
+ { "at": "src/LibTmux.PowerShell/GetTmuxPaneCommand.cs:46", "has": ["Session!.GetPanesAsync"], "in": "LibTmux\\Get-TmuxPane" }
+ ]
+ },
+ {
+ "port": "powershell", "symbol": "LibTmux\\Get-TmuxPane", "command": "list-panes", "scope": "server",
+ "via": { "port": "csharp", "symbol": "LibTmux.Server.CaptureSnapshotAsync" },
+ "evidence": [
+ { "at": "src/LibTmux.PowerShell/GetTmuxPaneCommand.cs:49", "has": ["Server!.CaptureSnapshotAsync(SnapshotDepth.Panes"], "in": "LibTmux\\Get-TmuxPane" }
+ ]
+ },
+ {
+ "port": "julia", "symbol": "LibTmux.snapshot", "command": "list-panes", "scope": "server",
+ "evidence": [
+ { "at": "src/acquisition.jl:120", "has": ["\"list-panes\""] },
+ { "at": "src/acquisition.jl:125", "has": ["args=(\"-a\",)"] },
+ { "at": "src/acquisition.jl:231", "has": ["_capture_graph_rows("], "in": "LibTmux.snapshot" }
+ ]
+ }
+ ]
+}
diff --git a/site/src/data/tmux-usage/csharp.json b/site/src/data/tmux-usage/csharp.json
new file mode 100644
index 000000000..68796074f
--- /dev/null
+++ b/site/src/data/tmux-usage/csharp.json
@@ -0,0 +1,97 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "csharp",
+ "repo": "libtmux/libtmux-dotnet",
+ "revision": "ec8b6ab2a4f65e23664f43fba538ba200d4ae8bc",
+ "schemaVersion": 1,
+ "symbols": {
+ "LibTmux.Server.CaptureSnapshotAsync": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/LibTmux/Snapshots/ServerSnapshot.cs:120",
+ "src/LibTmux/Snapshots/ServerSnapshot.cs:55",
+ "src/LibTmux/Server.Snapshots.cs:119",
+ "src/LibTmux/Server.Snapshots.cs:98",
+ "src/LibTmux/Server.Snapshots.cs:91"
+ ],
+ "reviewed": true,
+ "scope": "server"
+ }
+ ],
+ "LibTmux.Server.GetPanesAsync": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/LibTmux/Server.Collections.cs:72"
+ ],
+ "scope": "server"
+ }
+ ],
+ "LibTmux.Server.SearchPanesAsync": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/LibTmux/Query/NativeFilterSearch.cs:51"
+ ],
+ "scope": "server"
+ }
+ ],
+ "LibTmux.Session.GetActivePaneAsync": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/LibTmux/Session.Relations.cs:184"
+ ],
+ "scope": "session"
+ }
+ ],
+ "LibTmux.Session.GetPanesAsync": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/LibTmux/Session.Relations.cs:167"
+ ],
+ "scope": "session"
+ }
+ ],
+ "LibTmux.Session.SearchPanesAsync": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/LibTmux/Session.Lifecycle.cs:239"
+ ],
+ "scope": "session"
+ }
+ ],
+ "LibTmux.Window.GetActivePaneAsync": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/LibTmux/Window.Relations.cs:141"
+ ],
+ "scope": "window"
+ }
+ ],
+ "LibTmux.Window.GetPanesAsync": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/LibTmux/Window.Relations.cs:123"
+ ],
+ "scope": "window"
+ }
+ ],
+ "LibTmux.Window.SearchPanesAsync": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/LibTmux/Window.Panes.cs:298"
+ ],
+ "scope": "window"
+ }
+ ]
+ }
+}
diff --git a/site/src/data/tmux-usage/cxx.json b/site/src/data/tmux-usage/cxx.json
new file mode 100644
index 000000000..544d1371f
--- /dev/null
+++ b/site/src/data/tmux-usage/cxx.json
@@ -0,0 +1,38 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "cxx",
+ "repo": "libtmux/libtmux-cxx",
+ "revision": "3f93b021cb51e8349bfb9cecc6fd4091f6e79a0f",
+ "schemaVersion": 1,
+ "symbols": {
+ "libtmux::Server::panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/server.cpp:873"
+ ],
+ "scope": "server"
+ }
+ ],
+ "libtmux::Session::panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/entities.cpp:269"
+ ],
+ "scope": "session"
+ }
+ ],
+ "libtmux::Window::panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/entities.cpp:561"
+ ],
+ "scope": "window"
+ }
+ ]
+ }
+}
diff --git a/site/src/data/tmux-usage/fsharp.json b/site/src/data/tmux-usage/fsharp.json
new file mode 100644
index 000000000..011e8a9bc
--- /dev/null
+++ b/site/src/data/tmux-usage/fsharp.json
@@ -0,0 +1,10 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "fsharp",
+ "repo": "libtmux/libtmux-dotnet",
+ "revision": "4f1b997b2e4aeb604c4184707e49dcd4dea44fef",
+ "schemaVersion": 1,
+ "symbols": {}
+}
diff --git a/site/src/data/tmux-usage/go.json b/site/src/data/tmux-usage/go.json
new file mode 100644
index 000000000..bc14775b6
--- /dev/null
+++ b/site/src/data/tmux-usage/go.json
@@ -0,0 +1,57 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "go",
+ "repo": "libtmux/libtmux-go",
+ "revision": "6f3df55f8a41999e41225eefb3940545b834e6a2",
+ "schemaVersion": 1,
+ "symbols": {
+ "tmux.Pane.Select": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "tmux/lookup.go:371",
+ "tmux/window_pane_topology.go:199"
+ ],
+ "scope": "window"
+ }
+ ],
+ "tmux.Server.SearchPanes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "tmux/search.go:79"
+ ],
+ "scope": "server"
+ }
+ ],
+ "tmux.Server.Snapshot": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "tmux/snapshot_capture.go:45"
+ ],
+ "scope": "server"
+ }
+ ],
+ "tmux.Session.SearchPanes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "tmux/search.go:129"
+ ],
+ "scope": "session"
+ }
+ ],
+ "tmux.Window.SearchPanes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "tmux/search.go:154"
+ ],
+ "scope": "window"
+ }
+ ]
+ }
+}
diff --git a/site/src/data/tmux-usage/java.json b/site/src/data/tmux-usage/java.json
new file mode 100644
index 000000000..a0bdfc016
--- /dev/null
+++ b/site/src/data/tmux-usage/java.json
@@ -0,0 +1,111 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "java",
+ "repo": "libtmux/libtmux-java",
+ "revision": "a0ecbc16da00140e2520462d478a2af470878272",
+ "schemaVersion": 1,
+ "symbols": {
+ "io.github.libtmux.Pane.Pane.sendKeys": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "libtmux/src/main/java/io/github/libtmux/Pane.java:668",
+ "libtmux/src/main/java/io/github/libtmux/Pane.java:577"
+ ],
+ "scope": "window"
+ }
+ ],
+ "io.github.libtmux.Pane.Pane.sendLiteral": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "libtmux/src/main/java/io/github/libtmux/Pane.java:668",
+ "libtmux/src/main/java/io/github/libtmux/Pane.java:619"
+ ],
+ "scope": "window"
+ }
+ ],
+ "io.github.libtmux.Server.Server.paneFields": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "libtmux/src/main/java/io/github/libtmux/Server.java:538"
+ ],
+ "scope": "server"
+ }
+ ],
+ "io.github.libtmux.Server.Server.panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "libtmux/src/main/java/io/github/libtmux/Server.java:998"
+ ],
+ "scope": "server"
+ }
+ ],
+ "io.github.libtmux.Server.Server.snapshot": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:183",
+ "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:103",
+ "libtmux/src/main/java/io/github/libtmux/Server.java:878"
+ ],
+ "reviewed": true,
+ "scope": "server"
+ }
+ ],
+ "io.github.libtmux.SnapshotCapture.SnapshotCapture.attempt": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:183",
+ "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:103"
+ ],
+ "scope": "server"
+ }
+ ],
+ "io.github.libtmux.SnapshotCapture.SnapshotCapture.oneSession": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:292",
+ "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:227"
+ ],
+ "scope": "server"
+ }
+ ],
+ "io.github.libtmux.SnapshotCapture.SnapshotCapture.sessionsHolding": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:292",
+ "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:342"
+ ],
+ "scope": "server"
+ }
+ ],
+ "io.github.libtmux.SnapshotCapture.SnapshotCapture.sessionsNamed": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:292",
+ "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:251"
+ ],
+ "scope": "server"
+ }
+ ],
+ "io.github.libtmux.SnapshotCapture.SnapshotCapture.sessionsWhere": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:292",
+ "libtmux/src/main/java/io/github/libtmux/SnapshotCapture.java:276"
+ ],
+ "scope": "server"
+ }
+ ]
+ }
+}
diff --git a/site/src/data/tmux-usage/julia.json b/site/src/data/tmux-usage/julia.json
new file mode 100644
index 000000000..4285fef58
--- /dev/null
+++ b/site/src/data/tmux-usage/julia.json
@@ -0,0 +1,23 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "julia",
+ "repo": "libtmux/libtmux-julia",
+ "revision": "f3da513be1225d36d5854cd8db5972c01857578e",
+ "schemaVersion": 1,
+ "symbols": {
+ "LibTmux.snapshot": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/acquisition.jl:120",
+ "src/acquisition.jl:125",
+ "src/acquisition.jl:231"
+ ],
+ "reviewed": true,
+ "scope": "server"
+ }
+ ]
+ }
+}
diff --git a/site/src/data/tmux-usage/kotlin.json b/site/src/data/tmux-usage/kotlin.json
new file mode 100644
index 000000000..4e3bb306f
--- /dev/null
+++ b/site/src/data/tmux-usage/kotlin.json
@@ -0,0 +1,10 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "kotlin",
+ "repo": "libtmux/libtmux-java",
+ "revision": "a0ecbc16da00140e2520462d478a2af470878272",
+ "schemaVersion": 1,
+ "symbols": {}
+}
diff --git a/site/src/data/tmux-usage/lua.json b/site/src/data/tmux-usage/lua.json
new file mode 100644
index 000000000..270917fcb
--- /dev/null
+++ b/site/src/data/tmux-usage/lua.json
@@ -0,0 +1,24 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "lua",
+ "repo": "libtmux/libtmux-lua",
+ "revision": "0395620d362ef75c74cd488f9577afda68922586",
+ "schemaVersion": 1,
+ "symbols": {
+ "libtmux.Server:snapshot": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "lua/libtmux/_internal/server.lua:22",
+ "lua/libtmux/_internal/server.lua:177",
+ "lua/libtmux/_internal/server.lua:309",
+ "lua/libtmux/_internal/server.lua:432"
+ ],
+ "reviewed": true,
+ "scope": "server"
+ }
+ ]
+ }
+}
diff --git a/site/src/data/tmux-usage/powershell.json b/site/src/data/tmux-usage/powershell.json
new file mode 100644
index 000000000..5f978ac20
--- /dev/null
+++ b/site/src/data/tmux-usage/powershell.json
@@ -0,0 +1,49 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "powershell",
+ "repo": "libtmux/libtmux-powershell",
+ "revision": "b06c64f844f3173de66b187eaeaf3915814318c6",
+ "schemaVersion": 1,
+ "symbols": {
+ "LibTmux\\Get-TmuxPane": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/LibTmux.PowerShell/GetTmuxPaneCommand.cs:49"
+ ],
+ "reviewed": true,
+ "scope": "server",
+ "via": {
+ "port": "csharp",
+ "symbol": "LibTmux.Server.CaptureSnapshotAsync"
+ }
+ },
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/LibTmux.PowerShell/GetTmuxPaneCommand.cs:46"
+ ],
+ "reviewed": true,
+ "scope": "session",
+ "via": {
+ "port": "csharp",
+ "symbol": "LibTmux.Session.GetPanesAsync"
+ }
+ },
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/LibTmux.PowerShell/GetTmuxPaneCommand.cs:43"
+ ],
+ "reviewed": true,
+ "scope": "window",
+ "via": {
+ "port": "csharp",
+ "symbol": "LibTmux.Window.GetPanesAsync"
+ }
+ }
+ ]
+ }
+}
diff --git a/site/src/data/tmux-usage/py.json b/site/src/data/tmux-usage/py.json
new file mode 100644
index 000000000..994379feb
--- /dev/null
+++ b/site/src/data/tmux-usage/py.json
@@ -0,0 +1,74 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "py",
+ "repo": "tmux-python/libtmux",
+ "revision": "8e0ce38400618bd783e6276270dd7f5d8cb283ea",
+ "schemaVersion": 1,
+ "symbols": {
+ "libtmux.Pane.from_pane_id": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/libtmux/pane.py:227"
+ ],
+ "scope": "window"
+ }
+ ],
+ "libtmux.Server.panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/libtmux/server.py:2463"
+ ],
+ "scope": "server"
+ }
+ ],
+ "libtmux.Server.search_panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/libtmux/server.py:2671"
+ ],
+ "scope": "server"
+ }
+ ],
+ "libtmux.Session.panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/libtmux/session.py:302"
+ ],
+ "scope": "session"
+ }
+ ],
+ "libtmux.Session.search_panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/libtmux/session.py:412"
+ ],
+ "scope": "session"
+ }
+ ],
+ "libtmux.Window.panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/libtmux/window.py:401"
+ ],
+ "scope": "window"
+ }
+ ],
+ "libtmux.Window.search_panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "src/libtmux/window.py:456"
+ ],
+ "scope": "window"
+ }
+ ]
+ }
+}
diff --git a/site/src/data/tmux-usage/rs.json b/site/src/data/tmux-usage/rs.json
new file mode 100644
index 000000000..43425207d
--- /dev/null
+++ b/site/src/data/tmux-usage/rs.json
@@ -0,0 +1,56 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "rs",
+ "repo": "libtmux/libtmux-rs",
+ "revision": "a6fc2a65674177b92b17fa380757155d2ba150fd",
+ "schemaVersion": 1,
+ "symbols": {
+ "control.ControlSender.watch_only": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "crates/libtmux/src/control.rs:1077"
+ ],
+ "scope": "session"
+ }
+ ],
+ "server.Server.panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "crates/libtmux/src/internal/listing.rs:204",
+ "crates/libtmux/src/internal/listing.rs:58",
+ "crates/libtmux/src/server/discovery.rs:41"
+ ],
+ "reviewed": true,
+ "scope": "server"
+ }
+ ],
+ "session.Session.panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "crates/libtmux/src/internal/listing.rs:204",
+ "crates/libtmux/src/internal/listing.rs:60",
+ "crates/libtmux/src/session.rs:440"
+ ],
+ "reviewed": true,
+ "scope": "session"
+ }
+ ],
+ "window.Window.panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "crates/libtmux/src/internal/listing.rs:204",
+ "crates/libtmux/src/internal/listing.rs:59",
+ "crates/libtmux/src/window/navigation.rs:23"
+ ],
+ "reviewed": true,
+ "scope": "window"
+ }
+ ]
+ }
+}
diff --git a/site/src/data/tmux-usage/ruby.json b/site/src/data/tmux-usage/ruby.json
new file mode 100644
index 000000000..b17839239
--- /dev/null
+++ b/site/src/data/tmux-usage/ruby.json
@@ -0,0 +1,44 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "ruby",
+ "repo": "libtmux/libtmux-ruby",
+ "revision": "9b1545562a112353c2c893a1d3e8c0d9b4b51f8d",
+ "schemaVersion": 1,
+ "symbols": {
+ "LibTmux::Server#list_panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "gems/libtmux/lib/libtmux/server.rb:470",
+ "gems/libtmux/lib/libtmux/server.rb:163"
+ ],
+ "reviewed": true,
+ "scope": "server"
+ }
+ ],
+ "LibTmux::Session#list_panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "gems/libtmux/lib/libtmux/server.rb:470",
+ "gems/libtmux/lib/libtmux/entity.rb:113"
+ ],
+ "reviewed": true,
+ "scope": "session"
+ }
+ ],
+ "LibTmux::Window#list_panes": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "gems/libtmux/lib/libtmux/server.rb:470",
+ "gems/libtmux/lib/libtmux/entity.rb:123"
+ ],
+ "reviewed": true,
+ "scope": "window"
+ }
+ ]
+ }
+}
diff --git a/site/src/data/tmux-usage/scala.json b/site/src/data/tmux-usage/scala.json
new file mode 100644
index 000000000..9dd5a101d
--- /dev/null
+++ b/site/src/data/tmux-usage/scala.json
@@ -0,0 +1,10 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "scala",
+ "repo": "libtmux/libtmux-java",
+ "revision": "a0ecbc16da00140e2520462d478a2af470878272",
+ "schemaVersion": 1,
+ "symbols": {}
+}
diff --git a/site/src/data/tmux-usage/scopes.json b/site/src/data/tmux-usage/scopes.json
new file mode 100644
index 000000000..b229ae3a5
--- /dev/null
+++ b/site/src/data/tmux-usage/scopes.json
@@ -0,0 +1,12 @@
+{
+ "schemaVersion": 1,
+ "commands": {
+ "list-panes": {
+ "scopes": [
+ { "id": "server", "label": "Server", "flag": "a", "function": "cmd_list_panes_server" },
+ { "id": "session", "label": "Session", "flag": "s", "function": "cmd_list_panes_session" },
+ { "id": "window", "label": "Window", "flag": "", "target": "t", "function": "cmd_list_panes_window" }
+ ]
+ }
+ }
+}
diff --git a/site/src/data/tmux-usage/swift.json b/site/src/data/tmux-usage/swift.json
new file mode 100644
index 000000000..5a557efd3
--- /dev/null
+++ b/site/src/data/tmux-usage/swift.json
@@ -0,0 +1,29 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "swift",
+ "repo": "libtmux/libtmux-swift",
+ "revision": "7993e7044347629b08020e9b02ae8bcffa0e5898",
+ "schemaVersion": 1,
+ "symbols": {
+ "Server.panes()": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "Sources/LibTmux/Server.swift:285"
+ ],
+ "scope": "server"
+ }
+ ],
+ "Server.panes(where:)": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "Sources/LibTmux/FilteredListings.swift:80"
+ ],
+ "scope": "server"
+ }
+ ]
+ }
+}
diff --git a/site/src/data/tmux-usage/ts.json b/site/src/data/tmux-usage/ts.json
new file mode 100644
index 000000000..62531b515
--- /dev/null
+++ b/site/src/data/tmux-usage/ts.json
@@ -0,0 +1,25 @@
+{
+ "commands": [
+ "list-panes"
+ ],
+ "port": "ts",
+ "repo": "libtmux/libtmux-ts",
+ "revision": "46cccfef2a546de55ce8b308249b8c76339089a0",
+ "schemaVersion": 1,
+ "symbols": {
+ "server.Server.snapshot": [
+ {
+ "command": "list-panes",
+ "evidence": [
+ "packages/libtmux/src/_internal/operations/acquire.ts:27",
+ "packages/libtmux/src/_internal/operations/acquire.ts:90",
+ "packages/libtmux/src/_internal/operations/acquire.ts:126",
+ "packages/libtmux/src/_internal/operations/snapshot.ts:42",
+ "packages/libtmux/src/server.ts:533"
+ ],
+ "reviewed": true,
+ "scope": "server"
+ }
+ ]
+ }
+}
diff --git a/site/test/tmux-usage-derive.test.ts b/site/test/tmux-usage-derive.test.ts
new file mode 100644
index 000000000..b6d2c6265
--- /dev/null
+++ b/site/test/tmux-usage-derive.test.ts
@@ -0,0 +1,245 @@
+import { readFileSync } from 'node:fs'
+import { describe, expect, it } from 'vitest'
+import { scanSource } from '../../scripts/lib/tmux-usage-scan.mjs'
+import { MAX_SHARED_BY, classify, definitionsOf, deriveUsage, verifyClaims } from '../../scripts/lib/tmux-usage-derive.mjs'
+import { guardFlag, libraryScopes, scopeProblems } from '../../scripts/lib/tmux-usage-scopes.mjs'
+
+const known = new Set(['list-panes', 'list-windows', 'list-sessions', 'new-window'])
+const scan = (grammar: string, text: string, command = 'list-panes') => scanSource({ grammar, text, commands: new Set([command]), known })
+const scopes = readFileSync(new URL('../src/data/tmux-usage/scopes.json', import.meta.url), 'utf8')
+const spec = { scopes: libraryScopes(JSON.parse(scopes).commands['list-panes']) }
+
+describe('scanning a send site', () => {
+ it('reads the flags written beside the command and ignores a docstring and a default value', async () => {
+ const { functions } = await scan('python', [
+ 'class Session:',
+ ' @property',
+ ' def panes(self):',
+ ' """Runs list-panes with -a."""',
+ ' return fetch(list_cmd="list-panes", list_extra_args=["-s", "-t", self.id])',
+ '',
+ ' def windows(self):',
+ ' return fetch(list_cmd="list-windows", list_extra_args=["-t", self.id])',
+ '',
+ ' def refresh(self, list_cmd: str = "list-panes"):',
+ ' return None',
+ '',
+ ].join('\n'))
+ const byName = Object.fromEntries(functions.map((fn) => [fn.name, fn]))
+ expect(byName.panes.sites).toEqual([{ command: 'list-panes', line: 5, flags: 'st' }])
+ // The control: a different command in the same class, and a default value, are not sends.
+ expect(byName.windows.sites).toEqual([])
+ expect(byName.refresh.sites).toEqual([])
+ })
+
+ it('reads a command line that starts with the command, and not a message that mentions it', async () => {
+ const { functions } = await scan('python', [
+ 'def run(self):',
+ ' self.cmd("list-panes -a -F x")',
+ ' raise Unsupported("list-panes state")',
+ ' raise Unsupported("list-panes")',
+ '',
+ ].join('\n'))
+ expect(functions[0].sites.map((site) => [site.line, site.flags])).toEqual([[2, 'Fa'], [4, '']])
+ })
+
+ it('does not lend a neighbouring command its flags', async () => {
+ const { functions } = await scan('python', [
+ 'def capture():',
+ ' return [("list-windows", "-a"), ("list-panes", "-t", "x")]',
+ '',
+ ].join('\n'))
+ expect(functions[0].sites.map((site) => site.flags)).toEqual(['t'])
+ })
+
+ it('drops the Windows-only branch of a C++ method, which talks to psmux and not tmux', async () => {
+ const { functions } = await scan('cpp', [
+ 'int Server::panes() {',
+ '#if defined(_WIN32)',
+ ' return run({"list-panes", "-s", "-t", ":"});',
+ '#else',
+ ' return run({"list-panes", "-a"});',
+ '#endif',
+ '}',
+ '',
+ ].join('\n'))
+ expect(functions[0]).toMatchObject({ name: 'panes', owner: 'Server' })
+ expect(functions[0].sites).toEqual([{ command: 'list-panes', line: 5, flags: 'a' }])
+ })
+
+ it('names a Lua method by its table', async () => {
+ const { functions } = await scan('lua', 'function Server:snapshot(options)\n return run({ "list-panes", "-a" })\nend\n')
+ expect(functions).toMatchObject([{ name: 'snapshot', owner: 'Server' }])
+ expect(functions[0].sites[0].flags).toBe('a')
+ })
+
+ it('keeps a site outside any function apart, so a module constant is not credited to a neighbour', async () => {
+ const { functions, orphans } = await scan('python', 'LISTINGS = [("list-panes", "-a")]\n\ndef other():\n return 1\n')
+ expect(orphans).toEqual([{ command: 'list-panes', line: 1, flags: 'a' }])
+ expect(functions[0].sites).toEqual([])
+ })
+})
+
+const located = (over: Record) => ({
+ file: 'lib.py', name: 'f', owner: undefined, start: 1, nameLine: 1, end: 3, kind: 'function_definition', sites: [], calls: new Map(), ...over,
+}) as Parameters[0]['functions'][number]
+const site = (flags: string, line = 2) => ({ command: 'list-panes', line, flags })
+const symbol = (name: string, line: number, over: Record = {}) => ({ id: `S.${name}`, name, file: 'lib.py', line, ...over })
+
+describe('deciding which symbol sends a command', () => {
+ it('maps a method that sends with -s to the session scope and a method that sends nothing to nothing', () => {
+ const functions = [
+ located({ name: 'panes', start: 1, nameLine: 1, end: 3, sites: [site('st', 2)] }),
+ located({ name: 'windows', start: 5, nameLine: 5, end: 7 }),
+ ]
+ const { entries, unresolved } = deriveUsage({ command: 'list-panes', spec, functions, symbols: [symbol('panes', 1), symbol('windows', 5)] })
+ expect(entries).toEqual([{ symbol: 'S.panes', command: 'list-panes', scope: 'session', evidence: ['lib.py:2'], hops: 0 }])
+ expect(unresolved).toEqual([])
+ })
+
+ it('selects the scope by the flag: -a before -s before a target, and none when no flag settles it', () => {
+ expect(classify(spec, 'aF')).toBe('server')
+ expect(classify(spec, 'st')).toBe('session')
+ expect(classify(spec, 't')).toBe('window')
+ // A command with no flag at all may take its scope from somewhere else, so it stays unlinked.
+ expect(classify(spec, 'F')).toBe('unknown')
+ expect(classify(undefined, 'a')).toBeNull()
+ })
+
+ it('credits the public caller of a private helper once, with both lines as evidence', () => {
+ const functions = [
+ located({ name: '_list', start: 10, nameLine: 10, end: 14, sites: [site('a', 12)] }),
+ located({ name: 'everything', start: 1, nameLine: 1, end: 4, calls: new Map([['_list', 3]]) }),
+ ]
+ const { entries } = deriveUsage({ command: 'list-panes', spec, functions, symbols: [symbol('everything', 1)] })
+ expect(entries).toEqual([{ symbol: 'S.everything', command: 'list-panes', scope: 'server', evidence: ['lib.py:12', 'lib.py:3'], hops: 1 }])
+ })
+
+ it('does not credit a method that only calls another public sender', () => {
+ const functions = [
+ located({ name: 'snapshot', start: 1, nameLine: 1, end: 3, sites: [site('a', 2)] }),
+ located({ name: 'panes', start: 5, nameLine: 5, end: 7, calls: new Map([['snapshot', 6]]) }),
+ ]
+ const { entries } = deriveUsage({ command: 'list-panes', spec, functions, symbols: [symbol('snapshot', 1), symbol('panes', 5)] })
+ expect(entries.map((entry) => entry.symbol)).toEqual(['S.snapshot'])
+ })
+
+ it('leaves a helper that lists at several scopes to its claims, because a caller cannot choose', () => {
+ const functions = [
+ located({ name: '_command', start: 10, nameLine: 10, end: 16, sites: [site('t', 11), site('st', 12), site('a', 13)] }),
+ located({ name: 'panes', start: 1, nameLine: 1, end: 4, calls: new Map([['_command', 3]]) }),
+ ]
+ const { entries, unresolved } = deriveUsage({ command: 'list-panes', spec, functions, symbols: [symbol('panes', 1)] })
+ expect(entries).toEqual([])
+ expect(unresolved.map((item) => item.reason)).toEqual(['a shared helper lists at several scopes'])
+ })
+
+ it('leaves a helper that many public methods call alone, because it is not what they are for', () => {
+ const callers = Array.from({ length: MAX_SHARED_BY + 1 }, (_, index) =>
+ located({ name: `op${index}`, start: 20 + index * 3, nameLine: 20 + index * 3, end: 22 + index * 3, calls: new Map([['_refresh', 21 + index * 3]]) }))
+ const functions = [located({ name: '_refresh', start: 10, nameLine: 10, end: 14, sites: [site('t', 12)] }), ...callers]
+ const symbols = callers.map((fn) => symbol(fn.name, fn.start))
+ const { entries, unresolved } = deriveUsage({ command: 'list-panes', spec, functions, symbols })
+ expect(entries).toEqual([])
+ expect(unresolved[0].reason).toMatch(/shared by 5 public symbols/)
+ })
+
+ it('finds a C++ definition from the header that declares it, and not from a same-named type', () => {
+ const functions = [located({ file: 'src/entities.cpp', name: 'panes', owner: 'Window', start: 5, nameLine: 5, end: 9, sites: [site('t', 7)] })]
+ const symbols = [
+ { id: 'a::Window::panes', name: 'panes', qualified: 'a::Window::panes', parentName: 'a::Window', file: 'include/a/entities.hpp', line: 40 },
+ { id: 'a::workspace::Window::panes', name: 'panes', qualified: 'a::workspace::Window::panes', parentName: 'a::workspace::Window', file: 'examples/workspace.hpp', line: 9 },
+ ]
+ const owned = [...definitionsOf(functions, symbols).values()].flat().map((entry) => entry.id)
+ expect(owned).toEqual(['a::Window::panes'])
+ })
+})
+
+describe('reviewed claims', () => {
+ const source = [
+ 'impl Server {',
+ ' pub async fn panes(&self) {',
+ ' listing::panes(&self.core, Scope::Server).await',
+ ' }',
+ '}',
+ 'match self { Self::Server => command.arg("-a") }',
+ ].join('\n')
+ const functions = [located({ file: 'server.rs', name: 'panes', owner: 'Server', start: 2, nameLine: 2, end: 4 })]
+ const symbols = [{ id: 'server.Server.panes', name: 'panes', parentName: 'Server', file: 'server.rs', line: 2 }]
+ const claim = (over: Record = {}) => ({
+ port: 'rs', symbol: 'server.Server.panes', command: 'list-panes', scope: 'server',
+ evidence: [
+ { at: 'server.rs:6', has: ['Self::Server', '.arg("-a")'] },
+ { at: 'server.rs:3', has: ['listing::panes', 'Scope::Server'], in: 'server.Server.panes' },
+ ],
+ ...over,
+ })
+ const verify = (claims: unknown[], sends?: () => boolean) => verifyClaims({
+ claims: claims as Parameters[0]['claims'], spec, functions, types: [], symbols,
+ readSource: (path: string) => (path === 'server.rs' ? source : undefined), sends,
+ })
+
+ it('accepts a claim whose lines still say what it says, anchored in the symbol', () => {
+ expect(verify([claim()])).toEqual({
+ problems: [],
+ entries: [{ symbol: 'server.Server.panes', command: 'list-panes', scope: 'server', evidence: ['server.rs:6', 'server.rs:3'], hops: 1, reviewed: true }],
+ })
+ })
+
+ it.each([
+ ['a line that no longer holds the text', { evidence: [{ at: 'server.rs:6', has: ['.arg("-s")'] }, { at: 'server.rs:3', in: 'server.Server.panes' }] }, /does not contain/],
+ ['a line past the end of the file', { evidence: [{ at: 'server.rs:99' }, { at: 'server.rs:3', in: 'server.Server.panes' }] }, /not a line of the pinned source/],
+ ['a line outside the symbol body', { evidence: [{ at: 'server.rs:6', in: 'server.Server.panes' }] }, /outside the body/],
+ ['no line anchored in the symbol', { evidence: [{ at: 'server.rs:3' }] }, /no evidence line is anchored/],
+ ['a symbol the model does not have', { symbol: 'server.Server.gone' }, /no such public symbol/],
+ ['a scope the command does not have', { scope: 'pane' }, /not a scope of this command/],
+ ['no evidence', { evidence: [] }, /cites no evidence/],
+ ])('rejects %s', (_name, over, message) => {
+ const { entries, problems } = verify([claim(over)])
+ expect(entries).toEqual([])
+ expect(problems.join('\n')).toMatch(message)
+ })
+
+ it('stands on a library symbol only while that symbol sends the command at that scope', () => {
+ const wrapped = claim({ via: { port: 'csharp', symbol: 'LibTmux.Server.GetPanesAsync' } })
+ expect(verify([wrapped], () => true).problems).toEqual([])
+ expect(verify([wrapped], () => false).problems.join('\n')).toMatch(/does not send list-panes at that scope/)
+ })
+})
+
+describe('the scope table against tmux', () => {
+ const entry = JSON.parse(scopes).commands['list-panes']
+ const source = [
+ 'static enum cmd_retval', 'cmd_list_panes_exec(struct cmd *self, struct cmdq_item *item)', '{',
+ "\tif (args_has(args, 'a'))", '\t\tcmd_list_panes_server(self, item);', "\telse if (args_has(args, 's'))",
+ '\t\tcmd_list_panes_session(self, s, item, 1);', '\telse', '\t\tcmd_list_panes_window(self, s, wl, item, 0);',
+ ].join('\n')
+ const call = (name: string, line: number) => ({ target: `c:function:x.c:${name}`, kind: 'call', sites: [{ file: 'x.c', line }] })
+ const model = {
+ commands: [{ name: 'list-panes', callback: 'c:function:x.c:cmd_list_panes_exec' }],
+ symbols: [
+ { id: 'c:function:x.c:cmd_list_panes_exec', name: 'cmd_list_panes_exec', references: [call('cmd_list_panes_server', 5), call('cmd_list_panes_session', 7), call('cmd_list_panes_window', 9)] },
+ ...['server', 'session', 'window'].map((scope) => ({ id: `c:function:x.c:cmd_list_panes_${scope}`, name: `cmd_list_panes_${scope}` })),
+ ],
+ }
+ const read = (file: string) => (file === 'x.c' ? source : undefined)
+
+ it('reads the flag that guards each call', () => {
+ expect([5, 7, 9].map((line) => guardFlag(source, line))).toEqual(['a', 's', ''])
+ expect(guardFlag('foo();\nbar();\n', 2)).toBeUndefined()
+ })
+
+ it('accepts the table that matches the dispatch and rejects one that does not', () => {
+ expect(scopeProblems(entry, model, 'list-panes', read)).toEqual([])
+ const swapped = { scopes: entry.scopes.map((scope: { id: string }) => scope.id === 'server' ? { ...scope, flag: 's' } : scope) }
+ expect(scopeProblems(swapped, model, 'list-panes', read)).toEqual(["list-panes: cmd_list_panes_server is called under 'a', not 's'"])
+ expect(scopeProblems(entry, model, 'list-panes', () => source.replace("if (args_has(args, 'a'))", 'if (flag)'))[0]).toMatch(/no readable guard/)
+ })
+
+ it.each(['3.7c', '3.2a'])('matches the C dispatch of tmux %s', (version) => {
+ const real = JSON.parse(readFileSync(new URL(`../src/data/tmux/api/${version}.json`, import.meta.url), 'utf8'))
+ expect(scopeProblems(entry, real, 'list-panes')).toEqual([])
+ const gone = { scopes: entry.scopes.map((scope: { id: string }) => scope.id === 'server' ? { ...scope, function: 'cmd_list_panes_gone' } : scope) }
+ expect(scopeProblems(gone, real, 'list-panes').join('\n')).toMatch(/does not call cmd_list_panes_gone/)
+ })
+})
From 326f9ade16ae41d13a77bab233764b253496d7b1 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Mon, 19 Oct 2026 20:24:31 -0500
Subject: [PATCH 06/53] feat(site[tmux-usage]) Link list-panes and its C
functions to its senders
why: The list-panes manual page listed one library method per language
and the C pages listed none, so a reader of cmd_list_panes_session could
not reach Session.panes, and Server.panes had no path to the code it
ends in. The concept map also named methods that only read a snapshot,
such as Go Window.Panes, as list-panes, which is not what they do.
what:
- Render the methods that send a command as a table of languages by
scope on the manual page and on the entry, exec and scope pages of the
C reference; each scope column names and links its C function, and the
scope pages show only their own column and the languages that send at
that scope
- Show a method's command, flag and scope function on its own page, in
the order: what it sends itself, its concept equivalents, what it
sends through a helper; put the same line in the Markdown export
- List a method on the command's pages when its own body sends the
command or a reviewed claim says so; a call through a helper stays on
the method page, so a refresh after every mutation is not a list-panes
method
- Stop offering the concept link for a command whose usage is recorded,
and name the languages that have no method of their own to list
- Link the three scope functions beside the entry and exec on the
manual page, and give a scope page's language picker only the
languages that send at that scope
Verified: the manual page for list-panes and capture-pane, the entry
fragment of a method page and the TmuxUsage table render through the
Astro container; the rendering tests fail when the concept link is kept,
helper calls are listed, owner ranking is off, or a scope page ignores
its scope, and pass with them restored. astro check reports no errors and
the site suite passes. Not run: the pages in a browser, which needs the
shared build.
---
CONTRIBUTING.md | 11 +
site/src/components/api/ApiEntry.astro | 25 +-
site/src/components/api/ApiReference.astro | 3 +
site/src/components/tmux/TmuxUsage.astro | 82 +++++
site/src/lib/symbol-markdown.ts | 21 ++
site/src/lib/tmux-library-usage.ts | 205 ++++++++++++
site/src/lib/tmux-manual-data.ts | 29 +-
site/src/lib/tmux-reference.ts | 118 ++++++-
.../tmux/[version]/manual/[...slug].astro | 13 +-
.../tmux/[version]/reference/[...slug].md.ts | 3 +-
site/src/styles/api.css | 5 +
site/src/styles/kind-marks.css | 10 +-
site/test/tmux-library-usage.test.ts | 314 ++++++++++++++++++
13 files changed, 810 insertions(+), 29 deletions(-)
create mode 100644 site/src/components/tmux/TmuxUsage.astro
create mode 100644 site/src/lib/tmux-library-usage.ts
create mode 100644 site/test/tmux-library-usage.test.ts
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4bcbbab86..ce5293c9a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -204,6 +204,17 @@ similar names alone do not establish one. An overloaded page can belong to
several concepts. The page dropdown and "In other ports" use these mappings,
and tests require every mapped target to resolve.
+A tmux command page links the methods that send the command, and a method
+page links the command and the C function behind its scope. Those links come
+from each port's source at the revision its API model was extracted from, not
+from concepts: a method that only reads a captured snapshot has no link. After
+a port's model changes revision, regenerate the usage data with the port
+checkouts present:
+
+```console
+$ node scripts/gen-tmux-usage.mjs
+```
+
"Discussed in" comes from API mentions in guides, including tables and
sections headed with a port name. After editing those mentions, regenerate
the index:
diff --git a/site/src/components/api/ApiEntry.astro b/site/src/components/api/ApiEntry.astro
index 9f9c4acf1..b8d576ee1 100644
--- a/site/src/components/api/ApiEntry.astro
+++ b/site/src/components/api/ApiEntry.astro
@@ -15,6 +15,8 @@ import ApiType from './ApiType.astro'
import { asideFor } from '../../lib/aside'
import { apiCommandFacts, apiCommandRelatedLinks, apiEntryFields, apiMethodDetails, anonymousDeclarationLabel, nativeSignatureText as unformattedNativeSignatureText, parameterBindingText, usesNativeSignatures } from '../../lib/api-sections'
import { tmuxCommandsFor, tmuxManualUrl } from '../../lib/tmux-manual-data'
+import { tmuxCommandRows, tmuxSymbolSends, type ResolvedUsage } from '../../lib/tmux-reference'
+import TmuxUsage from '../tmux/TmuxUsage.astro'
import { CATALOG_KINDS, tmuxCatalogKindsForSymbol, tmuxCatalogUrl } from '../../lib/tmux-catalog'
import ApiFieldOverloads from './ApiFieldOverloads.astro'
import ApiCommandParameters from './ApiCommandParameters.astro'
@@ -44,6 +46,8 @@ interface Props {
/** Declaration syntax, independent of library-port identity. */
language?: string
manualLinks?: { name: string; href: string }[]
+ /** The library methods that send the command a C declaration implements. */
+ usage?: ResolvedUsage[]
/** Catalog pages for a declaration in a source reference. */
catalogLinks?: { name: string; href: string }[]
/** Override equivalent links for a product or version context. */
@@ -76,7 +80,7 @@ interface Props {
/** Previous fragment for the same declaration. */
legacyId?: string
}
-const { symbol, index, sourceUrl, port, language = port, manualLinks, catalogLinks, alternativesFor, heading = false, member = false,
+const { symbol, index, sourceUrl, port, language = port, manualLinks, usage = [], catalogLinks, alternativesFor, heading = false, member = false,
showSummary = true, showBases = true, legacyId, nameHref } = Astro.props as Props
const anchor = symbol.publicId ?? symbol.id
const kind = symbol.kind
@@ -180,7 +184,9 @@ const references = symbol.doc?.references ?? []
* "explained in a concept" and "used in an example" are different offers.
*/
const mentions = port ? mentionsOf(port, symbol.id) : []
+// A command the symbol sends comes with its scope and C function; one it only has an equivalent for is a plain link.
const tmuxCommands = manualLinks ?? (port ? tmuxCommandsFor(port, anchor).map((command) => ({ ...command, href: tmuxManualUrl('latest', command.name) })) : [])
+const commandRows = tmuxCommandRows(port && !manualLinks ? tmuxSymbolSends(port, anchor) : [], tmuxCommands)
// Members that wrap options or hooks lead to the catalog of what they take.
const catalogEntries = catalogLinks ?? (port && !manualLinks ? tmuxCatalogKindsForSymbol(port, symbol).map((kind) => ({ name: CATALOG_KINDS[kind].label, href: tmuxCatalogUrl('latest', kind) })) : [])
const mentionSections = [...new Set(mentions.map((m) => m.section ?? 'docs'))].sort()
@@ -275,7 +281,8 @@ const hasBody =
Boolean(symbol.command) ||
methods.length > 0 ||
hasFields ||
- tmuxCommands.length > 0 ||
+ commandRows.length > 0 ||
+ usage.length > 0 ||
catalogEntries.length > 0 ||
elsewhere.length > 0
---
@@ -672,13 +679,21 @@ const hasBody =
)
}
- {tmuxCommands.length > 0 &&
Look up the flags and behavior supported by tmux {reference.version}. Choose the version installed on your machine with tmux -V.
diff --git a/site/src/pages/tmux/[version]/reference/[...slug].md.ts b/site/src/pages/tmux/[version]/reference/[...slug].md.ts
index 8575c2d3d..0c769f8a2 100644
--- a/site/src/pages/tmux/[version]/reference/[...slug].md.ts
+++ b/site/src/pages/tmux/[version]/reference/[...slug].md.ts
@@ -2,7 +2,7 @@ import type { APIRoute } from 'astro'
import { sourceUrl } from '@libtmux/api-model'
import { symbolMarkdownWithLayout } from '../../../../lib/symbol-markdown'
import { tmuxCatalogLinksForSource } from '../../../../lib/tmux-catalog'
-import { tmuxReferenceIndex, tmuxReferencePaths, tmuxReferenceRoutes, tmuxReferenceUrl, tmuxSourceCommands, tmuxSourceModel } from '../../../../lib/tmux-reference'
+import { tmuxReferenceContext, tmuxReferenceIndex, tmuxReferencePaths, tmuxReferenceRoutes, tmuxReferenceUrl, tmuxSourceCommands, tmuxSourceModel } from '../../../../lib/tmux-reference'
export function getStaticPaths() {
return tmuxReferenceRoutes().filter(({ symbol }) => symbol).map(({ version, symbol }) => ({
@@ -18,6 +18,7 @@ export const GET: APIRoute = async ({ props, site }) => {
source: sourceUrl(model, symbol),
hrefFor: (entry) => tmuxReferenceUrl(version, entry),
manualLinks: tmuxSourceCommands(version, symbol),
+ usage: tmuxReferenceContext(version, symbol).usage,
catalogLinks: tmuxCatalogLinksForSource(version, symbol.name),
paths: tmuxReferencePaths(version),
}), { headers: { 'Content-Type': 'text/markdown; charset=utf-8' } })
diff --git a/site/src/styles/api.css b/site/src/styles/api.css
index 183c11915..12a4961b7 100644
--- a/site/src/styles/api.css
+++ b/site/src/styles/api.css
@@ -179,6 +179,11 @@ dl.gp-sphinx-api-container > dt.gp-sphinx-api-header:only-child {
opacity: 0.6;
}
+/* A method that sends a tmux command names the flag and the C function behind it. */
+.tmux-send { margin-inline-start: 0.25rem; }
+.tmux-send > * + * { margin-inline-start: 0.25rem; }
+.tmux-usage-block { margin-block-start: 0.75rem; }
+
/*
* The member list on a type's page.
*
diff --git a/site/src/styles/kind-marks.css b/site/src/styles/kind-marks.css
index 49baf2934..3e5a8768b 100644
--- a/site/src/styles/kind-marks.css
+++ b/site/src/styles/kind-marks.css
@@ -219,7 +219,7 @@
*/
@property --sp-h { syntax: ''; inherits: true; initial-value: 0px; }
@property --sp-pb { syntax: ''; inherits: true; initial-value: 0px; }
-:is(.api-elsewhere-value, .api-command-related, nav.api-related) a:has(> .api-nav__kind) {
+:is(.api-elsewhere-value, .api-command-related, .tmux-usage, nav.api-related) a:has(> .api-nav__kind) {
--sp-h: round(1.6em, 2px);
--sp-pb: round(calc((var(--sp-h) - 2px - .875 * 1cap) / 2), var(--mark-step));
display: inline-flex;
@@ -238,7 +238,7 @@
background: color-mix(in srgb, var(--color-foreground-primary, currentColor) 4%, transparent);
text-decoration: none;
}
-:is(.api-elsewhere-value, .api-command-related, nav.api-related) a > .api-nav__kind {
+:is(.api-elsewhere-value, .api-command-related, .tmux-usage, nav.api-related) a > .api-nav__kind {
--mk-w: 1.6em; --mk-bwv: 0px;
--mk-fill: color-mix(in srgb, var(--mk-hue, currentColor) 18%, var(--background-color, transparent));
/* The mark is one line tall and stays on the first line, however many lines the name takes. */
@@ -250,7 +250,7 @@
border-inline-end: 1px solid color-mix(in srgb, var(--mk-hue, currentColor) 30%, transparent);
border-radius: 0;
}
-:is(.api-elsewhere-value, .api-command-related, nav.api-related) a > .api-nav__kind + code {
+:is(.api-elsewhere-value, .api-command-related, .tmux-usage, nav.api-related) a > .api-nav__kind + code {
/*
* The last line's baseline keeps its gap from the bottom edge. The top margin reserves exactly the space the first
* line has in a one-line chip (a hair less, so a single line never grows it), so the first line sits level with
@@ -268,9 +268,9 @@
text-decoration: none;
}
@supports not (text-box: trim-both cap alphabetic) {
- :is(.api-elsewhere-value, .api-command-related, nav.api-related) a > .api-nav__kind + code { margin: 0 0 var(--sp-pb); line-height: 1; }
+ :is(.api-elsewhere-value, .api-command-related, .tmux-usage, nav.api-related) a > .api-nav__kind + code { margin: 0 0 var(--sp-pb); line-height: 1; }
}
-:is(.api-elsewhere-value, .api-command-related, nav.api-related) a:has(> .api-nav__kind):is(:hover, :focus-visible) {
+:is(.api-elsewhere-value, .api-command-related, .tmux-usage, nav.api-related) a:has(> .api-nav__kind):is(:hover, :focus-visible) {
background: color-mix(in srgb, var(--color-foreground-primary, currentColor) 9%, transparent);
}
/* In the contents column each chip is its own row: as wide as its content, with an even gap between rows. */
diff --git a/site/test/tmux-library-usage.test.ts b/site/test/tmux-library-usage.test.ts
new file mode 100644
index 000000000..216772a99
--- /dev/null
+++ b/site/test/tmux-library-usage.test.ts
@@ -0,0 +1,314 @@
+import { readFileSync } from 'node:fs'
+import { experimental_AstroContainer } from 'astro/container'
+import { Window } from 'happy-dom'
+import { afterEach, describe, expect, it } from 'vitest'
+import { documentProblems } from '../../scripts/gen-tmux-usage.mjs'
+import { API_MODELS } from '../src/lib/api-models'
+import { PORTS } from '../src/lib/ports'
+import { symbolMarkdown } from '../src/lib/symbol-markdown'
+import { tmuxApiLinks, tmuxCommandsFor, tmuxManualHeadings, tmuxManualUrl } from '../src/lib/tmux-manual-data'
+import { TMUX_USAGE, tmuxScopes, tmuxUsage, tmuxUsageOf } from '../src/lib/tmux-library-usage'
+import {
+ tmuxCommandRows, tmuxCommandSources, tmuxReferenceContext, tmuxReferenceIndex, tmuxReferenceUrl, tmuxResolvedUsage, tmuxSourceModel, tmuxSymbolSends,
+} from '../src/lib/tmux-reference'
+import { loadAstroTemplate, renderAstroTemplate, withoutScope } from './astro-templates'
+
+const windows: Window[] = []
+afterEach(async () => { for (const win of windows.splice(0)) await win.happyDOM.abort() })
+const dom = (html: string) => {
+ const win = new Window()
+ windows.push(win)
+ win.document.body.innerHTML = html
+ return win.document
+}
+
+const scopeTable = JSON.parse(readFileSync(new URL('../src/data/tmux-usage/scopes.json', import.meta.url), 'utf8'))
+const usage = tmuxUsage('list-panes')!
+/** What a port lists at one scope of list-panes. */
+const cell = (scope: string, port: string) => usage.groups.find((group) => group.scope?.id === scope)!.ports.find((entry) => entry.port === port)?.links.map((link) => link.label)
+
+describe('the recorded usage', () => {
+ it.each(PORTS.map((port) => port.slug))('is bound to the pinned API model of %s', (slug) => {
+ expect(documentProblems(TMUX_USAGE[slug], API_MODELS[slug], scopeTable, ['list-panes'])).toEqual([])
+ })
+
+ it('names the methods that send list-panes at each scope, where the ports differ in design', () => {
+ expect(cell('server', 'swift')).toEqual(['Server.panes()', 'Server.panes(where:)'])
+ expect(cell('server', 'py')).toEqual(['Server.panes', 'Server.search_panes'])
+ expect(cell('session', 'py')).toEqual(['Session.panes', 'Session.search_panes'])
+ expect(cell('window', 'cxx')).toEqual(['Window::panes'])
+ expect(cell('server', 'ruby')).toEqual(['Server#list_panes'])
+ expect(cell('window', 'go')).toEqual(['Window.SearchPanes'])
+ // A snapshot-based port sends the command in its snapshot call.
+ expect(cell('server', 'ts')).toEqual(['Server.snapshot'])
+ expect(cell('server', 'lua')).toEqual(['Server:snapshot'])
+ // A wrapper stands on the library it calls.
+ expect(cell('server', 'powershell')).toEqual(['Get-TmuxPane'])
+ expect(cell('window', 'powershell')).toEqual(['Get-TmuxPane'])
+ })
+
+ it('leaves out a method that reads a capture instead of sending the command', () => {
+ // Go documents Session.Panes and Window.Panes as never querying tmux; the search methods send it.
+ expect(cell('session', 'go')).toEqual(['Session.SearchPanes'])
+ expect(cell('window', 'go')).not.toContain('Window.Panes')
+ // TypeScript and Swift read sessions and windows from a captured snapshot.
+ expect(cell('session', 'ts')).toBeUndefined()
+ expect(cell('window', 'ts')).toBeUndefined()
+ expect(cell('session', 'swift')).toBeUndefined()
+ // Kotlin, Scala and F# have no method of their own that sends it.
+ for (const port of ['kotlin', 'scala', 'fsharp']) {
+ for (const scope of ['server', 'session', 'window']) expect(cell(scope, port)).toBeUndefined()
+ }
+ })
+
+ it('lists the object that owns the scope before a method that sends the command for its own purpose', () => {
+ expect(cell('window', 'py')).toEqual(['Window.panes', 'Window.search_panes', 'Pane.from_pane_id'])
+ expect(cell('session', 'rs')).toEqual(['Session.panes', 'ControlSender.watch_only'])
+ })
+
+ it('lists the ports in the order the site lists them', () => {
+ const order = PORTS.map((port) => port.slug)
+ for (const group of usage.groups) {
+ const slugs = group.ports.map((entry) => entry.port)
+ expect(slugs).toEqual(order.filter((slug) => slugs.includes(slug)))
+ }
+ })
+
+ it('keeps a call through a helper with the method and off the command pages', () => {
+ const go = tmuxUsageOf('go', 'tmux.Pane.Select')
+ expect(go).toHaveLength(1)
+ expect(go[0].scopes[0]).toMatchObject({ hops: 1, evidence: ['tmux/lookup.go:371', 'tmux/window_pane_topology.go:199'] })
+ expect(usage.groups.flatMap((group) => group.ports).flatMap((entry) => entry.links).map((link) => link.symbolId)).not.toContain('tmux.Pane.Select')
+ })
+
+ it('links every method to its own page', () => {
+ for (const link of usage.groups.flatMap((group) => group.ports).flatMap((entry) => entry.links)) {
+ expect(link.href).toMatch(new RegExp(`/${link.port}/[^/]+/reference/[^/]+/$`))
+ expect(link.evidence[0]).toMatch(/^[^:]+:\d+$/)
+ }
+ })
+
+ it('has no usage for a command it has not recorded', () => {
+ expect(tmuxUsage('kill-pane')).toBeUndefined()
+ expect(tmuxScopes('kill-pane')).toEqual([])
+ expect(tmuxUsageOf('py', 'libtmux.Pane.kill')).toEqual([])
+ })
+})
+
+describe('from a method to the command and its C function', () => {
+ it('names the scope and links the manual page and the C function behind it', () => {
+ const [send] = tmuxSymbolSends('swift', 'Server.panes()')
+ expect(send.command).toBe('list-panes')
+ expect(send.manualHref).toBe(tmuxManualUrl('latest', 'list-panes'))
+ expect(send.scopes.map((use) => [use.scope?.id, use.function?.name, use.function?.href])).toEqual([
+ ['server', 'cmd_list_panes_server', '/tmux/latest/reference/c-function-cmd-list-panes-c-cmd_list_panes_server/'],
+ ])
+ })
+
+ it('gives a cmdlet that lists at three scopes one row with all three', () => {
+ const [send] = tmuxSymbolSends('powershell', 'LibTmux\\Get-TmuxPane')
+ expect(send.scopes.map((use) => use.scope?.id)).toEqual(['server', 'session', 'window'])
+ expect(send.scopes.every((use) => use.via?.port === 'csharp')).toBe(true)
+ })
+
+ it('does not link a method that only reads a capture, whatever the concepts call it equivalent to', () => {
+ // The concept map names Window.Panes the Go equivalent of list-panes.
+ expect(tmuxSymbolSends('go', 'tmux.Window.Panes')).toEqual([])
+ expect(tmuxCommandsFor('go', 'tmux.Window.Panes').map((command) => command.name)).not.toContain('list-panes')
+ expect(tmuxCommandsFor('ts', 'window.Window.panes').map((command) => command.name)).not.toContain('list-panes')
+ // A command whose usage is not recorded keeps its concept link.
+ expect(tmuxCommandsFor('ts', 'pane.Pane.capture').map((command) => command.name)).toEqual(['capture-pane'])
+ })
+
+ it('names what the method sends before its equivalents, and what it sends through a helper last', () => {
+ const plain = [{ name: 'send-keys', href: tmuxManualUrl('latest', 'send-keys') }]
+ const rows = tmuxCommandRows(tmuxSymbolSends('java', 'io.github.libtmux.Pane.Pane.sendKeys'), plain)
+ expect(rows.map((row) => row.command)).toEqual(['send-keys', 'list-panes'])
+ expect(tmuxCommandRows(tmuxSymbolSends('py', 'libtmux.Server.panes'), plain).map((row) => row.command)).toEqual(['list-panes', 'send-keys'])
+ expect(tmuxCommandRows([], plain).map((row) => row.scopes)).toEqual([[]])
+ })
+
+ it('lists the call through a helper with the method it belongs to', () => {
+ const [send] = tmuxSymbolSends('go', 'tmux.Pane.Select')
+ expect(send.scopes[0]).toMatchObject({ hops: 1, function: { name: 'cmd_list_panes_window' } })
+ })
+})
+
+describe.each(['3.7c', '3.2a'])('the C pages of tmux %s', (version) => {
+ const model = tmuxSourceModel(version)
+ const symbolNamed = (name: string) => model.symbols.find((symbol) => symbol.name === name)!
+ const pagesOf = (name: string) => tmuxReferenceContext(version, symbolNamed(name))
+
+ it.each(['cmd_list_panes_entry', 'cmd_list_panes_exec'])('lists every scope on %s', (name) => {
+ const context = pagesOf(name)
+ expect(context.manualLinks.map((link) => link.name)).toEqual(['list-panes'])
+ expect(context.usage).toHaveLength(1)
+ expect(context.usage[0].groups.map((group) => [group.scope?.id, group.function?.name])).toEqual([
+ ['server', 'cmd_list_panes_server'], ['session', 'cmd_list_panes_session'], ['window', 'cmd_list_panes_window'],
+ ])
+ expect(context.usage[0].groups.map((group) => group.function?.href)).toEqual(
+ ['server', 'session', 'window'].map((scope) => tmuxReferenceUrl(version, symbolNamed(`cmd_list_panes_${scope}`))),
+ )
+ })
+
+ it.each(['server', 'session', 'window'])('lists only the %s scope on its function', (scope) => {
+ const context = pagesOf(`cmd_list_panes_${scope}`)
+ expect(context.manualLinks.map((link) => link.name)).toEqual(['list-panes'])
+ expect(context.usage[0].groups.map((group) => group.scope?.id)).toEqual([scope])
+ const symbolIds = context.usage[0].groups[0].ports.flatMap((entry) => entry.links.map((link) => link.symbolId))
+ expect(symbolIds).toContain({ server: 'libtmux.Server.panes', session: 'libtmux.Session.panes', window: 'libtmux.Window.panes' }[scope])
+ // The other scopes' methods are not on this page.
+ const others = { server: 'libtmux.Window.panes', session: 'libtmux.Server.panes', window: 'libtmux.Session.panes' }[scope]
+ expect(symbolIds).not.toContain(others)
+ })
+
+ it('offers a scope page only the languages that send the command at that scope', () => {
+ const picker = (name: string) => pagesOf(name).pagePorts.filter((entry) => entry.links.length).map((entry) => entry.port)
+ expect(picker('cmd_list_panes_session')).not.toContain('ts')
+ expect(picker('cmd_list_panes_session')).toContain('py')
+ // The command's own pages still land every language somewhere.
+ expect(picker('cmd_list_panes_exec')).toEqual(PORTS.map((port) => port.slug))
+ })
+
+ it('links the command to every function that lists panes', () => {
+ expect(tmuxCommandSources(version, 'list-panes').map((entry) => entry.name)).toEqual([
+ 'cmd_list_panes_entry', 'cmd_list_panes_exec', 'cmd_list_panes_server', 'cmd_list_panes_session', 'cmd_list_panes_window',
+ ])
+ expect(tmuxCommandSources(version, 'capture-pane').map((entry) => entry.name)).toHaveLength(2)
+ })
+
+ it('writes the same lists into the Markdown of the page', () => {
+ const symbol = symbolNamed('cmd_list_panes_session')
+ const context = pagesOf('cmd_list_panes_session')
+ const text = symbolMarkdown({ model, symbol, version, index: tmuxReferenceIndex(version), hrefFor: (entry) => tmuxReferenceUrl(version, entry),
+ manualLinks: context.manualLinks, usage: context.usage })
+ expect(text).toContain(`tmux command: [\`list-panes\`](${tmuxManualUrl(version, 'list-panes')})`)
+ expect(text).toMatch(/- Session `-s` \(\[`cmd_list_panes_session`\]\([^)]+\)\): .*Python: \[`Session\.panes`\]\(\/py\//)
+ expect(text).not.toContain('Server.panes')
+ })
+})
+
+describe('the manual page of a command', () => {
+ it('keeps one language picker entry per language and the section heading', () => {
+ const links = tmuxApiLinks('list-panes')
+ expect(links.map((entry) => entry.name)).toEqual(expect.arrayContaining(['Python', 'Swift', 'Kotlin', 'Scala', 'F#']))
+ expect(new Set(links.map((entry) => entry.name)).size).toBe(links.length)
+ // The widest scope a language has, so Python opens at the server's panes.
+ expect(links.find((entry) => entry.name === 'Python')!.href).toBe(cellHref('server', 'py', 'libtmux.Server.panes'))
+ expect(tmuxManualHeadings('latest', 'list-panes').map((heading) => heading.slug)).toContain('list-panes-use-from-a-library')
+ })
+
+ function cellHref(scope: string, port: string, id: string) {
+ return usage.groups.find((group) => group.scope?.id === scope)!.ports.find((entry) => entry.port === port)!.links.find((link) => link.symbolId === id)!.href
+ }
+})
+
+describe('the rendered lists', () => {
+ async function render(props: Record) {
+ const template = await loadAstroTemplate('components/tmux/TmuxUsage.astro', { real: ['components/api/ApiBadge.astro', 'components/api/SymbolName.astro'] })
+ return dom(withoutScope(await renderAstroTemplate(template, { props })))
+ }
+
+ it('shows a column for each scope, headed by its flag and the C function', async () => {
+ const document = await render({ usage: tmuxResolvedUsage('latest', 'list-panes') })
+ const headers = [...document.querySelectorAll('thead th')].map((th) => th.textContent!.replace(/\s+/g, ' ').trim())
+ expect(headers).toEqual(['Language', 'Server -a cmd_list_panes_server', 'Session -s cmd_list_panes_session', 'Window -t cmd_list_panes_window'])
+ expect([...document.querySelectorAll('thead a')].map((a) => a.getAttribute('href'))).toEqual(
+ ['server', 'session', 'window'].map((scope) => `/tmux/latest/reference/c-function-cmd-list-panes-c-cmd_list_panes_${scope}/`))
+ })
+
+ it('shows one row per language, in site order, with a kind mark and a link in each filled cell', async () => {
+ const document = await render({ usage: tmuxResolvedUsage('latest', 'list-panes') })
+ const rows = [...document.querySelectorAll('tbody tr')]
+ const order = PORTS.map((port) => port.slug)
+ const slugs = rows.map((row) => row.getAttribute('data-port')!)
+ expect(slugs).toEqual(order.filter((slug) => slugs.includes(slug)))
+ expect(slugs).not.toContain('kotlin')
+ const swift = rows.find((row) => row.getAttribute('data-port') === 'swift')!
+ const cells = [...swift.querySelectorAll('td')]
+ expect(cells.map((td) => [...td.querySelectorAll('a')].map((a) => a.textContent!.replace(/\s+/g, ''))))
+ .toEqual([['mServer.panes()', 'mServer.panes(where:)'], [], []])
+ expect(cells[0].querySelector('a')!.getAttribute('href')).toMatch(/\/swift\/[^/]+\/reference\/server-panes\(\)\/$/)
+ expect(cells[1].className).toContain('tmux-usage__empty')
+ })
+
+ it('names the languages that have no method of their own to list', async () => {
+ const document = await render({ usage: tmuxResolvedUsage('latest', 'list-panes') })
+ expect(document.querySelector('.tmux-usage__absent')!.textContent).toBe('No method in Kotlin, Scala, or F# sends this command itself.')
+ const windowPage = await render({ usage: tmuxResolvedUsage('latest', 'list-panes', 'window') })
+ expect(windowPage.querySelector('.tmux-usage__absent')!.textContent).toMatch(/^No method in Lua, Julia, TypeScript, .*sends this command at this scope itself\.$/)
+ // The control: a command that every language sends has no such line.
+ const everyone = tmuxResolvedUsage('latest', 'list-panes')!
+ const full = { ...everyone, groups: everyone.groups.map((group) => ({ ...group, ports: PORTS.map((port) => ({
+ port: port.slug, name: port.name, links: group.ports[0].links })) })) }
+ expect((await render({ usage: full })).querySelector('.tmux-usage__absent')).toBeNull()
+ })
+
+ it('renders only the scope asked for on a scope page', async () => {
+ const document = await render({ usage: tmuxResolvedUsage('latest', 'list-panes', 'window') })
+ expect([...document.querySelectorAll('thead th')].map((th) => th.textContent!.replace(/\s+/g, ' ').trim()))
+ .toEqual(['Language', 'Window -t cmd_list_panes_window'])
+ expect(document.querySelectorAll('tbody tr').length).toBeGreaterThan(0)
+ expect(document.body.textContent).not.toContain('Server.panes')
+ })
+
+ it('adds the command, flag and C function to the method page', async () => {
+ const source = readFileSync(new URL('../src/components/api/ApiEntry.astro', import.meta.url), 'utf8')
+ const start = source.indexOf('{commandRows.length > 0 &&
)}', source.indexOf('{usage.map(', start)) + ')}'.length
+ expect(start).toBeGreaterThan(0)
+ expect(end).toBeGreaterThan(start)
+ const stub = `---\nimport TmuxUsage from '../tmux/TmuxUsage.astro'\nconst { commandRows, usage } = Astro.props\n---\n${source.slice(start, end)}`
+ const template = await loadAstroTemplate('components/api/ApiEntry.astro', {
+ real: ['components/tmux/TmuxUsage.astro', 'components/api/ApiBadge.astro', 'components/api/SymbolName.astro'], stubs: { 'components/api/ApiEntry.astro': stub },
+ })
+ const html = (props: Record) => renderAstroTemplate(template, { props: { commandRows: [], usage: [], ...props } }).then((text) => dom(withoutScope(text)))
+
+ const method = await html({ commandRows: tmuxCommandRows(tmuxSymbolSends('swift', 'Server.panes()'), []) })
+ expect(method.querySelector('.gp-sphinx-api-mentions')!.textContent!.replace(/\s+/g, ' ').trim()).toBe('tmux command list-panes -a cmd_list_panes_server')
+ expect([...method.querySelectorAll('.gp-sphinx-api-mentions a')].map((a) => a.getAttribute('href'))).toEqual([
+ '/tmux/latest/manual/list-panes/', '/tmux/latest/reference/c-function-cmd-list-panes-c-cmd_list_panes_server/',
+ ])
+
+ // A reader of a method that does not send the command sees no row for it.
+ const reader = await html({ commandRows: tmuxCommandRows(tmuxSymbolSends('go', 'tmux.Window.Panes'), []) })
+ expect(reader.querySelector('.gp-sphinx-api-mentions')).toBeNull()
+
+ const declaration = await html({ usage: [tmuxResolvedUsage('latest', 'list-panes', 'session')] })
+ expect(declaration.querySelector('.tmux-usage-block .gp-sphinx-api-mentions-label')!.textContent).toBe('In libtmux')
+ expect(declaration.querySelectorAll('.tmux-usage table').length).toBe(1)
+ })
+})
+
+describe('the manual page', () => {
+ async function page(slug: string) {
+ const template = await loadAstroTemplate('pages/tmux/[version]/manual/[...slug].astro', {
+ real: ['components/tmux/TmuxUsage.astro', 'components/api/ApiBadge.astro', 'components/api/SymbolName.astro', 'components/SectionHeading.astro'],
+ // Neither the code highlighter nor the content collection runs outside a build.
+ modules: {
+ 'astro-expressive-code/components': { Code: Object.assign(() => '', { isAstroComponentFactory: true }) },
+ '../../../../lib/page-ports-for': { pagePortsFor: async () => [] },
+ },
+ })
+ const container = await experimental_AstroContainer.create({ astroConfig: { site: 'https://libtmux.org' } } as never)
+ return dom(withoutScope(await container.renderToString(template as never, { request: new Request('https://libtmux.org/'), params: { version: 'latest', slug } })))
+ }
+
+ it('lists the methods that send list-panes by scope, and every function that implements it', async () => {
+ const document = await page('list-panes')
+ expect(document.querySelector('h2#list-panes-use-from-a-library')).not.toBeNull()
+ // The heading keeps its earlier anchor, so a link to it still lands.
+ expect(document.querySelector('#libraries')).not.toBeNull()
+ expect(document.querySelectorAll('.tmux-usage table').length).toBe(1)
+ expect(document.querySelector('.tmux-usage tr[data-port="swift"] a')!.getAttribute('href')).toMatch(/\/swift\/[^/]+\/reference\/server-panes\(\)\/$/)
+ expect([...document.querySelectorAll('h2#list-panes-implementation + p + ul a')].map((a) => a.textContent)).toEqual([
+ 'cmd_list_panes_entry', 'cmd_list_panes_exec', 'cmd_list_panes_server', 'cmd_list_panes_session', 'cmd_list_panes_window',
+ ])
+ })
+
+ it('keeps the plain list for a command whose usage is not recorded', async () => {
+ const document = await page('capture-pane')
+ expect(document.querySelector('.tmux-usage')).toBeNull()
+ expect([...document.querySelectorAll('h2#capture-pane-use-from-a-library ~ ul a')].map((a) => a.textContent)).toContain('Python')
+ })
+})
From 2862bf71a2e462847673bb40ba62f60f7e4ac0c6 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Mon, 19 Oct 2026 20:37:44 -0500
Subject: [PATCH 07/53] fix(site[tmux-usage]) Stack usage chips flush and put
In libtmux last
why: In the usage table every chip after the first sat 0.4rem to the
right of it, and a long name such as Server.CaptureSnapshotAsync wrapped
inside a chip of fixed height and spilled over the next line. The
maintainer also wants In libtmux at the very bottom of each page: on a C
page it sat in the declaration card above the call neighborhood.
what:
- Stack the chips of a cell in a column, flush, with one gap, and keep
each name on one line; a table wider than its column scrolls inside
it, and below 50rem of container width each language becomes its own
block, so the table stacks at 1024 and 390 wide and not by viewport
- Keep td out of the block rule of the stacked layout and give rows
their own grid, so the stacked rules cannot tie on specificity
- Move In libtmux out of the declaration card into its own section with
a heading and permalink after Related types, listed last in the
section links and On this page, and last in the Markdown export; the
card keeps its tmux command line
- Test the stylesheet for the indent, the wrap and the missing scroll
with a control built from the old rules, and test that the section is
last on the C pages and that Use from a library is last on the manual
page
Verified in the browser on the served manual page with the new rules
applied, at 1440, 1024 and 390 wide in light and dark: chips flush with
a 6px gap, none clipped or overlapping, no page overflow, and the table
stacks below 800px of container width. The served dev server did not
reload the changed sources, so the C page move is checked through the
Astro container render and not in the browser.
---
site/src/components/api/ApiEntry.astro | 12 +-
site/src/components/api/ApiReference.astro | 12 +-
site/src/components/tmux/TmuxUsage.astro | 17 ++-
site/src/lib/symbol-markdown.ts | 8 +-
site/src/styles/api.css | 3 +-
site/test/tmux-library-usage.test.ts | 165 +++++++++++++++++++--
6 files changed, 182 insertions(+), 35 deletions(-)
diff --git a/site/src/components/api/ApiEntry.astro b/site/src/components/api/ApiEntry.astro
index b8d576ee1..ef23d256d 100644
--- a/site/src/components/api/ApiEntry.astro
+++ b/site/src/components/api/ApiEntry.astro
@@ -15,8 +15,7 @@ import ApiType from './ApiType.astro'
import { asideFor } from '../../lib/aside'
import { apiCommandFacts, apiCommandRelatedLinks, apiEntryFields, apiMethodDetails, anonymousDeclarationLabel, nativeSignatureText as unformattedNativeSignatureText, parameterBindingText, usesNativeSignatures } from '../../lib/api-sections'
import { tmuxCommandsFor, tmuxManualUrl } from '../../lib/tmux-manual-data'
-import { tmuxCommandRows, tmuxSymbolSends, type ResolvedUsage } from '../../lib/tmux-reference'
-import TmuxUsage from '../tmux/TmuxUsage.astro'
+import { tmuxCommandRows, tmuxSymbolSends } from '../../lib/tmux-reference'
import { CATALOG_KINDS, tmuxCatalogKindsForSymbol, tmuxCatalogUrl } from '../../lib/tmux-catalog'
import ApiFieldOverloads from './ApiFieldOverloads.astro'
import ApiCommandParameters from './ApiCommandParameters.astro'
@@ -46,8 +45,6 @@ interface Props {
/** Declaration syntax, independent of library-port identity. */
language?: string
manualLinks?: { name: string; href: string }[]
- /** The library methods that send the command a C declaration implements. */
- usage?: ResolvedUsage[]
/** Catalog pages for a declaration in a source reference. */
catalogLinks?: { name: string; href: string }[]
/** Override equivalent links for a product or version context. */
@@ -80,7 +77,7 @@ interface Props {
/** Previous fragment for the same declaration. */
legacyId?: string
}
-const { symbol, index, sourceUrl, port, language = port, manualLinks, usage = [], catalogLinks, alternativesFor, heading = false, member = false,
+const { symbol, index, sourceUrl, port, language = port, manualLinks, catalogLinks, alternativesFor, heading = false, member = false,
showSummary = true, showBases = true, legacyId, nameHref } = Astro.props as Props
const anchor = symbol.publicId ?? symbol.id
const kind = symbol.kind
@@ -282,7 +279,6 @@ const hasBody =
methods.length > 0 ||
hasFields ||
commandRows.length > 0 ||
- usage.length > 0 ||
catalogEntries.length > 0 ||
elsewhere.length > 0
---
@@ -690,10 +686,6 @@ const hasBody =
>)}
>)}
}
- {usage.map((entry) =>
- In libtmux
-
-
)}
{catalogEntries.length > 0 &&
tmux catalog
{catalogEntries.map((entry, i) => <>
diff --git a/site/src/components/api/ApiReference.astro b/site/src/components/api/ApiReference.astro
index 51acf029b..f26de4efa 100644
--- a/site/src/components/api/ApiReference.astro
+++ b/site/src/components/api/ApiReference.astro
@@ -38,6 +38,7 @@ import '../../styles/api.css'
import '../../styles/vendor/gp-sphinx-api.css'
import { tmuxManualUrl } from '../../lib/tmux-manual-data'
import type { ResolvedUsage } from '../../lib/tmux-reference'
+import TmuxUsage from '../tmux/TmuxUsage.astro'
/** Source projects supply identity and navigation to the same API renderer. */
export interface SourceReferenceContext {
@@ -369,6 +370,9 @@ const related = owner ? relatedApiTypes(owner, members, index, declaringType, {
identity: qualifiedNameOf(symbol), kind: symbol.kind, href: hrefFor(symbol), symbol,
})) : []
if (related.length) pageSections.push({ id: 'api-related-types', label: 'Related types', count: related.length })
+// The methods that send the command are what a reader of the C needs last, after the code around it.
+const usage = source?.usage ?? []
+if (owner && usage.length) pageSections.push({ id: 'api-tmux-usage', label: 'In libtmux' })
const title = glossary ? API_GLOSSARY_TITLE : owner
? qualifiedNameOf(owner)
: model
@@ -761,7 +765,6 @@ const bases = owner && 'extends' in owner ? owner.extends ?? [] : []
port={port}
language={language}
manualLinks={source?.manualLinks}
- usage={source?.usage}
catalogLinks={source?.catalogLinks}
heading={isMemberOwner(owner)}
member={!isMemberOwner(owner)}
@@ -842,6 +845,13 @@ const bases = owner && 'extends' in owner ? owner.extends ?? [] : []
)}
}
+ {usage.length > 0 &&
+
}'.length
+ const stub = `---\nconst { commandRows } = Astro.props\n---\n${source.slice(start, end)}`
+ const entry = await loadAstroTemplate('components/api/ApiEntry.astro', { stubs: { 'components/api/ApiEntry.astro': stub } })
+ const rows = tmuxCommandRows(tmuxSymbolSends('kotlin', 'io.github.libtmux.kotlin.Pane.sendKeys'), []).filter((row) => row.scopes.length)
+ expect(rows.length).toBeGreaterThan(0)
+ const page = await renderAstroTemplate(entry, { props: { commandRows: rows } }).then((text) => dom(withoutScope(text)))
+ const titles = [...page.querySelectorAll('.tmux-send')].map((send) => send.getAttribute('title'))
+ expect(titles.length).toBeGreaterThan(0)
+ // The entry's own first line is the generator's template; the line that sends is the Java one the entry stands on.
+ for (const title of titles) expect(title).toMatch(/^Calls io\.github\.libtmux\.Pane\.Pane\.sendKeys: libtmux\/src\/main\/java\/.*\/Pane\.java:\d+$/)
+ })
+
it('cannot render a conditional entry without its qualifier, on a command page or a method page', async () => {
const source = readFileSync(new URL('../src/components/api/ApiEntry.astro', import.meta.url), 'utf8')
const start = source.indexOf('{commandRows.length > 0 &&
{
const rendered = [...html!.querySelectorAll(`tbody tr[data-port="${port}"] .tmux-usage__item`)].filter((item) => item.querySelector('.tmux-usage__when')?.textContent === use.when)
expect(rendered.length, `${port} ${symbol} ${command} renders ${use.when}`).toBeGreaterThan(0)
}
- const row = tmuxCommandRows(tmuxSymbolSends(port, symbol), []).find((candidate) => candidate.command === command)
- expect(row?.when, `${port} ${symbol} ${command} row`).toBeTruthy()
- const page = renderAstroTemplate(entry, { props: { commandRows: [row] } }).then((text) => dom(withoutScope(text)))
- expect((await page).querySelector('.tmux-when')?.textContent, `${port} ${symbol} ${command} page`).toBeTruthy()
+ const row = tmuxCommandRows(tmuxSymbolSends(port, symbol), []).find((candidate) => candidate.command === command)!
+ // The row carries this use's own condition: all of the command's scopes share it, or its scope says it.
+ const own = row.when ?? row.scopes.find((candidate) => candidate.scope?.id === use.scope)?.when ?? (row.scopes.length === 0 ? undefined : '')
+ expect(own, `${port} ${symbol} ${command} row`).toBe(use.when)
+ const page = await renderAstroTemplate(entry, { props: { commandRows: [row] } }).then((text) => dom(withoutScope(text)))
+ expect([...page.querySelectorAll('.tmux-when')].map((element) => element.textContent), `${port} ${symbol} ${command} page`).toContain(use.when)
}
}
// The control: a row whose use carries no qualifier renders none.
+ // A command sent at two scopes under two conditions says each condition beside its own scope, and not the first for both.
+ const fsharp = tmuxCommandRows(tmuxSymbolSends('fsharp', 'LibTmux.FSharp.Server.newSession'), []).find((row) => row.command === 'list-panes')!
+ expect(fsharp.when).toBeUndefined()
+ expect(fsharp.scopes.map((use) => [use.scope?.id, use.when])).toEqual([['session', 'the spec names a first window'], ['window', 'the spec has more than one window']])
+ const twice = await renderAstroTemplate(entry, { props: { commandRows: [fsharp] } }).then((text) => dom(withoutScope(text)))
+ expect([...twice.querySelectorAll('.tmux-send')].map((send) => send.querySelector('.tmux-when')?.textContent)).toEqual(['the spec names a first window', 'the spec has more than one window'])
+ expect(sharedWhen({ scopes: [{ when: 'a' }, { when: 'a' }] as never })).toBe('a')
+ expect(sharedWhen({ scopes: [{ when: 'a' }, { when: 'b' }] as never })).toBeUndefined()
+ expect(sharedWhen({ scopes: [{ when: 'a' }, {}] as never })).toBeUndefined()
const plain = tmuxCommandRows(tmuxSymbolSends('swift', 'Server.panes()'), [])
expect(plain.every((row) => row.when === undefined)).toBe(true)
expect((await renderAstroTemplate(entry, { props: { commandRows: plain } }).then((text) => dom(withoutScope(text)))).querySelector('.tmux-when')).toBeNull()
diff --git a/site/test/tmux-usage-derive.test.ts b/site/test/tmux-usage-derive.test.ts
index 64c39aba6..cf08e71c5 100644
--- a/site/test/tmux-usage-derive.test.ts
+++ b/site/test/tmux-usage-derive.test.ts
@@ -1,7 +1,7 @@
import { readFileSync } from 'node:fs'
import { beforeAll, describe, expect, it } from 'vitest'
import { scanSource } from '../../scripts/lib/tmux-usage-scan.mjs'
-import { MAX_SHARED_BY, applyConditions, applyExclusions, builtSites, callTargets, classify, conditionProblem, definitionsOf, deriveUsage, ruleHolds, verifyClaims } from '../../scripts/lib/tmux-usage-derive.mjs'
+import { MAX_SHARED_BY, applyConditions, applyExclusions, builtSites, callTargets, classify, conditionProblem, definitionsOf, deriveUsage, partialProblems, ruleHolds, verifyClaims } from '../../scripts/lib/tmux-usage-derive.mjs'
import { auditEvidence } from '../../scripts/lib/tmux-usage-audit.mjs'
import { chainProblems, dispatcherProblems, guardProblems } from '../../scripts/lib/tmux-usage-dispatch.mjs'
import { forwardUsage } from '../../scripts/lib/tmux-usage-forward.mjs'
@@ -502,7 +502,7 @@ describe('the calls that send', () => {
expect(problems('cmd', { at: 'lib.py:2', reaches })).toEqual([])
expect(problems('check_call', { at: 'lib.py:13' })).toEqual([])
// A hop the scan cannot follow, such as a command put on a queue, says where it leads.
- const queued = [{ at: 'lib.py:3', has: ['tmux_cmd'], leads: '__init__' }, { at: 'lib.py:7', has: ['subprocess.Popen('] }]
+ const queued = [{ at: 'lib.py:3', has: ['tmux_cmd'], leads: '__init__', why: 'the command goes onto a queue' }, { at: 'lib.py:7', has: ['subprocess.Popen('] }]
expect(problems('cmd', { at: 'lib.py:2', reaches: queued })).toEqual([])
})
@@ -511,7 +511,7 @@ describe('the calls that send', () => {
['a chain that stops short of the process', 'cmd', { at: 'lib.py:2', reaches: [reaches[0]] }, /hop lib.py:3 is not a transport/],
['a chain that skips the function between', 'cmd', { at: 'lib.py:2', reaches: [reaches[1]] }, /hop lib.py:7 is not in Server.cmd/],
['a hop that does not lead to the next line', 'cmd', { at: 'lib.py:2', reaches: [{ at: 'lib.py:3', has: ['tmux_cmd'], calls: 'tmux_cmd' }, { at: 'lib.py:10', has: ['row'] }] }, /leads to tmux_cmd, but lib.py:10 is not a line of it/],
- ['a hop whose function does not make the call', 'cmd', { at: 'lib.py:2', reaches: [{ at: 'lib.py:3', has: ['tmux_cmd'], calls: 'Popen' }, reaches[1]] }, /does not call Popen/],
+ ['a hop whose function does not make the call', 'cmd', { at: 'lib.py:2', reaches: [{ at: 'lib.py:3', has: ['tmux_cmd'], calls: 'Popen' }, reaches[1]] }, /leads to Popen, but lib.py:7 is not a line of it/],
['a hop whose text is not on its line', 'cmd', { at: 'lib.py:2', reaches: [{ at: 'lib.py:3', has: ['elsewhere'], calls: 'tmux_cmd' }, reaches[1]] }, /does not contain "elsewhere"/],
['a definition that is not a function of that name', 'listing', { at: 'lib.py:2', reaches }, /is not a line of a function named listing/],
['a hop that names no destination', 'cmd', { at: 'lib.py:2', reaches: [{ at: 'lib.py:3', has: ['tmux_cmd'] }, reaches[1]] }, /names neither the function it calls nor the one it leads to/],
@@ -554,6 +554,133 @@ describe('the calls that send', () => {
})
})
+describe('a chain that is resolved by the call each hop makes', () => {
+ type Source = { file: string; text: string }
+ const functionsOf = async (grammar: string, sources: Source[]) => {
+ const all: Record[] = []
+ for (const { file, text } of sources) {
+ const { functions } = await scanSource({ grammar, text, commands: new Set(['x']), known: new Set(['x']), dispatch: new Set() })
+ all.push(...functions.map((fn: object) => ({ ...fn, file })))
+ }
+ return all as unknown as Parameters[0]['functions']
+ }
+ const check = async (port: string, grammar: string, sources: Source[], name: string, item: Record) =>
+ chainProblems({
+ port, rule: { name }, item: item as never, functions: await functionsOf(grammar, sources),
+ readSource: (path: string) => sources.find((source) => source.file === path)?.text,
+ })
+
+ describe('two functions that share a name, and only one of them starts the process', () => {
+ // The shape of the Rust executors: a tracing helper called `run`, and the `run` that spawns.
+ const span = ['impl DispatchSpan {', ' fn run(self, future: F) -> DispatchFuture {', ' DispatchFuture::new(future)', ' }', '}', ''].join('\n')
+ const control = ['impl ControlModeExecutor {', ' fn execute(&self, request: CommandRequest) -> DispatchFuture {', ' let span = DispatchSpan::new(&request, "control");', ' span.run(async move { sender.send_line(line).await })', ' }', '}', ''].join('\n')
+ const subprocess = [
+ 'impl SubprocessExecutor {', // 1
+ ' async fn run(self, request: CommandRequest) {', // 2
+ ' let mut child = process.spawn();', // 3
+ ' }', // 4
+ ' fn execute(&self, request: CommandRequest) -> DispatchFuture {', // 5
+ ' DispatchSpan::new(&request, "subprocess").run(self.clone().run(request))', // 6
+ ' }', // 7
+ '}', // 8
+ '',
+ ].join('\n')
+ const sources = [{ file: 'executor.rs', text: span }, { file: 'control_executor.rs', text: control }, { file: 'subprocess.rs', text: subprocess }]
+ const hop = (at: string, over: Record = {}) => ({ at, has: [], ...over })
+
+ it('refuses a chain that goes through the tracing helper to the spawn', async () => {
+ // `span.run(...)` is DispatchSpan::run, and the spawn is in SubprocessExecutor::run, though both are `run`. Nothing names the
+ // handle for the executor, so the hop has to say what it holds, which is the reader's cue that it holds the tracing span.
+ const wrong = { at: 'control_executor.rs:2', reaches: [hop('control_executor.rs:4', { calls: 'run' }), hop('subprocess.rs:3')] }
+ expect((await check('rs', 'rust', sources, 'execute', wrong)).join('\n')).toMatch(/is a call of span\.run\(\), which resolves to no function the scan has read, and not to SubprocessExecutor\.run at subprocess\.rs:2/)
+ })
+
+ it('refuses a hop that says the call is made on a type its receiver is not', async () => {
+ const core = ['impl Core {', ' fn execute(&self, request: Request) {', ' self.executor.execute(request)', ' }', '}', 'impl Server {', ' fn cmd(&self, command: Command) {', ' self.core.execute(command)', ' }', '}', ''].join('\n')
+ const files = [...sources, { file: 'core.rs', text: core }]
+ // `core.execute` is Core::execute; the chain that goes on in the executor and skips it is not this call.
+ const skipped = { at: 'core.rs:7', reaches: [hop('core.rs:8', { calls: 'execute', on: 'SubprocessExecutor' }), hop('subprocess.rs:6', { calls: 'run', on: 'SubprocessExecutor' }), hop('subprocess.rs:3')] }
+ expect((await check('rs', 'rust', files, 'cmd', skipped)).join('\n')).toMatch(/says the call is made on a SubprocessExecutor, but its receiver resolves it to Core\.execute at core\.rs:2/)
+ const right = { at: 'core.rs:7', reaches: [hop('core.rs:8', { calls: 'execute' }), hop('core.rs:3', { leads: 'execute', why: 'a trait object' }), hop('subprocess.rs:6', { calls: 'run', on: 'SubprocessExecutor' }), hop('subprocess.rs:3')] }
+ expect(await check('rs', 'rust', files, 'cmd', right)).toEqual([])
+ })
+
+ it('accepts the call that does start it, and a hop that says what a field holds', async () => {
+ const right = { at: 'subprocess.rs:5', reaches: [hop('subprocess.rs:6', { calls: 'run', on: 'SubprocessExecutor' }), hop('subprocess.rs:3')] }
+ expect(await check('rs', 'rust', sources, 'execute', right)).toEqual([])
+ // The trait call has no receiver the scan can type, so the chain says why it leads on.
+ const trait = { at: 'control_executor.rs:2', reaches: [hop('control_executor.rs:4', { leads: 'run' }), hop('subprocess.rs:3')] }
+ expect((await check('rs', 'rust', sources, 'execute', trait)).join('\n')).toMatch(/leads to run and says nothing about why the scan cannot follow it/)
+ const said = { at: 'control_executor.rs:2', reaches: [hop('control_executor.rs:4', { leads: 'run', why: 'a trait object' }), hop('subprocess.rs:3')] }
+ expect(await check('rs', 'rust', sources, 'execute', said)).toEqual([])
+ })
+
+ it('refuses a hop whose line has no call of the name it says', async () => {
+ // Line 7 closes `execute`; it makes no call of `run`.
+ const none = { at: 'subprocess.rs:5', reaches: [hop('subprocess.rs:7', { calls: 'run' }), hop('subprocess.rs:3')] }
+ expect((await check('rs', 'rust', sources, 'execute', none)).join('\n')).toMatch(/has no call of run on that line/)
+ })
+ })
+
+ describe('overloads of one type', () => {
+ const java = [
+ 'class Server {', // 1
+ ' CommandResult cmd(List argv) {', // 2
+ ' return cmd(argv, timeout, "");', // 3
+ ' }', // 4
+ ' CommandResult cmd(ServerSnapshot snapshot, List argv) {', // 5
+ ' return fence.guarded(snapshot, argv);', // 6
+ ' }', // 7
+ ' CommandResult cmd(List argv, Duration timeout, String input) {', // 8
+ ' return starter.start(argv);', // 9
+ ' }', // 10
+ ' CommandResult run(List argv) {', // 11
+ ' return cmd(argv);', // 12
+ ' }', // 13
+ '}', // 14
+ '',
+ ].join('\n')
+ const sources = [{ file: 'ProcessTransport.java', text: java }]
+ const hop = (at: string, over: Record = {}) => ({ at, has: [], ...over })
+
+ it('takes the overload that the arguments of the call fit, and refuses the one they do not', async () => {
+ const right = { at: 'ProcessTransport.java:11', reaches: [hop('ProcessTransport.java:12', { calls: 'cmd' }), hop('ProcessTransport.java:3', { calls: 'cmd' }), hop('ProcessTransport.java:9')] }
+ expect(await check('java', 'java', sources, 'run', right)).toEqual([])
+ // `cmd(argv)` passes one argument, so it is not the `cmd(snapshot, argv)` that calls the fence.
+ const wrong = { at: 'ProcessTransport.java:11', reaches: [hop('ProcessTransport.java:12', { calls: 'cmd' }), hop('ProcessTransport.java:6')] }
+ expect((await check('java', 'java', sources, 'run', wrong)).join('\n')).toMatch(/is a call of cmd\(1\), which resolves to Server\.cmd at ProcessTransport\.java:2, and not to Server\.cmd at ProcessTransport\.java:5/)
+ })
+ })
+
+ describe('overloads told apart by their labels', () => {
+ const swift = [
+ 'struct Server {', // 1
+ ' func run(_ command: TmuxCommand) async throws -> TmuxReply {', // 2
+ ' try await run(rawArguments: command.argumentVector)', // 3
+ ' }', // 4
+ ' func run(rawArguments: [String]) async throws -> TmuxReply {', // 5
+ ' try await Subprocess.run(rawArguments)', // 6
+ ' }', // 7
+ ' func send(_ list: TmuxCommandList) async throws -> TmuxReply {', // 8
+ ' try await run(list)', // 9
+ ' }', // 10
+ '}', // 11
+ '',
+ ].join('\n')
+ const sources = [{ file: 'Sources/LibTmux/Transport.swift', text: swift }]
+ const hop = (at: string, over: Record = {}) => ({ at, has: [], ...over })
+
+ it('does not read run(rawArguments:) as the run(_:) that calls it', async () => {
+ const labelled = { at: 'Sources/LibTmux/Transport.swift:2', reaches: [hop('Sources/LibTmux/Transport.swift:3', { calls: 'run' }), hop('Sources/LibTmux/Transport.swift:6')] }
+ expect(await check('swift', 'swift', sources, 'run', labelled)).toEqual([])
+ // `run(list)` has no label: it is the first `run`, which is not where the process is started.
+ const unlabelled = { at: 'Sources/LibTmux/Transport.swift:8', reaches: [hop('Sources/LibTmux/Transport.swift:9', { calls: 'run' }), hop('Sources/LibTmux/Transport.swift:6')] }
+ const named = await check('swift', 'swift', sources, 'send', unlabelled)
+ expect(named.join('\n')).toMatch(/is a call of run\(_\), which resolves to Server\.run at Sources\/LibTmux\/Transport\.swift:2, and not to Server\.run at Sources\/LibTmux\/Transport\.swift:5/)
+ })
+ })
+})
+
describe('scanning a command that a guard wraps, a conditional and a label', () => {
const scanned = async (grammar: string, text: string, options: Record, commands: string[]) => {
const { functions } = await scanSource({ grammar, text, commands: new Set(commands), known: new Set(commands), ...options } as never)
@@ -812,6 +939,38 @@ describe('reading Julia and F# by their text', () => {
expect(byName.snapshot.sites).toEqual([])
})
+ it('reads a call that a condition only gates as a send, and a choice between two commands as none', () => {
+ const both = new Set(['list-panes', 'list-windows'])
+ const text = [
+ 'function gated(conn, ss)',
+ ' ws = isempty(ss) ? [] : run(conn, "list-windows")',
+ ' pick = flag ? "list-panes" : "list-windows"',
+ ' run(conn, pick)',
+ 'end',
+ '',
+ ].join('\n')
+ const { functions } = scanJulia(text, { commands: both, known: both, dispatch: new Set(['run']) }) as unknown as { functions: { sites: { command: string; line: number; dispatch?: { name: string } | null }[] }[] }
+ expect(functions[0].sites.map((found) => [found.line, found.command, found.dispatch?.name ?? null])).toEqual([[2, 'list-windows', 'run'], [3, 'list-panes', null], [3, 'list-windows', null]])
+ })
+
+ it('takes the body of a short-form function from the equals sign, when its arguments span lines', () => {
+ const text = [
+ 'read(',
+ ' connection::ControlConnection,',
+ ' fields::AbstractVector;',
+ ' kwargs...,',
+ ') = _read(connection, fields; kwargs...)',
+ '',
+ 'other() = nothing',
+ '',
+ ].join('\n')
+ const { functions } = scanJulia(text, { commands, known: commands }) as unknown as { functions: (Scanned & { nameLine: number; receiverType?: string })[] }
+ const read = functions.find((fn) => fn.name === 'read')!
+ expect([read.nameLine, read.end, read.receiverType]).toEqual([1, 5, 'ControlConnection'])
+ expect([...read.calls.keys()]).toContain('_read')
+ expect(functions.find((fn) => fn.name === 'other')!.start).toBe(7)
+ })
+
it('reads F# members with their owner, and the calls inside with the object they are made on', () => {
const text = [
'module Hierarchy',
@@ -835,6 +994,126 @@ describe('reading Julia and F# by their text', () => {
})
})
+describe('the methods of a generic function', () => {
+ const dispatch = new Set(['_operation_command', '_control_effect', '_control_create'])
+ const commands = new Set(['list-panes', 'list-windows', 'list-sessions'])
+ const text = [
+ 'function panes(server::Server, pane)', // 1
+ ' args = ["list-panes", "-a"]', // 2
+ ' _operation_command(server, args...)', // 3
+ 'end', // 4
+ '', // 5
+ 'function panes(connection::ControlConnection, pane)', // 6
+ ' _control_effect(connection, ["list-panes", "-a"])', // 7
+ 'end', // 8
+ '', // 9
+ 'function windows(server::Server)', // 10
+ ' _operation_command(server, "list-windows")', // 11
+ 'end', // 12
+ '', // 13
+ 'function windows(connection::ControlConnection)', // 14
+ ' _quiet(connection)', // 15
+ 'end', // 16
+ '', // 17
+ '_quiet(connection) = nothing', // 18
+ '', // 19
+ 'function sessions(server::Server)', // 20
+ ' _operation_command(server, "list-sessions")', // 21
+ 'end', // 22
+ '', // 23
+ 'function sessions(connection::ControlConnection)', // 24
+ ' _first(connection)', // 25
+ 'end', // 26
+ '', // 27
+ '_first(handle) = _second(handle)', // 28
+ '_second(handle) = _operation_command(handle, "list-sessions")', // 29
+ '', // 30
+ 'function forwarding(server::Server)', // 31
+ ' _operation_command(server, "list-windows")', // 32
+ 'end', // 33
+ '', // 34
+ 'function forwarding(f, server::Server)', // 35
+ ' forwarding(server)', // 36
+ 'end', // 37
+ '',
+ ].join('\n')
+ const symbols = ['panes', 'windows', 'sessions', 'forwarding'].map((name) => ({ id: `LibTmux.${name}`, name, file: 'lib.jl', line: 1 }))
+ const methods = async () => {
+ const { functions } = await scanSource({ grammar: 'julia', text, commands, known: commands, dispatch })
+ return functions.map((fn: object) => ({ ...fn, file: 'lib.jl' })) as unknown as Parameters[0]['functions']
+ }
+ const entries = async (command: string) => {
+ const result = deriveUsage({ command, spec: undefined, functions: await methods(), symbols, definitionOptions: { freeFunctions: true } })
+ return Object.fromEntries(result.entries.map((entry) => [entry.symbol.replace('LibTmux.', ''), entry as unknown as { methods: { sends: { nameLine: number }[]; lacks: { nameLine: number }[]; deep: { nameLine: number }[]; unsure: unknown[] } }]))
+ }
+ const lines = (names: string[]) => (path: string) => (path === 'lib.jl' ? names.join('\n') : undefined)
+ void lines
+
+ it('tells the methods apart by the type of the first argument', async () => {
+ const found = await methods()
+ expect(found.filter((fn) => fn.name === 'panes').map((fn) => (fn as unknown as { receiverType: string }).receiverType)).toEqual(['Server', 'ControlConnection'])
+ })
+
+ it('finds a send that every method makes, and needs no qualifier for it', async () => {
+ const { panes } = await entries('list-panes')
+ expect(panes.methods.sends.map((method) => method.nameLine)).toEqual([1, 6])
+ expect(panes.methods.lacks).toEqual([])
+ expect(partialProblems(new Map([['panes', panes as never]]))).toEqual([])
+ })
+
+ it('finds a send that only one method makes, and asks for a condition that says when', async () => {
+ const { windows } = await entries('list-windows')
+ expect(windows.methods.sends.map((method) => method.nameLine)).toEqual([10])
+ expect(windows.methods.lacks.map((method) => method.nameLine)).toEqual([14])
+ expect(partialProblems(new Map([['windows', windows as never]])).join('\n')).toMatch(/only the Server methods send it, and 1 other method such as lib.jl:14 do not/)
+ })
+
+ it('does not call a method that only reaches the send through more calls than a symbol is credited across a method that lacks it', async () => {
+ const { sessions } = await entries('list-sessions')
+ expect(sessions.methods.sends.map((method) => method.nameLine)).toEqual([20])
+ expect(sessions.methods.deep.map((method) => method.nameLine)).toEqual([24])
+ expect(sessions.methods.lacks).toEqual([])
+ expect(partialProblems(new Map([['sessions', sessions as never]]))).toEqual([])
+ })
+
+ it('counts a method that forwards to a method of its own name as sending what that one sends', async () => {
+ const { forwarding } = await entries('list-windows')
+ expect(forwarding.methods.sends.map((method) => method.nameLine)).toEqual([31])
+ expect(forwarding.methods.deep.map((method) => method.nameLine)).toEqual([35])
+ expect(forwarding.methods.lacks).toEqual([])
+ expect(partialProblems(new Map([['forwarding', forwarding as never]]))).toEqual([])
+ })
+
+ describe('a receiver qualifier', () => {
+ const found = async () => new Map([['LibTmux.windows\0list-windows\0null', (await entries('list-windows')).windows as never]])
+ const body = (start: number, end: number, has: string) => ({ at: `lib.jl:${start}`, through: end, has: [has] })
+ const condition = (over: Record = {}) => ({
+ port: 'julia', symbol: 'LibTmux.windows', command: 'list-windows', scope: null, when: 'on a Server', receiver: 'Server',
+ evidence: [body(10, 12, 'function windows('), body(14, 16, 'function windows(')], ...over,
+ })
+ const apply = async (item: Record) => applyConditions({ conditions: [item as never], found: await found(), readSource: lines(text.split('\n')) })
+
+ it('is accepted when the methods that send take the type, another method does not, and both bodies are cited', async () => {
+ expect(await apply(condition())).toEqual([])
+ })
+
+ it.each([
+ ['a type the sending method does not take', { when: 'on a ControlConnection', receiver: 'ControlConnection' }, /ControlConnection, but the Server method at lib.jl:10 sends it too/],
+ ['a body cited for the sending method only', { evidence: [body(10, 12, 'function windows(')] }, /cites the body of no method that does not send it/],
+ ['a signature line in place of the body', { evidence: [{ at: 'lib.jl:10', has: ['::Server'] }, { at: 'lib.jl:14', has: ['::ControlConnection'] }] }, /cites the body of no method that sends it/],
+ ['a body that ends elsewhere', { evidence: [body(10, 11, 'function windows('), body(14, 16, 'function windows(')] }, /cites the body of no method that sends it/],
+ ])('is refused for %s', async (_name, over, message) => {
+ expect((await apply(condition(over))).join('\n')).toMatch(message)
+ })
+
+ it('is refused for a send that every method makes', async () => {
+ const every = new Map([['LibTmux.panes\0list-panes\0null', (await entries('list-panes')).panes as never]])
+ const item = condition({ symbol: 'LibTmux.panes', command: 'list-panes', evidence: [body(1, 4, 'function panes('), body(6, 8, 'function panes(')] })
+ expect(applyConditions({ conditions: [item as never], found: every, readSource: lines(text.split('\n')) }).join('\n')).toMatch(/no method of the function is shown not to send it/)
+ })
+ })
+})
+
describe('finding the methods a scan misses', () => {
const method = (name: string, owner: string, over: Record = {}) => ({ id: `S.${owner}.${name}`, name, parentName: owner, file: 'src/libtmux/lib.py', kind: 'method', ...over })
const find = (symbols: ReturnType[], has: string[] = [], commands = ['new-session', 'new-window', 'kill-pane', 'send-keys']) =>
From e9c112f6b753168ec469dfa32cb7c162317f9f88 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Tue, 20 Oct 2026 05:29:53 -0500
Subject: [PATCH 15/53] fix(site[tmux-usage]) Set a command apart from its C
function, and one scope from the next
why: The "tmux command" line of a method page read `list-panes -a cmd_list_panes_server`:
a CLI command, its flag and a C function in one run with only spaces between
them, so a reader could not tell two destinations from one name. A command sent
at three scopes ran on into `-s cmd_list_panes_session -t cmd_list_panes_window`
with nothing to say where one pair ended. The Markdown of the page wrote its own
version of the same line with its own punctuation.
what:
- `tmuxCommandItems` turns the rows of a method into one item for each scope a
command is sent at (command, flag, C function, condition, evidence) and one
for a command with no scope. The method page and its Markdown both render
from these items, so the two cannot disagree on the line.
- An item reads `list-panes -a, cmd_list_panes_server`: the command and its flag,
a comma, the function, then the condition that holds for that scope. Items are
divided by a semicolon, because a comma already sits inside an item:
`list-panes -a, cmd_list_panes_server; list-panes -s, cmd_list_panes_session;
list-panes -t, cmd_list_panes_window`. A line of commands that name no C
function keeps the comma (`kill-pane, kill-window`), and a line that mixes the
two uses the semicolon throughout (`tmuxCommandSeparator`). A scope with no
function has no comma to add (`list-panes -a Server`).
- Markdown: `tmux command: [list-panes](...) server scope, [cmd_list_panes_server](...)`,
scopes divided the same way, a condition in parentheses after its own scope.
- A condition every scope of a send shares was written once after the command; it
now follows each scope it holds for. No recorded send has two scopes under one
condition, so no page changes by this, and a pair under different conditions
already said each beside its own scope.
- The item markup carries no whitespace between an item and the separator that
follows it, which the first rendering of this got wrong (`server ; list-panes`);
the tests read the text of the line.
- The usage table's column heading stays as it is: its flag and C function are
separate blocks, one above the other, not a run of text.
- The three tests that sliced the line out of ApiEntry.astro share one helper
that compiles it with the two lines of the real frontmatter that make the items.
---
site/src/components/api/ApiEntry.astro | 20 +++----
site/src/lib/symbol-markdown.ts | 12 ++--
site/src/lib/tmux-reference.ts | 33 +++++++++++
site/test/tmux-library-usage.test.ts | 81 ++++++++++++++++++++------
4 files changed, 110 insertions(+), 36 deletions(-)
diff --git a/site/src/components/api/ApiEntry.astro b/site/src/components/api/ApiEntry.astro
index 5b6e4ba7d..530ea61d1 100644
--- a/site/src/components/api/ApiEntry.astro
+++ b/site/src/components/api/ApiEntry.astro
@@ -15,7 +15,7 @@ import ApiType from './ApiType.astro'
import { asideFor } from '../../lib/aside'
import { apiCommandFacts, apiCommandRelatedLinks, apiEntryFields, apiMethodDetails, anonymousDeclarationLabel, nativeSignatureText as unformattedNativeSignatureText, parameterBindingText, usesNativeSignatures } from '../../lib/api-sections'
import { tmuxCommandsFor, tmuxManualUrl } from '../../lib/tmux-manual-data'
-import { tmuxCommandRows, tmuxSymbolSends } from '../../lib/tmux-reference'
+import { tmuxCommandItems, tmuxCommandRows, tmuxCommandSeparator, tmuxSymbolSends } from '../../lib/tmux-reference'
import { CATALOG_KINDS, tmuxCatalogKindsForSymbol, tmuxCatalogUrl } from '../../lib/tmux-catalog'
import ApiFieldOverloads from './ApiFieldOverloads.astro'
import ApiCommandParameters from './ApiCommandParameters.astro'
@@ -184,6 +184,8 @@ const mentions = port ? mentionsOf(port, symbol.id) : []
// A command the symbol sends comes with its scope and C function; one it only has an equivalent for is a plain link.
const tmuxCommands = manualLinks ?? (port ? tmuxCommandsFor(port, anchor).map((command) => ({ ...command, href: tmuxManualUrl('latest', command.name) })) : [])
const commandRows = tmuxCommandRows(port && !manualLinks ? tmuxSymbolSends(port, anchor) : [], tmuxCommands)
+const commandItems = tmuxCommandItems(commandRows)
+const commandSeparator = tmuxCommandSeparator(commandItems)
// Members that wrap options or hooks lead to the catalog of what they take.
const catalogEntries = catalogLinks ?? (port && !manualLinks ? tmuxCatalogKindsForSymbol(port, symbol).map((kind) => ({ name: CATALOG_KINDS[kind].label, href: tmuxCatalogUrl('latest', kind) })) : [])
const mentionSections = [...new Set(mentions.map((m) => m.section ?? 'docs'))].sort()
@@ -675,18 +677,12 @@ const hasBody =
)
}
- {commandRows.length > 0 &&
tmux catalog
diff --git a/site/src/lib/symbol-markdown.ts b/site/src/lib/symbol-markdown.ts
index 25a24b848..693cf2453 100644
--- a/site/src/lib/symbol-markdown.ts
+++ b/site/src/lib/symbol-markdown.ts
@@ -6,7 +6,7 @@ import mentions from '../data/mentions.json'
import { PORT_NAME, referenceAlternatives } from './api-models'
import { apiCommandFacts, apiCommandRelatedLinks, apiEntryFields, apiMemberGroups, apiMethodDetails, anonymousDeclarationLabel, hasScalarMembers, nativeSignatureText, parameterBindingText, signatureMultiline, signatureParameterText, usesNativeSignatures } from './api-sections'
import { tmuxCommandsFor, tmuxManualUrl } from './tmux-manual-data'
-import { sharedWhen, tmuxSymbolSends, type ResolvedUsage } from './tmux-reference'
+import { tmuxCommandItems, tmuxCommandRows, tmuxCommandSeparator, tmuxSymbolSends, type ResolvedUsage } from './tmux-reference'
import { CATALOG_KINDS, tmuxCatalogKindsForSymbol, tmuxCatalogUrl } from './tmux-catalog'
import { tmuxCommandMentions, tmuxMentionMarkdown } from './tmux-links'
import { productApiIndex } from './product-api'
@@ -193,11 +193,11 @@ export function symbolMarkdown(ctx: MarkdownContext): string {
const commands = ctx.manualLinks ?? (port ? tmuxCommandsFor(port, symbol.publicId ?? symbol.id)
.map((command) => ({ ...command, href: tmuxManualUrl('latest', command.name) })) : [])
for (const send of port && !ctx.manualLinks ? tmuxSymbolSends(port, symbol.publicId ?? symbol.id) : []) {
- // One condition that every scope shares follows the command; scopes that differ each say their own.
- const shared = sharedWhen(send)
- const scopes = send.scopes.filter((use) => use.scope).map((use) =>
- `${use.scope!.label.toLowerCase()} scope${use.function ? ` [\`${use.function.name}\`](${use.function.href})` : ''}${use.when && !shared ? ` (${use.when})` : ''}`)
- out.push(`tmux command: [\`${send.command}\`](${send.manualHref})${scopes.length ? `, ${scopes.join(', ')}` : ''}${shared ? ` (${shared})` : ''}`, '')
+ // The same items as the method page: each scope names the command and then its C function, set apart by a comma, and
+ // the scopes by a semicolon. A condition follows the scope it holds for.
+ const items = tmuxCommandItems(tmuxCommandRows([send], []))
+ const written = items.map((item) => `[\`${item.command}\`](${item.href})${item.scope ? ` ${item.scope.label.toLowerCase()} scope${item.function ? `, [\`${item.function.name}\`](${item.function.href})` : ''}` : ''}${item.when ? ` (${item.when})` : ''}`)
+ out.push(`tmux command: ${written.join(tmuxCommandSeparator(items))}`, '')
}
for (const command of commands) out.push(`tmux command: [\`${command.name}\`](${command.href})`, '')
const catalog = ctx.catalogLinks ?? (port && !ctx.manualLinks ? tmuxCatalogKindsForSymbol(port, symbol)
diff --git a/site/src/lib/tmux-reference.ts b/site/src/lib/tmux-reference.ts
index efccbb0e4..9aca7a126 100644
--- a/site/src/lib/tmux-reference.ts
+++ b/site/src/lib/tmux-reference.ts
@@ -280,6 +280,39 @@ export function tmuxCommandRows(sends: SymbolSend[], equivalents: { name: string
]
}
+/**
+ * One destination pair of a method page's tmux command line: the command with the flag that picks the scope, and the C
+ * function that implements it at that scope. A command sent at three scopes is three items, so each reads whole.
+ */
+export interface CommandItem {
+ command: string
+ href: string
+ /** The scope this item sends the command at; a command with no scope is the command alone. */
+ scope?: NonNullable
+ function?: { name: string; href: string }
+ when?: string
+ /** The line that sends, or for a wrapper the core call it makes: what the scope's tooltip cites. */
+ evidence?: string
+}
+
+/** The items of a command line, one for each scope a command is sent at and one for a command with none. */
+export function tmuxCommandItems(rows: CommandRow[]): CommandItem[] {
+ return rows.flatMap((row): CommandItem[] => row.scopes.length
+ ? row.scopes.map((use) => ({
+ command: row.command, href: row.href, scope: use.scope!,
+ ...(use.function ? { function: use.function } : {}),
+ ...(use.when ? { when: use.when } : {}),
+ evidence: use.via ? `Calls ${use.via.symbol}: ${use.via.evidence[0]}` : use.evidence[0],
+ }))
+ : [{ command: row.command, href: row.href, ...(row.when ? { when: row.when } : {}) }])
+}
+
+/**
+ * What goes between the items of one line. A comma already separates a command from its C function, so a line that
+ * has one uses a semicolon between items, and a line of commands alone keeps the comma.
+ */
+export const tmuxCommandSeparator = (items: CommandItem[]) => items.some((item) => item.function) ? '; ' : ', '
+
/** The commands a library symbol sends, with each scope's manual and C function. */
export function tmuxSymbolSends(port: string, publicId: string, version = 'latest'): SymbolSend[] {
return tmuxUsageOf(port, publicId).map((entry) => ({
diff --git a/site/test/tmux-library-usage.test.ts b/site/test/tmux-library-usage.test.ts
index b5d81ee65..f2644addd 100644
--- a/site/test/tmux-library-usage.test.ts
+++ b/site/test/tmux-library-usage.test.ts
@@ -330,6 +330,48 @@ describe('from a method to the command and its C function', () => {
expect(send.scopes.every((use) => use.via?.port === 'csharp')).toBe(true)
})
+ it('sets the command apart from its C function, and one scope from the next, on the line of a method page', async () => {
+ const template = await commandLineTemplate()
+ const line = async (rows: ReturnType) => {
+ const document = dom(withoutScope(await renderAstroTemplate(template, { props: { commandRows: rows } })))
+ return { text: document.querySelector('.gp-sphinx-api-mentions')!.textContent!.replace(/\s+/g, ' ').trim(), document }
+ }
+ // One scope: the command and its flag, then the function, as two destinations.
+ const swift = tmuxCommandRows(tmuxSymbolSends('swift', 'Server.panes()'), [])
+ const one = await line(swift)
+ expect(one.text).toBe('tmux command list-panes -a, cmd_list_panes_server')
+ expect([...one.document.querySelectorAll('.gp-sphinx-api-mentions a')].map((a) => a.textContent!.trim())).toEqual(['list-panes', 'cmd_list_panes_server'])
+ expect(one.document.querySelector('.tmux-send')!.textContent!.replace(/\s+/g, ' ').trim()).toBe('-a, cmd_list_panes_server')
+ // Three scopes: each is a whole command and function, and a semicolon, which a comma already inside an item cannot be, divides them.
+ const cmdlet = tmuxCommandRows(tmuxSymbolSends('powershell', 'LibTmux\\Get-TmuxPane'), []).filter((row) => row.command === 'list-panes')
+ expect((await line(cmdlet)).text).toBe(
+ 'tmux command list-panes -a, cmd_list_panes_server; list-panes -s, cmd_list_panes_session; list-panes -t, cmd_list_panes_window')
+ // A condition follows the scope it holds for, inside its item.
+ const fsharp = tmuxCommandRows(tmuxSymbolSends('fsharp', 'LibTmux.FSharp.Server.newSession'), []).filter((row) => row.command === 'list-panes')
+ expect((await line(fsharp)).text).toBe(
+ 'tmux command list-panes -s, cmd_list_panes_session the spec names a first window; list-panes -t, cmd_list_panes_window the spec has more than one window')
+ // Commands with no C function to name keep the comma, and a line that mixes the two uses the semicolon throughout.
+ const plain = [{ command: 'kill-pane', href: '/tmux/latest/manual/kill-pane/', scopes: [] }, { command: 'kill-window', href: '/tmux/latest/manual/kill-window/', scopes: [] }]
+ expect((await line(plain)).text).toBe('tmux command kill-pane, kill-window')
+ expect((await line([...swift, ...plain])).text).toBe('tmux command list-panes -a, cmd_list_panes_server; kill-pane; kill-window')
+ // The control: a scope with no function has no comma to set it apart.
+ const bare = [{ ...swift[0], scopes: swift[0].scopes.map((use) => ({ ...use, function: undefined })) }]
+ expect((await line(bare)).text).toBe('tmux command list-panes -a Server')
+ })
+
+ it('writes the same line into the Markdown of a method', () => {
+ const model = API_MODELS.powershell
+ const symbol = model.symbols.find((entry) => (entry.publicId ?? entry.id) === 'LibTmux\\Get-TmuxPane')!
+ const text = symbolMarkdown({ model, symbol })
+ const lines = text.split('\n').filter((entry) => entry.startsWith('tmux command: [`list-panes`]'))
+ const manual = tmuxManualUrl('latest', 'list-panes')
+ const of = (scope: string) => `[\`list-panes\`](${manual}) ${scope} scope, [\`cmd_list_panes_${scope}\`](/tmux/latest/reference/c-function-cmd-list-panes-c-cmd_list_panes_${scope}/)`
+ expect(lines).toEqual([['server', 'session', 'window'].map(of).join('; ')].map((entry) => `tmux command: ${entry}`))
+ // The control: a command with no scope is the command alone.
+ const swift = API_MODELS.swift.symbols.find((entry) => (entry.publicId ?? entry.id) === 'Server.panes()')!
+ expect(symbolMarkdown({ model: API_MODELS.swift, symbol: swift })).toContain(`tmux command: [\`list-panes\`](${manual}) server scope, [\`cmd_list_panes_server\`](`)
+ })
+
it('does not link a method that only reads a capture, whatever the concepts call it equivalent to', () => {
// The concept map names Window.Panes the Go equivalent of list-panes.
expect(tmuxSymbolSends('go', 'tmux.Window.Panes')).toEqual([])
@@ -453,6 +495,23 @@ describe('the manual page of a command', () => {
}
})
+/**
+ * The method page's tmux command line, compiled from the source of `ApiEntry.astro` with nothing around it, and given
+ * rows to render. Its frontmatter is the two lines of the real one that turn rows into items.
+ */
+async function commandLineTemplate() {
+ const source = readFileSync(new URL('../src/components/api/ApiEntry.astro', import.meta.url), 'utf8')
+ const start = source.indexOf('{commandItems.length > 0 &&
}'.length
- const stub = `---\nconst { commandRows } = Astro.props\n---\n${source.slice(start, end)}`
- const entry = await loadAstroTemplate('components/api/ApiEntry.astro', { stubs: { 'components/api/ApiEntry.astro': stub } })
+ const entry = await commandLineTemplate()
const conditional = Object.entries(TMUX_USAGE).flatMap(([port, document]) => Object.entries(document.symbols)
.flatMap(([symbol, uses]) => uses.filter((use) => use.when).map((use) => ({ port, symbol, use }))))
expect(conditional.length).toBeGreaterThan(50)
@@ -626,17 +677,11 @@ describe('the rendered lists', () => {
})
it('adds the command, flag and C function to the declaration card, and no table', async () => {
- const source = readFileSync(new URL('../src/components/api/ApiEntry.astro', import.meta.url), 'utf8')
- const start = source.indexOf('{commandRows.length > 0 &&
}', start) + '
}'.length
- expect(start).toBeGreaterThan(0)
- expect(end).toBeGreaterThan(start)
- const stub = `---\nconst { commandRows } = Astro.props\n---\n${source.slice(start, end)}`
- const template = await loadAstroTemplate('components/api/ApiEntry.astro', { stubs: { 'components/api/ApiEntry.astro': stub } })
+ const template = await commandLineTemplate()
const html = (commandRows: ReturnType) => renderAstroTemplate(template, { props: { commandRows } }).then((text) => dom(withoutScope(text)))
const method = await html(tmuxCommandRows(tmuxSymbolSends('swift', 'Server.panes()'), []))
- expect(method.querySelector('.gp-sphinx-api-mentions')!.textContent!.replace(/\s+/g, ' ').trim()).toBe('tmux command list-panes -a cmd_list_panes_server')
+ expect(method.querySelector('.gp-sphinx-api-mentions')!.textContent!.replace(/\s+/g, ' ').trim()).toBe('tmux command list-panes -a, cmd_list_panes_server')
expect([...method.querySelectorAll('.gp-sphinx-api-mentions a')].map((a) => a.getAttribute('href'))).toEqual([
'/tmux/latest/manual/list-panes/', '/tmux/latest/reference/c-function-cmd-list-panes-c-cmd_list_panes_server/',
])
From 95a2cab3724eca583c97275b06f16635cce6ff76 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Tue, 20 Oct 2026 05:31:16 -0500
Subject: [PATCH 16/53] fix(site[tmux-reference]) Serve a preview card for
every C declaration page
why: Hovering or focusing the C function a method links to (`cmd_list_panes_server`
on a method page's "tmux command" line) opened nothing. The link carried
`data-link-preview`, because the preview policy marks any /reference//
address, and the card asks for `.preview.json`. Nothing served that
address for tmux's C reference: the generic preview route covers the manual,
the port APIs, glossaries and MCP objects, the catalog has its own, and the
tmux reference pages had none. The request answered 404 and the browser, which
keeps the real link on a failed preview, showed no card. The same held for
every function, struct, enum, macro and attribute linked anywhere on the site.
what:
- `tmuxReferencePreview` builds the card from the declaration's own record, as
the page does: its name, its kind (the chip on the card), its C signature
highlighted as C or a macro's definition, the file and line it is declared at
in that tmux version, and the source link. tmux's source carries no Doxygen
briefs, so there is no description; the card's default line covers it.
- `tmux/[version]/reference/[...slug].preview.json` serves one payload for each
page of each version the reference builds, at the address the policy asks for.
The route is next to the page and its Markdown twin and uses the same static
paths, so a declaration with a page has a card.
- Tests, in tmux-reference.test.ts: every declaration of every version (latest,
3.7c, 3.2a) is marked for a card by the link policy and has a payload at the
endpoint the policy computes; the payload for `cmd_list_panes_server` is a
valid card with its signature and its highlighting; macros show their
definition and a declaration with no signature gets none. The negative
control: a reference address no route serves is marked for a card and is
reported, and the generic route's endpoints answer at no declaration's address,
which is the state this replaces.
- `checkTmuxReferencePreviews` (check-page-readiness.mjs, `--reference-previews`
and the full run) hovers the C function link on the C++ method page, reads the
card it opens, requests the payload of every link marked for a card on four
pages, and checks that a marked link with no payload opens nothing. It was
written but not run: no dev server could be started for this change.
Not measured: the build adds one small JSON file for each declaration of each
version, the same number as its Markdown twin, and highlights each signature.
The build time and size of the new route have not been measured.
---
site/scripts/check-dev.mjs | 11 ++-
site/scripts/check-page-readiness.mjs | 56 +++++++++++++++
site/src/lib/tmux-reference.ts | 20 +++++-
.../reference/[...slug].preview.json.ts | 13 ++++
site/test/tmux-reference.test.ts | 68 ++++++++++++++++++-
5 files changed, 163 insertions(+), 5 deletions(-)
create mode 100644 site/src/pages/tmux/[version]/reference/[...slug].preview.json.ts
diff --git a/site/scripts/check-dev.mjs b/site/scripts/check-dev.mjs
index 5225c285d..6e2144a77 100644
--- a/site/scripts/check-dev.mjs
+++ b/site/scripts/check-dev.mjs
@@ -18,7 +18,7 @@ import { checkHomeExampleOptions } from './check-home-example-options.mjs'
import { checkDevSample, checkRowPermalinks } from './check-dev-sample.mjs'
import { checkDeclarationControlAlignment, checkDeclarationControlsLevel, checkMemberBodyInsets, checkNativeSignatureGeometry, checkNativeSignatureLinks } from './check-native-layout.mjs'
import { checkBadgeCentring, checkChipGrowth, checkMentionDensity } from './check-badge-centring.mjs'
-import { checkBlockLinksUndecorated, checkKindBadgeLinks, checkRequiredAppearance, checkWebAnalytics, checkWebAnalyticsTransitions } from './check-page-readiness.mjs'
+import { checkBlockLinksUndecorated, checkKindBadgeLinks, checkRequiredAppearance, checkTmuxReferencePreviews, checkWebAnalytics, checkWebAnalyticsTransitions } from './check-page-readiness.mjs'
import { checkTypeParameters } from './check-type-parameters.mjs'
import { checkTmuxKeys, TMUX_KEY_PAGES } from './check-tmux-keys.mjs'
@@ -37,6 +37,7 @@ const globalHeaderOnly = process.argv.includes('--global-header')
const headerMenuSectionsOnly = process.argv.includes('--header-menu-sections')
const statusBadgesOnly = process.argv.includes('--status-badges')
const badgeCentringOnly = process.argv.includes('--badge-centring')
+const referencePreviewsOnly = process.argv.includes('--reference-previews')
const homeLauncherOnly = process.argv.includes('--home-launcher')
const homeControlsOnly = process.argv.includes('--home-controls')
const sampleOnly = process.argv.includes('--sample')
@@ -746,10 +747,11 @@ try {
: keywordHelpOnly ? '/kotlin/latest/reference/io-github-libtmux-kotlin-withserver/'
: apiStickyOnly ? '/swift/latest/reference/server/'
: badgeCentringOnly ? '/py/stable/guides/attaching-to-tmux/'
+ : referencePreviewsOnly ? '/cxx/latest/reference/libtmux-server-panes/'
: documentationNavigationOnly || headerMenuSectionsOnly || statusBadgesOnly ? '/py/latest/' : apiSignaturesOnly ? '/api-signature-probe/'
: apiNavigationOnly ? '/lua/latest/reference/libtmux-server/'
: typeParametersOnly ? '/ts/latest/reference/selection-selection-where/' : '/tmux/concepts/server-session-window-pane/'
- const fullRun = ![homeLauncherOnly, homeControlsOnly, keywordHelpOnly, apiSignaturesOnly, referenceLayoutOnly, globalHeaderOnly, headerMenuSectionsOnly, statusBadgesOnly, badgeCentringOnly,
+ const fullRun = ![homeLauncherOnly, homeControlsOnly, keywordHelpOnly, apiSignaturesOnly, referenceLayoutOnly, globalHeaderOnly, headerMenuSectionsOnly, statusBadgesOnly, badgeCentringOnly, referencePreviewsOnly,
referencePreferencesOnly, documentationNavigationOnly, apiNavigationOnly, apiAnchorsOnly, typeParametersOnly].some(Boolean)
const setupPages = sampleOnly ? [firstPage, '/demo/widgets/pickers/', ...TMUX_KEY_PAGES]
: [firstPage, ...(fullRun ? TMUX_KEY_PAGES : [])]
@@ -800,6 +802,8 @@ try {
await retryReload(() => checkBadgeCentring(browser, base))
await checkMentionDensity(browser, base)
await checkChipGrowth(browser, base)
+ } else if (referencePreviewsOnly) {
+ await retryReload(() => checkTmuxReferencePreviews(browser, base))
} else if (referencePreferencesOnly) {
await retryReload(() => checkReferencePreferences(browser, base))
await retryReload(() => checkGlobalHeader(browser, base))
@@ -877,6 +881,7 @@ try {
.then(() => checkMentionDensity(browser, base))
.then(() => checkChipGrowth(browser, base)))
const blockLinks = schedule(() => retryReload(() => checkBlockLinksUndecorated(browser, base)))
+ const referencePreviews = schedule(() => retryReload(() => checkTmuxReferencePreviews(browser, base)))
await apiAnchors
const apiSticky = schedule(() => retryReload(() => checkApiStickyHeadings(browser, base))
.then(() => checkApiStickyHeadingsFail(browser, base)))
@@ -1177,7 +1182,7 @@ try {
await page.close()
const failures = (await Promise.all([
navigation, apiExamples, reference, preferences, globalHeader, headerMenuSections, statusBadges, apiNavigation,
- clipboard, documentationNavigation, homeLauncher, apiAnchors, apiSticky, typeParameters, kindBadges, badgeCentring, blockLinks,
+ clipboard, documentationNavigation, homeLauncher, apiAnchors, apiSticky, typeParameters, kindBadges, badgeCentring, blockLinks, referencePreviews,
])).filter(Boolean)
if (failures.length) throw new AggregateError(failures, 'Browser checks failed')
}
diff --git a/site/scripts/check-page-readiness.mjs b/site/scripts/check-page-readiness.mjs
index 3d14612aa..e79757c66 100644
--- a/site/scripts/check-page-readiness.mjs
+++ b/site/scripts/check-page-readiness.mjs
@@ -530,3 +530,59 @@ export async function checkBlockLinksUndecorated(browser, base, { sample = false
await context.close()
}
}
+
+/**
+ * A link marked for a preview card has a card to show. A C function a method links to carried `data-link-preview` and
+ * opened nothing, because no preview payload was served at its address. Hovering the link is what asks for the card,
+ * so hover it and read the card, then ask the same of every marked link on the pages, and of one that has no payload.
+ */
+export async function checkTmuxReferencePreviews(browser, base) {
+ const context = await browser.newContext({ reducedMotion: 'reduce', viewport: { width: 1440, height: 1000 } })
+ const page = await context.newPage()
+ page.setDefaultTimeout(process.env.CI ? 20000 : 10000)
+ const opened = () => page.evaluate(() => document.getElementById('reference-link-preview')?.matches(':popover-open') ?? false)
+ try {
+ await page.goto(`${base}/cxx/latest/reference/libtmux-server-panes/`, { waitUntil: 'load' })
+ await page.waitForFunction(() => document.documentElement.dataset.pageReadiness === 'ready')
+ const link = page.locator('p.gp-sphinx-api-mentions .tmux-send a[data-link-preview]').first()
+ assert.equal(await link.count(), 1, 'The method page has no C function link marked for a preview')
+ assert.equal(await link.textContent(), 'cmd_list_panes_server')
+ await link.hover()
+ // The first request for a declaration's card compiles its route in the dev server.
+ await page.waitForFunction(() => document.getElementById('reference-link-preview')?.matches(':popover-open'), null, { timeout: 60000 })
+ assert.equal(await page.locator('#reference-link-preview [data-preview-title]').textContent(), 'cmd_list_panes_server')
+ assert.match(await page.locator('#reference-link-preview [data-preview-signature]').textContent(), /^static void cmd_list_panes_server\(struct cmd \*, struct cmdq_item \*\)$/)
+ assert.match(await page.locator('#reference-link-preview [data-preview-open]').getAttribute('href'), /\/tmux\/latest\/reference\/c-function-cmd-list-panes-c-cmd_list_panes_server\/$/)
+ // Every link a page marks for a card has a payload at the address the card asks for.
+ const missing = []
+ let marked = 0
+ for (const path of ['/cxx/latest/reference/libtmux-server-panes/', '/tmux/latest/manual/list-panes/', '/tmux/latest/reference/c-function-cmd-list-panes-c-cmd_list_panes_server/', '/tmux/latest/reference/c-struct-window_pane/']) {
+ await page.goto(`${base}${path}`, { waitUntil: 'load' })
+ await page.waitForFunction(() => document.documentElement.dataset.pageReadiness === 'ready')
+ const hrefs = await page.evaluate(() => [...new Set([...document.querySelectorAll('a[data-link-preview]')].map((anchor) => new URL(anchor.href).pathname))])
+ marked += hrefs.length
+ for (const href of hrefs) {
+ const response = await page.request.get(`${base.replace(/\/en$/, '')}${href.slice(0, -1)}.preview.json`)
+ if (!response.ok()) missing.push(`${path}: ${href} answers ${response.status()}`)
+ }
+ }
+ assert(marked > 3, `Only ${marked} links were marked for a card, so the pages were not measured`)
+ assert.deepEqual(missing, [], `A link marked for a card that has none:\n${missing.join('\n')}`)
+ // The control: a link marked for a card whose payload does not exist opens nothing, and the sweep above would name it.
+ await page.goto(`${base}/tmux/latest/manual/list-panes/`, { waitUntil: 'load' })
+ await page.waitForFunction(() => document.documentElement.dataset.pageReadiness === 'ready')
+ await page.evaluate(() => {
+ const anchor = document.createElement('a')
+ anchor.id = 'no-card'
+ anchor.href = '/en/tmux/latest/reference/c-function-no-such-declaration/'
+ anchor.textContent = 'no_such_declaration'
+ document.querySelector('main').prepend(anchor)
+ })
+ const absent = await page.request.get(`${base.replace(/\/en$/, '')}/en/tmux/latest/reference/c-function-no-such-declaration.preview.json`)
+ assert.equal(absent.status(), 404, 'The control address answered, so the sweep cannot show a missing payload')
+ await page.locator('#no-card').hover()
+ await page.waitForTimeout(700)
+ assert.equal(await opened(), false, 'A link with no payload opened a card')
+ console.log(`Tmux reference previews: the C function link of a method page opens its card with its signature; ${marked} marked links on four pages each have a payload; a link with none opens nothing PASS`)
+ } finally { await context.close() }
+}
diff --git a/site/src/lib/tmux-reference.ts b/site/src/lib/tmux-reference.ts
index 9aca7a126..f83f4a778 100644
--- a/site/src/lib/tmux-reference.ts
+++ b/site/src/lib/tmux-reference.ts
@@ -1,9 +1,10 @@
/** tmux source data adapted to the shared API reference and navigation. */
-import { navSidecarFor, pageSlug, type ApiSymbol, type SourceApiModel, type SymbolIndex } from '@libtmux/api-model'
+import { docSummaryText, navSidecarFor, pageSlug, sourceUrl, type ApiSymbol, type SourceApiModel, type SymbolIndex } from '@libtmux/api-model'
import v32 from '../data/tmux/api/3.2a.json?raw'
import v37 from '../data/tmux/api/3.7c.json?raw'
import pins from '../data/tmux/versions.json'
import { createApiIndex, type PortNavData } from './api-models'
+import type { LinkPreview } from './link-preview'
import { navTreeFor, referenceTreeFor, referenceBreadcrumbs } from './api-tree'
import { apiRelationshipPath } from './api-relationships'
import { PORTS } from './ports'
@@ -324,6 +325,23 @@ export function tmuxSymbolSends(port: string, publicId: string, version = 'lates
}),
}))
}
+/**
+ * The card a link to a declaration of tmux's C source opens, from the same record as the page it leads to. tmux's source
+ * carries no Doxygen briefs, so the card says where the declaration is and shows it, which is what a reader following a
+ * link from a method wants to see before leaving the page.
+ */
+export function tmuxReferencePreview(version: string, symbol: ApiSymbol): LinkPreview {
+ const model = tmuxSourceModel(version)
+ const signature = symbol.signatures[0]?.raw ?? (symbol.value !== undefined ? `${symbol.name} = ${symbol.value}` : undefined)
+ const summary = symbol.doc?.summary ?? symbol.signatures.find((entry) => entry.doc?.summary)?.doc?.summary
+ return {
+ schema: 1, title: symbol.name, kind: symbol.kind,
+ description: summary ? docSummaryText(summary, 'c') : '',
+ detail: `Defined in ${symbol.source.file}${symbol.source.line ? `, line ${symbol.source.line}` : ''} of tmux ${model.version}.`,
+ signature, signatureLanguage: signature ? 'c' : undefined,
+ href: tmuxReferenceUrl(version, symbol), source: sourceUrl(model, symbol),
+ }
+}
export function tmuxReferenceRoutes() {
return buildsTmuxDocumentation() ? TMUX_VERSIONS.flatMap((version) => [
{ version, symbol: undefined as ApiSymbol | undefined },
diff --git a/site/src/pages/tmux/[version]/reference/[...slug].preview.json.ts b/site/src/pages/tmux/[version]/reference/[...slug].preview.json.ts
new file mode 100644
index 000000000..e2f12f2ca
--- /dev/null
+++ b/site/src/pages/tmux/[version]/reference/[...slug].preview.json.ts
@@ -0,0 +1,13 @@
+import type { APIRoute } from 'astro'
+import { highlightedPreview } from '../../../../lib/link-preview'
+import { tmuxReferencePreview, tmuxReferenceRoutes } from '../../../../lib/tmux-reference'
+
+/** A preview for every declaration page, at the address the link-preview policy asks for: the page's path with `.preview.json`. */
+export function getStaticPaths() {
+ return tmuxReferenceRoutes().filter(({ symbol }) => symbol).map(({ version, symbol }) => ({
+ params: { version, slug: symbol!.slug }, props: { version, symbol: symbol! },
+ }))
+}
+export const GET: APIRoute = async ({ props }) => new Response(JSON.stringify(await highlightedPreview(tmuxReferencePreview(props.version, props.symbol))), {
+ headers: { 'Content-Type': 'application/json; charset=utf-8' },
+})
diff --git a/site/test/tmux-reference.test.ts b/site/test/tmux-reference.test.ts
index 43685a77c..5962a4fd9 100644
--- a/site/test/tmux-reference.test.ts
+++ b/site/test/tmux-reference.test.ts
@@ -1,12 +1,16 @@
import { describe, expect, it } from 'vitest'
import { readInventory, sourceUrl, writeInventory } from '@libtmux/api-model'
-import { tmuxCommandSources, tmuxReferenceContext, tmuxReferenceIndex, tmuxReferencePaths, tmuxReferenceTree, tmuxReferenceUrl, tmuxReferenceVersionUrl, tmuxSourceCommands, tmuxSourceModel } from '../src/lib/tmux-reference'
+import { tmuxCommandSources, tmuxReferenceContext, tmuxReferenceIndex, tmuxReferencePaths, tmuxReferencePreview, tmuxReferenceTree, tmuxReferenceUrl, tmuxReferenceVersionUrl, tmuxSourceCommands, tmuxSourceModel } from '../src/lib/tmux-reference'
import { tmuxManual, tmuxManualUrl } from '../src/lib/tmux-manual-data'
import { referenceIndexSectionsFor } from '../src/lib/api-tree'
import { searchApi } from '../src/lib/api-search'
import { symbolMarkdown } from '../src/lib/symbol-markdown'
import { relatedApiTypes } from '../src/lib/api-sections'
import { PORTS } from '../src/lib/ports'
+import { linkPreviewTarget } from '../src/lib/link-preview-paint'
+import { TMUX_VERSIONS } from '../src/lib/tmux-manual-data'
+import { GET, getStaticPaths } from '../src/pages/tmux/[version]/reference/[...slug].preview.json'
+import { getStaticPaths as genericPreviewPaths } from '../src/pages/[...slug].preview.json'
describe.each(['3.7c', '3.2a'])('tmux %s through the shared API system', (version) => {
const model = tmuxSourceModel(version)
@@ -116,3 +120,65 @@ it('describes an anonymous C value without converting it to a function signature
expect(text).toContain('window_copy_cmd_table: anonymous struct.')
expect(text).not.toContain('window_copy_cmd_table()')
})
+
+describe('the card a link to a C declaration opens', () => {
+ const origin = 'https://libtmux.org'
+ /** The addresses the preview route answers at: the page's path with `.preview.json`, as the link policy asks for it. */
+ const served = (paths: { params: { version: string; slug: string } }[]) => new Set(paths.map(({ params }) => `/tmux/${params.version}/reference/${params.slug}.preview.json`))
+ /** The links, among `hrefs`, that the policy marks for a card and that no preview address answers. */
+ const unanswered = (hrefs: string[], answered: Set) => hrefs.filter((href) => {
+ const target = linkPreviewTarget(href, origin)
+ return target !== undefined && !answered.has(target.endpoint)
+ })
+ const answered = served(getStaticPaths() as never)
+
+ it('answers for every function, struct, enum, constant and attribute of every version, at the address the policy asks for', () => {
+ expect(TMUX_VERSIONS).toContain('latest')
+ for (const version of TMUX_VERSIONS) {
+ const hrefs = tmuxSourceModel(version).symbols.map((symbol) => tmuxReferenceUrl(version, symbol))
+ expect(hrefs.length, version).toBeGreaterThan(1000)
+ // Every link is marked for a card, so each one must have a payload behind it.
+ expect(hrefs.filter((href) => linkPreviewTarget(href, origin) === undefined), version).toEqual([])
+ expect(unanswered(hrefs, answered), version).toEqual([])
+ }
+ expect(new Set(tmuxSourceModel('latest').symbols.map((symbol) => symbol.kind))).toEqual(new Set(['function', 'struct', 'enum', 'constant', 'attribute', 'typealias', 'union']))
+ })
+
+ it('serves a card for the C function a method links to, with its signature, highlighted as C', async () => {
+ const symbol = tmuxSourceModel('latest').symbols.find((entry) => entry.name === 'cmd_list_panes_server')!
+ const href = tmuxReferenceUrl('latest', symbol)
+ expect(href).toBe('/tmux/latest/reference/c-function-cmd-list-panes-c-cmd_list_panes_server/')
+ const endpoint = linkPreviewTarget(href, origin)!.endpoint
+ expect(endpoint).toBe('/tmux/latest/reference/c-function-cmd-list-panes-c-cmd_list_panes_server.preview.json')
+ const path = getStaticPaths().find(({ params }) => `/tmux/${params.version}/reference/${params.slug}.preview.json` === endpoint)!
+ expect(path).toBeDefined()
+ const response = await GET(path as never)
+ expect(response.headers.get('Content-Type')).toBe('application/json; charset=utf-8')
+ const card = await response.json()
+ // What the browser requires of a payload before it shows a card.
+ expect(card).toMatchObject({ schema: 1, title: 'cmd_list_panes_server', kind: 'function', href, signature: 'static void cmd_list_panes_server(struct cmd *, struct cmdq_item *)', signatureLanguage: 'c' })
+ expect(typeof card.description).toBe('string')
+ expect(new URL(card.href, origin).origin).toBe(origin)
+ expect(card.detail).toMatch(/^Defined in cmd-list-panes\.c, line \d+ of tmux \d/)
+ expect(card.signatureHighlight.language).toBe('c')
+ expect(card.signatureHighlight.lines.map((line: { content: string }[]) => line.map((token) => token.content).join('')).join('\n')).toBe(card.signature)
+ // A macro shows its definition, and a declaration with no signature to show gets a card without one, not an invented one.
+ const model = tmuxSourceModel('latest')
+ const macro = model.symbols.find((entry) => entry.name === 'ARGS_ENTRY_OPTIONAL_VALUE')!
+ expect(tmuxReferencePreview('latest', macro).signature).toBe(macro.signatures[0].raw)
+ const bare = model.symbols.find((entry) => !entry.signatures[0]?.raw && entry.value === undefined)!
+ expect(tmuxReferencePreview('latest', bare)).toMatchObject({ schema: 1, title: bare.name, signature: undefined, signatureLanguage: undefined })
+ })
+
+ it('catches a link with no card behind it, and the preview route that the generic one never covered', () => {
+ const real = tmuxReferenceUrl('latest', tmuxSourceModel('latest').symbols.find((entry) => entry.name === 'cmd_list_panes_server')!)
+ const invented = '/tmux/latest/reference/c-function-no-such-declaration/'
+ // The control: the policy marks the invented address for a card, and nothing answers there.
+ expect(linkPreviewTarget(invented, origin)).toBeDefined()
+ expect(unanswered([real, invented], answered)).toEqual([invented])
+ // Before this route, the generic one was all there was, and it answers at no declaration's address.
+ const generic = new Set(genericPreviewPaths().map((path) => `/${path.params.slug}.preview.json`))
+ expect(generic.size).toBeGreaterThan(100)
+ expect(unanswered([real], generic)).toEqual([real])
+ })
+})
From be201e3f44cd7acdcfe037b3a461ecbf2dc3f394 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Tue, 20 Oct 2026 06:52:17 -0500
Subject: [PATCH 17/53] fix(site[tmux-usage]) Say when a library refuses a
release, and record the sends the review of b8f892310 found missing
why: A review of b8f892310 found that java, kotlin and scala `Pane.paste` and
`Buffers.delete` throw UnsupportedFeatureException before tmux 3.4 (Pane.java:961-964,
:1015-1017; Buffers.java:108-110), though java supports 3.2a and load-buffer,
paste-buffer and delete-buffer exist there, so eleven entries said nothing of
it. The README carved out "a refusal below some release" without saying which:
a command tmux itself lacks needs no `when`, and a command that exists and that
the library will not send does. The same probe found the rule broken in lua
(`Server:delete_buffer` refuses before 3.4) and go (`ConfirmBefore` and
`CommandPrompt` always send `-b`, which tmux has from 3.3). It also found
`Shell.capturing`'s qualifier wrong (the guard refuses every release from 3.3
until 3.5, not "3.3a and 3.4"), go's `tmuxtest.NewSession` kill-session with the
`when` removed in 5c4a7cc2b without a word in its message, ts `main`'s
display-message qualified as minimal-only though an explicit launch sends it
once the server is alive (startup.ts:107-111), java `Main.main` citing the
explicit-socket path rather than the default dedicated one, ruby's
`builtin_spellings` sending list-commands (operations.rb:137) as well as
show-options on every guarded call, and sends that no entry recorded.
what:
- Release refusals: java, kotlin and scala `Pane.paste` (load-buffer,
paste-buffer) and `Buffers.delete` (delete-buffer) say "except before tmux 3.4"
(eleven entries; java carries the condition, the wrappers inherit it), as does
lua's `delete_buffer`; go's `ConfirmBefore` and `CommandPrompt` say "except
before tmux 3.3". `Shell.capturing` says "except from tmux 3.3 until 3.5" in
java, kotlin and scala, with the lines that define both bounds.
- The README states the rule: a command that exists on a supported release and that
the library will not send there says `when`; a command that does not exist
before a release needs none. I applied it to `new-pane` and decided it needs
none: tmux has no such command before 3.7, C# and Go refuse by version before
sending and Python sends and lets tmux refuse, and the command's page is the
manual of the releases that have it. Java's `show-prompt-history` (found missing
in list-commands) is the same. A refusal that depends on an argument is neither.
- go `tmuxtest.NewSession` kill-session has its `when` back ("the test ends, in
t.Cleanup"; resources.go:132-139): the helper registers the kill for the end of the
test, which is not what a call sends, and dropping the qualifier made the entry
read as if it did.
- ts `main`: start-server and show-options stay "a minimal launch, no explicit
selection" (startup.ts:88-89), and display-message is "unless an explicit
launch finds no server". I did not make it unconditional as the review asked: an
explicit launch against an absent server reaches `return` at startup.ts:124
without sending it, so an unconditional entry would be false there. java `main`
cites LaunchConfiguration.java:111, the default dedicated path (every launch
sends it, so no `when`), and records start-server (:106) "the launch chooses no
socket".
- Ruby: list-commands is recorded as incidental on the nine symbols that have
show-options (the six WindowLink methods, Session#kill with its `when`, and both
switch_client), and the `switch_client` exclusion is gone: its reason, that the
caller did not ask for the listing, is the definition of incidental, and the README
says an exclusion is what a default call does not send.
- Sends added: ts `selectWindow` select-window "the target is not last, next or
previous"; scala `cats.Batch.run` display-message (via java); go
`Pane.OpenObservation` list-windows at session scope (control_observation.go:350);
julia `observe_output` list-windows at session scope, and show-options on
`set_option`, `unset_option`, `set_hook` and `unset_hook` as incidental "on a
Server" (their ControlConnection methods read no option rows).
- The README documents `MAX_HOPS` (1) and `MAX_SHARED_BY` (4) as limits on recall, and
how a send they leave out is recorded; it no longer says one condition that every
scope shares follows the command (e2bc03a3b: each scope says its own).
- Tests: the eleven entries and the controls that make the rule mean something
(`Pane.pasteBuffer`, and the `new-pane` entries of csharp, go and py carry no
`when`), the launch conditions, and the ruby pair on the same nine symbols.
Entries 1834 to 1851 (go 227 to 228, java 126 to 127, julia 68 to 73, ruby 109 to
118, scala 188 to 189). Conditions 99 to 122 (go 20 to 23, java 4 to 8, julia 11 to
15, kotlin 4 to 7, lua 3 to 4, ruby 2 to 3, scala 5 to 11, ts 11 to 12).
---
scripts/README.md | 64 +++-
scripts/tmux-usage/claims.json | 533 ++++++++++++++++++++++++++-
scripts/tmux-usage/conditions.json | 243 +++++++++++-
scripts/tmux-usage/exclusions.json | 25 --
site/src/data/tmux-usage/go.json | 18 +-
site/src/data/tmux-usage/java.json | 26 +-
site/src/data/tmux-usage/julia.json | 63 ++++
site/src/data/tmux-usage/kotlin.json | 11 +-
site/src/data/tmux-usage/lua.json | 6 +-
site/src/data/tmux-usage/ruby.json | 98 +++++
site/src/data/tmux-usage/scala.json | 39 +-
site/src/data/tmux-usage/ts.json | 5 +-
site/test/tmux-library-usage.test.ts | 70 +++-
13 files changed, 1138 insertions(+), 63 deletions(-)
diff --git a/scripts/README.md b/scripts/README.md
index 8e7e23e18..549790528 100644
--- a/scripts/README.md
+++ b/scripts/README.md
@@ -255,6 +255,18 @@ type's, a call on a handle named for a type is that type's, and a call on
anything else is left unresolved, so `Pane.split` calling `options.into_command`
is not a call of `CaptureOptions::into_command`.
+Two limits bound what the scan finds, and each is a limit on recall: what it
+leaves out is not recorded unless a claim records it. `MAX_HOPS` is 1: a send
+that a symbol reaches through two helpers is not credited to it (Julia's
+`set_option` reaches the `show-options` that checks the option exists through
+`_configuration_option_rows` and `_configuration_rows`, so it is a claim).
+`MAX_SHARED_BY` is 4: a helper that more than four public symbols reach is not
+credited to any of them, because its callers cannot be told apart (Julia's
+identity probe at `acquisition.jl:50`). `--report` lists what each limit left out
+(`no public symbol reaches it`, `a helper shared by N public symbols`), and a
+send that is what a method is for, or that it makes on every call, belongs in a
+claim.
+
Only public API is recorded: a symbol with an underscore name, a `private`
modifier or an internal scope is left out of the scan and refused in a document.
So is a member whose signature spells a narrower visibility (`protected`,
@@ -290,7 +302,10 @@ negative script seeds a rule that is wrong:
`copy-mode` branch of a helper that `enterCopyMode` shares), or a request
option that a wrapper never sets. Each cites the lines that show the guard,
an exclusion that removes nothing fails, and `commands` limits it to those
- commands of the symbols it names.
+ commands of the symbols it names. A send that every default call makes is not an
+ exclusion, even when the method only makes it to prepare the call: it is
+ `incidental`, as the command-alias inventory a guarded Ruby call reads before
+ it sends is (`show-options` and `list-commands`, on the same nine symbols).
- `dispatchers.json`: the calls that send what they are given, per port, and the
calls that only build a command value. Each cites the lines of the pinned
source that show it and, for a call that sends, the chain from there to a
@@ -325,16 +340,41 @@ negative script seeds a rule that is wrong:
A `when` is at most eight words on one line, because the usage table shows it
beside the method (a muted qualifier on the chip, and after the command link on
a method page); a longer reason belongs on a page. An entry that is conditional
-cannot be rendered without it. When a command is sent at two scopes under two
-conditions, each scope says its own beside it; one condition that every scope
-shares follows the command. Writing a `when` for a condition that is always true
-of the method (`Hooks#unset` sending `set-hook` "on a Hooks") qualifies nothing.
+cannot be rendered without it. Each scope of a send says its own condition: on a
+method page the item for that scope ends with it in parentheses
+(`list-panes -s, cmd_list_panes_session (the spec names a first window)`), in the
+Markdown the scope is followed by its own parenthesis, and in the usage table it
+sits beside the chip. A command sent at two scopes under two conditions says each
+beside its own scope, and a condition that every scope shares is said again on each,
+so that no item has to be read with another. Writing a `when` for a condition that
+is always true of the method (`Hooks#unset` sending `set-hook` "on a Hooks")
+qualifies nothing.
The same rule applies to a tmux release. A send made on every supported release
-but some says which in `when` (`Shell.capturing` refuses on 3.3a and 3.4: "except
-on tmux 3.3a and 3.4"). A send made on one release only, such as the rename that
-`breakOut` adds on tmux 3.7 to give the window the name that release ignores, is
-an exclusion, because it is not what a call does on the others.
+but some says which in `when`. That includes a command that exists on a supported
+release and that the library refuses to send there:
+
+- `Shell.capturing` refuses from tmux 3.3 until 3.5, a range (the guard is
+ `atLeast(3.3) && !atLeast(3.5)`, so 3.3, 3.3a and 3.4 all refuse): "except from
+ tmux 3.3 until 3.5".
+- `Pane.paste` and `Buffers.delete` refuse before 3.4, where deleting a buffer by
+ name can remove another, so `load-buffer`, `paste-buffer` and `delete-buffer`
+ say "except before tmux 3.4" in Java, Kotlin and Scala, and so does Lua's
+ `Server:delete_buffer`. Go's `ConfirmBefore` and `CommandPrompt` always send
+ `-b`, which tmux has from 3.3, and refuse before it: "except before tmux 3.3".
+
+A command that does not exist before a release needs no `when`. tmux has no
+`new-pane` before 3.7, so the `new-pane` entries of C# and Go (which refuse by
+version before sending) and of Python (which sends it and lets tmux refuse) carry
+none, and neither does a command the library finds missing in `list-commands`
+(Java's `show-prompt-history`): the command's page is the manual of the releases
+that have it, and a method does not send the command on a release that lacks it
+in a way that differs from what it does on the others. A refusal that depends on
+an argument (a layout preset, a client filter, a flag newer than the release) is
+not what a default call does, and is neither a `when` nor an entry. A send made on
+one release only, such as the rename that `breakOut` adds on tmux 3.7 to give the
+window the name that release ignores, is an exclusion, because it is not what a
+call does on the others.
Go's wrappers that call a method of another type on a handle named for it
(`p.server.X()`) are credited with that method's entries, as a wrapper on a core
@@ -358,8 +398,10 @@ is `version-gated`, and is recorded as neither; its review cites the gate, both
branches and the line that sets the supported floor below the gate, so that the
range the gate splits is shown to be supported. When a later revision raises the
floor past the gate, the fallback is gone and the method is recorded as sending
-the command that remains. A refusal below some release (`new-pane` before 3.7) is
-not a gate of this kind: the method sends that command whenever it sends.
+the command that remains. A refusal below some release is not a gate of this kind,
+because no other command takes its place: the entry says `when` if the command
+exists on the releases it refuses, and says nothing if the command does not exist
+there (above).
A claim, an exclusion or a review without a `revision` is read against the
revision its port's model was extracted from. One with a `revision` is read
diff --git a/scripts/tmux-usage/claims.json b/scripts/tmux-usage/claims.json
index 9ff10acf9..0d2fa8c3b 100644
--- a/scripts/tmux-usage/claims.json
+++ b/scripts/tmux-usage/claims.json
@@ -2013,7 +2013,7 @@
"symbol": "mcp.server.main",
"command": "display-message",
"scope": null,
- "when": "a minimal launch, no explicit selection",
+ "when": "unless an explicit launch finds no server",
"evidence": [
{
"at": "packages/mcp/src/startup.ts:92",
@@ -8878,6 +8878,7 @@
"symbol": "libtmux.Server:delete_buffer",
"command": "delete-buffer",
"scope": null,
+ "when": "except before tmux 3.4",
"evidence": [
{
"at": "lua/libtmux/_internal/buffer.lua:9",
@@ -8897,6 +8898,12 @@
"\"delete\""
],
"in": "libtmux.Server:delete_buffer"
+ },
+ {
+ "at": "lua/libtmux/_internal/buffer.lua:125",
+ "has": [
+ "kind == \"delete\" and version < 4"
+ ]
}
]
},
@@ -10066,6 +10073,26 @@
}
]
},
+ {
+ "port": "scala",
+ "symbol": "io.github.libtmux.scaladsl.cats.Batch.run",
+ "command": "display-message",
+ "scope": null,
+ "when": "the batch is not empty",
+ "via": {
+ "port": "java",
+ "symbol": "io.github.libtmux.batch.Batch.Batch.run"
+ },
+ "evidence": [
+ {
+ "at": "libtmux-scala-cats/src/main/scala/io/github/libtmux/scaladsl/cats/Batch.scala:26",
+ "has": [
+ "build().run()"
+ ],
+ "in": "io.github.libtmux.scaladsl.cats.Batch.run"
+ }
+ ]
+ },
{
"port": "ruby",
"symbol": "LibTmux::Server#attach",
@@ -10223,6 +10250,7 @@
"symbol": "tmuxtest.NewSession",
"command": "kill-session",
"scope": null,
+ "when": "the test ends, in t.Cleanup",
"evidence": [
{
"at": "tmux/tmuxtest/resources.go:135",
@@ -10813,6 +10841,181 @@
}
]
},
+ {
+ "port": "julia",
+ "symbol": "LibTmux.set_option",
+ "command": "show-options",
+ "scope": null,
+ "incidental": true,
+ "when": "on a Server",
+ "evidence": [
+ {
+ "at": "src/configuration.jl:159",
+ "has": [
+ "\"show-options\""
+ ]
+ },
+ {
+ "at": "src/configuration.jl:160",
+ "has": [
+ "_operation_command(context, args...)"
+ ]
+ },
+ {
+ "at": "src/configuration.jl:176",
+ "has": [
+ "_configuration_rows(context, scope, name)"
+ ]
+ },
+ {
+ "at": "src/configuration.jl:279",
+ "has": [
+ "_configuration_option_rows(context, scope, args.name)"
+ ],
+ "in": "LibTmux.set_option"
+ }
+ ]
+ },
+ {
+ "port": "julia",
+ "symbol": "LibTmux.unset_option",
+ "command": "show-options",
+ "scope": null,
+ "incidental": true,
+ "when": "on a Server",
+ "evidence": [
+ {
+ "at": "src/configuration.jl:159",
+ "has": [
+ "\"show-options\""
+ ]
+ },
+ {
+ "at": "src/configuration.jl:160",
+ "has": [
+ "_operation_command(context, args...)"
+ ]
+ },
+ {
+ "at": "src/configuration.jl:176",
+ "has": [
+ "_configuration_rows(context, scope, name)"
+ ]
+ },
+ {
+ "at": "src/configuration.jl:292",
+ "has": [
+ "_configuration_option_rows(context, scope, args.name)"
+ ],
+ "in": "LibTmux.unset_option"
+ }
+ ]
+ },
+ {
+ "port": "julia",
+ "symbol": "LibTmux.set_hook",
+ "command": "show-options",
+ "scope": null,
+ "incidental": true,
+ "when": "on a Server",
+ "evidence": [
+ {
+ "at": "src/configuration.jl:159",
+ "has": [
+ "\"show-options\""
+ ]
+ },
+ {
+ "at": "src/configuration.jl:160",
+ "has": [
+ "_operation_command(context, args...)"
+ ]
+ },
+ {
+ "at": "src/configuration.jl:176",
+ "has": [
+ "_configuration_rows(context, scope, name)"
+ ]
+ },
+ {
+ "at": "src/configuration.jl:403",
+ "has": [
+ "_configuration_option_rows(context, scope, name)"
+ ]
+ },
+ {
+ "at": "src/configuration.jl:477",
+ "has": [
+ "_configuration_hook_rows(context, scope, args.name)"
+ ],
+ "in": "LibTmux.set_hook"
+ }
+ ]
+ },
+ {
+ "port": "julia",
+ "symbol": "LibTmux.unset_hook",
+ "command": "show-options",
+ "scope": null,
+ "incidental": true,
+ "when": "on a Server",
+ "evidence": [
+ {
+ "at": "src/configuration.jl:159",
+ "has": [
+ "\"show-options\""
+ ]
+ },
+ {
+ "at": "src/configuration.jl:160",
+ "has": [
+ "_operation_command(context, args...)"
+ ]
+ },
+ {
+ "at": "src/configuration.jl:176",
+ "has": [
+ "_configuration_rows(context, scope, name)"
+ ]
+ },
+ {
+ "at": "src/configuration.jl:403",
+ "has": [
+ "_configuration_option_rows(context, scope, name)"
+ ]
+ },
+ {
+ "at": "src/configuration.jl:485",
+ "has": [
+ "_configuration_hook_rows(context, scope, args.name)"
+ ],
+ "in": "LibTmux.unset_hook"
+ }
+ ]
+ },
+ {
+ "port": "julia",
+ "symbol": "LibTmux.observe_output",
+ "command": "list-windows",
+ "scope": "session",
+ "evidence": [
+ {
+ "at": "src/observation.jl:503",
+ "has": [
+ "_control_rows(",
+ "\"list-windows\""
+ ],
+ "span": 4
+ },
+ {
+ "at": "src/observation.jl:535",
+ "has": [
+ "_observation_target(connection, pane, started, timeout, cancel)"
+ ],
+ "in": "LibTmux.observe_output"
+ }
+ ]
+ },
{
"port": "cxx",
"symbol": "libtmux::Connection::set_pane_output",
@@ -12605,6 +12808,61 @@
],
"incidental": true
},
+ {
+ "port": "java",
+ "symbol": "io.github.libtmux.mcp.Main.Main.main",
+ "command": "start-server",
+ "scope": null,
+ "when": "the launch chooses no socket",
+ "evidence": [
+ {
+ "at": "libtmux-mcp/src/main/java/io/github/libtmux/mcp/LaunchConfiguration.java:106",
+ "has": [
+ "server.cmd(\"start-server\""
+ ]
+ },
+ {
+ "at": "libtmux-mcp/src/main/java/io/github/libtmux/mcp/LaunchConfiguration.java:88",
+ "has": [
+ "dedicatedProfile(server)"
+ ]
+ },
+ {
+ "at": "libtmux-mcp/src/main/java/io/github/libtmux/mcp/Main.java:52",
+ "has": [
+ "launch.profile(server)"
+ ],
+ "in": "io.github.libtmux.mcp.Main.Main.main"
+ }
+ ]
+ },
+ {
+ "port": "java",
+ "symbol": "io.github.libtmux.mcp.Main.Main.main",
+ "command": "display-message",
+ "scope": null,
+ "evidence": [
+ {
+ "at": "libtmux-mcp/src/main/java/io/github/libtmux/mcp/LaunchConfiguration.java:111",
+ "has": [
+ "server.cmd(\"display-message\""
+ ]
+ },
+ {
+ "at": "libtmux-mcp/src/main/java/io/github/libtmux/mcp/LaunchConfiguration.java:88",
+ "has": [
+ "dedicatedProfile(server)"
+ ]
+ },
+ {
+ "at": "libtmux-mcp/src/main/java/io/github/libtmux/mcp/Main.java:52",
+ "has": [
+ "launch.profile(server)"
+ ],
+ "in": "io.github.libtmux.mcp.Main.Main.main"
+ }
+ ]
+ },
{
"port": "go",
"symbol": "tmux.Server.SearchSessions",
@@ -12989,6 +13247,29 @@
],
"incidental": true
},
+ {
+ "port": "go",
+ "symbol": "tmux.Pane.OpenObservation",
+ "command": "list-windows",
+ "scope": "session",
+ "evidence": [
+ {
+ "at": "tmux/control_observation.go:346",
+ "has": [
+ "c.cmd(",
+ "\"list-windows\""
+ ],
+ "span": 9
+ },
+ {
+ "at": "tmux/control_observation.go:301",
+ "has": [
+ "client.observePane(ctx, p)"
+ ],
+ "in": "tmux.Pane.OpenObservation"
+ }
+ ]
+ },
{
"port": "ruby",
"symbol": "LibTmux::WindowLink#display",
@@ -13029,6 +13310,35 @@
}
]
},
+ {
+ "port": "ruby",
+ "symbol": "LibTmux::WindowLink#display",
+ "command": "list-commands",
+ "scope": null,
+ "incidental": true,
+ "evidence": [
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:137",
+ "has": [
+ "\"list-commands\"",
+ "execute_typed("
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:113",
+ "has": [
+ "builtin_spellings(\"if-shell\", \"display-message\", command"
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/entity.rb:245",
+ "has": [
+ "__send__(:execute_link"
+ ],
+ "in": "LibTmux::WindowLink#display"
+ }
+ ]
+ },
{
"port": "ruby",
"symbol": "LibTmux::WindowLink#kill",
@@ -13069,6 +13379,35 @@
}
]
},
+ {
+ "port": "ruby",
+ "symbol": "LibTmux::WindowLink#kill",
+ "command": "list-commands",
+ "scope": null,
+ "incidental": true,
+ "evidence": [
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:137",
+ "has": [
+ "\"list-commands\"",
+ "execute_typed("
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:113",
+ "has": [
+ "builtin_spellings(\"if-shell\", \"display-message\", command"
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/entity.rb:228",
+ "has": [
+ "__send__(:execute_link"
+ ],
+ "in": "LibTmux::WindowLink#kill"
+ }
+ ]
+ },
{
"port": "ruby",
"symbol": "LibTmux::WindowLink#move",
@@ -13109,6 +13448,35 @@
}
]
},
+ {
+ "port": "ruby",
+ "symbol": "LibTmux::WindowLink#move",
+ "command": "list-commands",
+ "scope": null,
+ "incidental": true,
+ "evidence": [
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:137",
+ "has": [
+ "\"list-commands\"",
+ "execute_typed("
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:113",
+ "has": [
+ "builtin_spellings(\"if-shell\", \"display-message\", command"
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/entity.rb:235",
+ "has": [
+ "__send__(:execute_link"
+ ],
+ "in": "LibTmux::WindowLink#move"
+ }
+ ]
+ },
{
"port": "ruby",
"symbol": "LibTmux::WindowLink#select",
@@ -13149,6 +13517,35 @@
}
]
},
+ {
+ "port": "ruby",
+ "symbol": "LibTmux::WindowLink#select",
+ "command": "list-commands",
+ "scope": null,
+ "incidental": true,
+ "evidence": [
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:137",
+ "has": [
+ "\"list-commands\"",
+ "execute_typed("
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:113",
+ "has": [
+ "builtin_spellings(\"if-shell\", \"display-message\", command"
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/entity.rb:220",
+ "has": [
+ "__send__(:execute_link"
+ ],
+ "in": "LibTmux::WindowLink#select"
+ }
+ ]
+ },
{
"port": "ruby",
"symbol": "LibTmux::WindowLink#swap",
@@ -13189,6 +13586,35 @@
}
]
},
+ {
+ "port": "ruby",
+ "symbol": "LibTmux::WindowLink#swap",
+ "command": "list-commands",
+ "scope": null,
+ "incidental": true,
+ "evidence": [
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:137",
+ "has": [
+ "\"list-commands\"",
+ "execute_typed("
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:113",
+ "has": [
+ "builtin_spellings(\"if-shell\", \"display-message\", command"
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/entity.rb:240",
+ "has": [
+ "__send__(:execute_link"
+ ],
+ "in": "LibTmux::WindowLink#swap"
+ }
+ ]
+ },
{
"port": "ruby",
"symbol": "LibTmux::WindowLink#unlink",
@@ -13229,6 +13655,35 @@
}
]
},
+ {
+ "port": "ruby",
+ "symbol": "LibTmux::WindowLink#unlink",
+ "command": "list-commands",
+ "scope": null,
+ "incidental": true,
+ "evidence": [
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:137",
+ "has": [
+ "\"list-commands\"",
+ "execute_typed("
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:113",
+ "has": [
+ "builtin_spellings(\"if-shell\", \"display-message\", command"
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/entity.rb:224",
+ "has": [
+ "__send__(:execute_link"
+ ],
+ "in": "LibTmux::WindowLink#unlink"
+ }
+ ]
+ },
{
"port": "ruby",
"symbol": "LibTmux::Session#kill",
@@ -13270,6 +13725,36 @@
}
]
},
+ {
+ "port": "ruby",
+ "symbol": "LibTmux::Session#kill",
+ "command": "list-commands",
+ "scope": null,
+ "incidental": true,
+ "when": "expected windows or panes are given",
+ "evidence": [
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:137",
+ "has": [
+ "\"list-commands\"",
+ "execute_typed("
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:165",
+ "has": [
+ "builtin_spellings(\"if-shell\", \"display-message\", \"kill-session\""
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:257",
+ "has": [
+ "kill_session_with_windows"
+ ],
+ "in": "LibTmux::Session#kill"
+ }
+ ]
+ },
{
"port": "ruby",
"symbol": "LibTmux::Server#switch_client",
@@ -13304,6 +13789,29 @@
}
]
},
+ {
+ "port": "ruby",
+ "symbol": "LibTmux::Server#switch_client",
+ "command": "list-commands",
+ "scope": null,
+ "incidental": true,
+ "evidence": [
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:137",
+ "has": [
+ "\"list-commands\"",
+ "execute_typed("
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/terminal.rb:41",
+ "has": [
+ "builtin_spellings(\"switch-client\""
+ ],
+ "in": "LibTmux::Server#switch_client"
+ }
+ ]
+ },
{
"port": "ruby",
"symbol": "LibTmux::Async::Server#switch_client",
@@ -13337,6 +13845,29 @@
"in": "LibTmux::Async::Server#switch_client"
}
]
+ },
+ {
+ "port": "ruby",
+ "symbol": "LibTmux::Async::Server#switch_client",
+ "command": "list-commands",
+ "scope": null,
+ "incidental": true,
+ "evidence": [
+ {
+ "at": "gems/libtmux/lib/libtmux/operations.rb:137",
+ "has": [
+ "\"list-commands\"",
+ "execute_typed("
+ ]
+ },
+ {
+ "at": "gems/libtmux/lib/libtmux/terminal.rb:41",
+ "has": [
+ "builtin_spellings(\"switch-client\""
+ ],
+ "in": "LibTmux::Async::Server#switch_client"
+ }
+ ]
}
]
}
diff --git a/scripts/tmux-usage/conditions.json b/scripts/tmux-usage/conditions.json
index 59194c791..3d291ea79 100644
--- a/scripts/tmux-usage/conditions.json
+++ b/scripts/tmux-usage/conditions.json
@@ -430,8 +430,22 @@
"symbol": "io.github.libtmux.Shell.Shell.capturing",
"command": "run-shell",
"scope": null,
- "when": "except on tmux 3.3a and 3.4",
+ "when": "except from tmux 3.3 until 3.5",
"evidence": [
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Shell.java:22",
+ "has": [
+ "OUTPUT_LOST",
+ "new TmuxVersion(3, 3"
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Shell.java:24",
+ "has": [
+ "OUTPUT_FOUND",
+ "new TmuxVersion(3, 5"
+ ]
+ },
{
"at": "libtmux/src/main/java/io/github/libtmux/Shell.java:50",
"has": [
@@ -479,6 +493,233 @@
]
}
]
+ },
+ {
+ "port": "java",
+ "symbol": "io.github.libtmux.Pane.Pane.paste",
+ "command": "load-buffer",
+ "scope": null,
+ "when": "except before tmux 3.4",
+ "evidence": [
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Pane.java:962",
+ "has": [
+ "running.atLeast(Buffers.EXACT_NAMED_DELETE)"
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Pane.java:963",
+ "has": [
+ "throw new UnsupportedFeatureException("
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Buffers.java:36",
+ "has": [
+ "EXACT_NAMED_DELETE",
+ "new TmuxVersion(3, 4"
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Pane.java:971",
+ "has": [
+ "server.runTogether("
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Pane.java:1015",
+ "has": [
+ "running.atLeast(Buffers.EXACT_NAMED_DELETE)"
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Pane.java:1016",
+ "has": [
+ "throw new UnsupportedFeatureException("
+ ]
+ }
+ ]
+ },
+ {
+ "port": "java",
+ "symbol": "io.github.libtmux.Pane.Pane.paste",
+ "command": "paste-buffer",
+ "scope": null,
+ "when": "except before tmux 3.4",
+ "evidence": [
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Pane.java:962",
+ "has": [
+ "running.atLeast(Buffers.EXACT_NAMED_DELETE)"
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Pane.java:963",
+ "has": [
+ "throw new UnsupportedFeatureException("
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Buffers.java:36",
+ "has": [
+ "EXACT_NAMED_DELETE",
+ "new TmuxVersion(3, 4"
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Pane.java:971",
+ "has": [
+ "server.runTogether("
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Pane.java:1015",
+ "has": [
+ "running.atLeast(Buffers.EXACT_NAMED_DELETE)"
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Pane.java:1016",
+ "has": [
+ "throw new UnsupportedFeatureException("
+ ]
+ }
+ ]
+ },
+ {
+ "port": "java",
+ "symbol": "io.github.libtmux.Buffers.Buffers.delete",
+ "command": "delete-buffer",
+ "scope": null,
+ "when": "except before tmux 3.4",
+ "evidence": [
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Buffers.java:108",
+ "has": [
+ "running.atLeast(EXACT_NAMED_DELETE)"
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Buffers.java:109",
+ "has": [
+ "throw new UnsupportedFeatureException("
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Buffers.java:36",
+ "has": [
+ "EXACT_NAMED_DELETE",
+ "new TmuxVersion(3, 4"
+ ]
+ },
+ {
+ "at": "libtmux/src/main/java/io/github/libtmux/Buffers.java:111",
+ "has": [
+ "\"delete-buffer\""
+ ]
+ }
+ ]
+ },
+ {
+ "port": "ts",
+ "symbol": "session.Session.selectWindow",
+ "command": "select-window",
+ "scope": null,
+ "when": "the target is not last, next or previous",
+ "evidence": [
+ {
+ "at": "packages/libtmux/src/_internal/operations/session_nav.ts:34",
+ "has": [
+ "target === \"last\""
+ ]
+ },
+ {
+ "at": "packages/libtmux/src/_internal/operations/session_nav.ts:35",
+ "has": [
+ "target === \"next\""
+ ]
+ },
+ {
+ "at": "packages/libtmux/src/_internal/operations/session_nav.ts:36",
+ "has": [
+ "target === \"previous\""
+ ]
+ },
+ {
+ "at": "packages/libtmux/src/_internal/operations/session_nav.ts:40",
+ "has": [
+ "\"select-window\""
+ ]
+ }
+ ]
+ },
+ {
+ "port": "go",
+ "symbol": "tmux.Server.ConfirmBefore",
+ "command": "confirm-before",
+ "scope": null,
+ "when": "except before tmux 3.3",
+ "evidence": [
+ {
+ "at": "tmux/server_interactive.go:9",
+ "has": [
+ "serverInteractiveVersion33",
+ "raw: \"3.3\""
+ ]
+ },
+ {
+ "at": "tmux/server_interactive.go:192",
+ "has": [
+ "current.AtLeast(serverInteractiveVersion33)"
+ ]
+ },
+ {
+ "at": "tmux/server_interactive.go:193",
+ "has": [
+ "&VersionTooLowError{"
+ ]
+ },
+ {
+ "at": "tmux/server_interactive.go:223",
+ "has": [
+ "s.literalCmd(ctx, arguments...)"
+ ]
+ }
+ ]
+ },
+ {
+ "port": "go",
+ "symbol": "tmux.Server.CommandPrompt",
+ "command": "command-prompt",
+ "scope": null,
+ "when": "except before tmux 3.3",
+ "evidence": [
+ {
+ "at": "tmux/server_interactive.go:9",
+ "has": [
+ "serverInteractiveVersion33",
+ "raw: \"3.3\""
+ ]
+ },
+ {
+ "at": "tmux/server_interactive.go:240",
+ "has": [
+ "current.AtLeast(serverInteractiveVersion33)"
+ ]
+ },
+ {
+ "at": "tmux/server_interactive.go:241",
+ "has": [
+ "&VersionTooLowError{"
+ ]
+ },
+ {
+ "at": "tmux/server_interactive.go:301",
+ "has": [
+ "s.literalCmd(ctx, arguments...)"
+ ]
+ }
+ ]
}
]
}
diff --git a/scripts/tmux-usage/exclusions.json b/scripts/tmux-usage/exclusions.json
index 49c63a454..1d86aed8a 100644
--- a/scripts/tmux-usage/exclusions.json
+++ b/scripts/tmux-usage/exclusions.json
@@ -405,31 +405,6 @@
}
]
},
- {
- "port": "ruby",
- "owner": "Server",
- "names": [
- "switch_client"
- ],
- "commands": [
- "list-commands"
- ],
- "why": "switch_client asks list-commands which spelling of switch-client a configured command-alias leaves alone, as a fence before the command it sends; the caller did not ask for the listing.",
- "evidence": [
- {
- "at": "gems/libtmux/lib/libtmux/terminal.rb:41",
- "has": [
- "builtin_spellings(\"switch-client\""
- ]
- },
- {
- "at": "gems/libtmux/lib/libtmux/operations.rb:137",
- "has": [
- "\"list-commands\""
- ]
- }
- ]
- },
{
"port": "ts",
"owner": "Pane",
diff --git a/site/src/data/tmux-usage/go.json b/site/src/data/tmux-usage/go.json
index 2b907cac6..0cfca0dde 100644
--- a/site/src/data/tmux-usage/go.json
+++ b/site/src/data/tmux-usage/go.json
@@ -745,6 +745,15 @@
],
"scope": null
},
+ {
+ "command": "list-windows",
+ "evidence": [
+ "tmux/control_observation.go:346",
+ "tmux/control_observation.go:301"
+ ],
+ "reviewed": true,
+ "scope": "session"
+ },
{
"command": "refresh-client",
"evidence": [
@@ -1176,7 +1185,8 @@
"evidence": [
"tmux/server_interactive.go:301"
],
- "scope": null
+ "scope": null,
+ "when": "except before tmux 3.3"
}
],
"tmux.Server.ConfirmBefore": [
@@ -1185,7 +1195,8 @@
"evidence": [
"tmux/server_interactive.go:223"
],
- "scope": null
+ "scope": null,
+ "when": "except before tmux 3.3"
}
],
"tmux.Server.DeleteBuffer": [
@@ -2685,7 +2696,8 @@
"tmux/tmuxtest/resources.go:56"
],
"reviewed": true,
- "scope": null
+ "scope": null,
+ "when": "the test ends, in t.Cleanup"
},
{
"command": "new-session",
diff --git a/site/src/data/tmux-usage/java.json b/site/src/data/tmux-usage/java.json
index 3a3e7ddcb..4216348c7 100644
--- a/site/src/data/tmux-usage/java.json
+++ b/site/src/data/tmux-usage/java.json
@@ -118,7 +118,8 @@
"evidence": [
"libtmux/src/main/java/io/github/libtmux/Buffers.java:111"
],
- "scope": null
+ "scope": null,
+ "when": "except before tmux 3.4"
}
],
"io.github.libtmux.Buffers.Buffers.list": [
@@ -484,10 +485,23 @@
{
"command": "display-message",
"evidence": [
- "libtmux-mcp/src/main/java/io/github/libtmux/mcp/LaunchConfiguration.java:90",
+ "libtmux-mcp/src/main/java/io/github/libtmux/mcp/LaunchConfiguration.java:111",
+ "libtmux-mcp/src/main/java/io/github/libtmux/mcp/LaunchConfiguration.java:88",
"libtmux-mcp/src/main/java/io/github/libtmux/mcp/Main.java:52"
],
+ "reviewed": true,
"scope": null
+ },
+ {
+ "command": "start-server",
+ "evidence": [
+ "libtmux-mcp/src/main/java/io/github/libtmux/mcp/LaunchConfiguration.java:106",
+ "libtmux-mcp/src/main/java/io/github/libtmux/mcp/LaunchConfiguration.java:88",
+ "libtmux-mcp/src/main/java/io/github/libtmux/mcp/Main.java:52"
+ ],
+ "reviewed": true,
+ "scope": null,
+ "when": "the launch chooses no socket"
}
],
"io.github.libtmux.MessageLog.MessageLog.lines": [
@@ -688,14 +702,16 @@
"evidence": [
"libtmux/src/main/java/io/github/libtmux/Pane.java:971"
],
- "scope": null
+ "scope": null,
+ "when": "except before tmux 3.4"
},
{
"command": "paste-buffer",
"evidence": [
"libtmux/src/main/java/io/github/libtmux/Pane.java:971"
],
- "scope": null
+ "scope": null,
+ "when": "except before tmux 3.4"
}
],
"io.github.libtmux.Pane.Pane.pasteBuffer": [
@@ -1162,7 +1178,7 @@
"libtmux/src/main/java/io/github/libtmux/Shell.java:55"
],
"scope": null,
- "when": "except on tmux 3.3a and 3.4"
+ "when": "except from tmux 3.3 until 3.5"
}
],
"io.github.libtmux.Shell.Shell.choose": [
diff --git a/site/src/data/tmux-usage/julia.json b/site/src/data/tmux-usage/julia.json
index 4ec59bfd3..22d9f8011 100644
--- a/site/src/data/tmux-usage/julia.json
+++ b/site/src/data/tmux-usage/julia.json
@@ -326,6 +326,15 @@
],
"scope": null
},
+ {
+ "command": "list-windows",
+ "evidence": [
+ "src/observation.jl:503",
+ "src/observation.jl:535"
+ ],
+ "reviewed": true,
+ "scope": "session"
+ },
{
"command": "refresh-client",
"evidence": [
@@ -572,6 +581,20 @@
"src/configuration.jl:478"
],
"scope": null
+ },
+ {
+ "command": "show-options",
+ "evidence": [
+ "src/configuration.jl:159",
+ "src/configuration.jl:160",
+ "src/configuration.jl:176",
+ "src/configuration.jl:403",
+ "src/configuration.jl:477"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null,
+ "when": "on a Server"
}
],
"LibTmux.set_option": [
@@ -581,6 +604,19 @@
"src/configuration.jl:280"
],
"scope": null
+ },
+ {
+ "command": "show-options",
+ "evidence": [
+ "src/configuration.jl:159",
+ "src/configuration.jl:160",
+ "src/configuration.jl:176",
+ "src/configuration.jl:279"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null,
+ "when": "on a Server"
}
],
"LibTmux.snapshot": [
@@ -728,6 +764,20 @@
"src/configuration.jl:486"
],
"scope": null
+ },
+ {
+ "command": "show-options",
+ "evidence": [
+ "src/configuration.jl:159",
+ "src/configuration.jl:160",
+ "src/configuration.jl:176",
+ "src/configuration.jl:403",
+ "src/configuration.jl:485"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null,
+ "when": "on a Server"
}
],
"LibTmux.unset_option": [
@@ -737,6 +787,19 @@
"src/configuration.jl:293"
],
"scope": null
+ },
+ {
+ "command": "show-options",
+ "evidence": [
+ "src/configuration.jl:159",
+ "src/configuration.jl:160",
+ "src/configuration.jl:176",
+ "src/configuration.jl:292"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null,
+ "when": "on a Server"
}
]
}
diff --git a/site/src/data/tmux-usage/kotlin.json b/site/src/data/tmux-usage/kotlin.json
index 691843a2f..65ab18820 100644
--- a/site/src/data/tmux-usage/kotlin.json
+++ b/site/src/data/tmux-usage/kotlin.json
@@ -153,7 +153,8 @@
"port": "java",
"revision": "a0ecbc16da00140e2520462d478a2af470878272",
"symbol": "io.github.libtmux.Buffers.Buffers.delete"
- }
+ },
+ "when": "except before tmux 3.4"
}
],
"io.github.libtmux.kotlin.Buffers.list": [
@@ -1031,7 +1032,8 @@
"port": "java",
"revision": "a0ecbc16da00140e2520462d478a2af470878272",
"symbol": "io.github.libtmux.Pane.Pane.paste"
- }
+ },
+ "when": "except before tmux 3.4"
},
{
"command": "paste-buffer",
@@ -1047,7 +1049,8 @@
"port": "java",
"revision": "a0ecbc16da00140e2520462d478a2af470878272",
"symbol": "io.github.libtmux.Pane.Pane.paste"
- }
+ },
+ "when": "except before tmux 3.4"
}
],
"io.github.libtmux.kotlin.Pane.pasteBuffer": [
@@ -1928,7 +1931,7 @@
"revision": "a0ecbc16da00140e2520462d478a2af470878272",
"symbol": "io.github.libtmux.Shell.Shell.capturing"
},
- "when": "except on tmux 3.3a and 3.4"
+ "when": "except from tmux 3.3 until 3.5"
}
],
"io.github.libtmux.kotlin.Shell.choose": [
diff --git a/site/src/data/tmux-usage/lua.json b/site/src/data/tmux-usage/lua.json
index 8e4f7c1e4..e9ab254ce 100644
--- a/site/src/data/tmux-usage/lua.json
+++ b/site/src/data/tmux-usage/lua.json
@@ -413,10 +413,12 @@
"evidence": [
"lua/libtmux/_internal/buffer.lua:9",
"lua/libtmux/_internal/buffer.lua:140",
- "lua/libtmux/_internal/server.lua:448"
+ "lua/libtmux/_internal/server.lua:448",
+ "lua/libtmux/_internal/buffer.lua:125"
],
"reviewed": true,
- "scope": null
+ "scope": null,
+ "when": "except before tmux 3.4"
}
],
"libtmux.Server:detach_client": [
diff --git a/site/src/data/tmux-usage/ruby.json b/site/src/data/tmux-usage/ruby.json
index d459e458e..ae76886be 100644
--- a/site/src/data/tmux-usage/ruby.json
+++ b/site/src/data/tmux-usage/ruby.json
@@ -305,6 +305,16 @@
}
],
"LibTmux::Async::Server#switch_client": [
+ {
+ "command": "list-commands",
+ "evidence": [
+ "gems/libtmux/lib/libtmux/operations.rb:137",
+ "gems/libtmux/lib/libtmux/terminal.rb:41"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null
+ },
{
"command": "show-options",
"evidence": [
@@ -818,6 +828,16 @@
}
],
"LibTmux::Server#switch_client": [
+ {
+ "command": "list-commands",
+ "evidence": [
+ "gems/libtmux/lib/libtmux/operations.rb:137",
+ "gems/libtmux/lib/libtmux/terminal.rb:41"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null
+ },
{
"command": "show-options",
"evidence": [
@@ -899,6 +919,18 @@
"reviewed": true,
"scope": null
},
+ {
+ "command": "list-commands",
+ "evidence": [
+ "gems/libtmux/lib/libtmux/operations.rb:137",
+ "gems/libtmux/lib/libtmux/operations.rb:165",
+ "gems/libtmux/lib/libtmux/operations.rb:257"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null,
+ "when": "expected windows or panes are given"
+ },
{
"command": "show-options",
"evidence": [
@@ -1074,6 +1106,17 @@
],
"scope": null
},
+ {
+ "command": "list-commands",
+ "evidence": [
+ "gems/libtmux/lib/libtmux/operations.rb:137",
+ "gems/libtmux/lib/libtmux/operations.rb:113",
+ "gems/libtmux/lib/libtmux/entity.rb:245"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null
+ },
{
"command": "show-options",
"evidence": [
@@ -1096,6 +1139,17 @@
],
"scope": null
},
+ {
+ "command": "list-commands",
+ "evidence": [
+ "gems/libtmux/lib/libtmux/operations.rb:137",
+ "gems/libtmux/lib/libtmux/operations.rb:113",
+ "gems/libtmux/lib/libtmux/entity.rb:228"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null
+ },
{
"command": "show-options",
"evidence": [
@@ -1111,6 +1165,17 @@
}
],
"LibTmux::WindowLink#move": [
+ {
+ "command": "list-commands",
+ "evidence": [
+ "gems/libtmux/lib/libtmux/operations.rb:137",
+ "gems/libtmux/lib/libtmux/operations.rb:113",
+ "gems/libtmux/lib/libtmux/entity.rb:235"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null
+ },
{
"command": "move-window",
"evidence": [
@@ -1133,6 +1198,17 @@
}
],
"LibTmux::WindowLink#select": [
+ {
+ "command": "list-commands",
+ "evidence": [
+ "gems/libtmux/lib/libtmux/operations.rb:137",
+ "gems/libtmux/lib/libtmux/operations.rb:113",
+ "gems/libtmux/lib/libtmux/entity.rb:220"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null
+ },
{
"command": "select-window",
"evidence": [
@@ -1155,6 +1231,17 @@
}
],
"LibTmux::WindowLink#swap": [
+ {
+ "command": "list-commands",
+ "evidence": [
+ "gems/libtmux/lib/libtmux/operations.rb:137",
+ "gems/libtmux/lib/libtmux/operations.rb:113",
+ "gems/libtmux/lib/libtmux/entity.rb:240"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null
+ },
{
"command": "show-options",
"evidence": [
@@ -1177,6 +1264,17 @@
}
],
"LibTmux::WindowLink#unlink": [
+ {
+ "command": "list-commands",
+ "evidence": [
+ "gems/libtmux/lib/libtmux/operations.rb:137",
+ "gems/libtmux/lib/libtmux/operations.rb:113",
+ "gems/libtmux/lib/libtmux/entity.rb:224"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null
+ },
{
"command": "show-options",
"evidence": [
diff --git a/site/src/data/tmux-usage/scala.json b/site/src/data/tmux-usage/scala.json
index 617524eb4..3a40f0ebe 100644
--- a/site/src/data/tmux-usage/scala.json
+++ b/site/src/data/tmux-usage/scala.json
@@ -97,6 +97,28 @@
"revision": "a0ecbc16da00140e2520462d478a2af470878272",
"schemaVersion": 1,
"symbols": {
+ "io.github.libtmux.scaladsl.cats.Batch.run": [
+ {
+ "command": "display-message",
+ "evidence": [
+ "libtmux-scala-cats/src/main/scala/io/github/libtmux/scaladsl/cats/Batch.scala:26"
+ ],
+ "reviewed": true,
+ "scope": null,
+ "via": {
+ "evidence": [
+ "libtmux/src/main/java/io/github/libtmux/batch/Batch.java:94",
+ "libtmux/src/main/java/io/github/libtmux/batch/Batch.java:85",
+ "libtmux/src/main/java/io/github/libtmux/batch/Batch.java:82"
+ ],
+ "port": "java",
+ "reviewed": true,
+ "revision": "a0ecbc16da00140e2520462d478a2af470878272",
+ "symbol": "io.github.libtmux.batch.Batch.Batch.run"
+ },
+ "when": "the batch is not empty"
+ }
+ ],
"io.github.libtmux.scaladsl.cats.Buffers.delete": [
{
"command": "delete-buffer",
@@ -113,7 +135,8 @@
"port": "java",
"revision": "a0ecbc16da00140e2520462d478a2af470878272",
"symbol": "io.github.libtmux.Buffers.Buffers.delete"
- }
+ },
+ "when": "except before tmux 3.4"
}
],
"io.github.libtmux.scaladsl.cats.Buffers.list": [
@@ -1037,7 +1060,8 @@
"port": "java",
"revision": "a0ecbc16da00140e2520462d478a2af470878272",
"symbol": "io.github.libtmux.Pane.Pane.paste"
- }
+ },
+ "when": "except before tmux 3.4"
},
{
"command": "paste-buffer",
@@ -1054,7 +1078,8 @@
"port": "java",
"revision": "a0ecbc16da00140e2520462d478a2af470878272",
"symbol": "io.github.libtmux.Pane.Pane.paste"
- }
+ },
+ "when": "except before tmux 3.4"
}
],
"io.github.libtmux.scaladsl.cats.Pane.pasteBuffer": [
@@ -1982,7 +2007,7 @@
"revision": "a0ecbc16da00140e2520462d478a2af470878272",
"symbol": "io.github.libtmux.Shell.Shell.capturing"
},
- "when": "except on tmux 3.3a and 3.4"
+ "when": "except from tmux 3.3 until 3.5"
}
],
"io.github.libtmux.scaladsl.cats.Shell.choose": [
@@ -2579,7 +2604,8 @@
"port": "java",
"revision": "a0ecbc16da00140e2520462d478a2af470878272",
"symbol": "io.github.libtmux.Pane.Pane.paste"
- }
+ },
+ "when": "except before tmux 3.4"
},
{
"command": "paste-buffer",
@@ -2596,7 +2622,8 @@
"port": "java",
"revision": "a0ecbc16da00140e2520462d478a2af470878272",
"symbol": "io.github.libtmux.Pane.Pane.paste"
- }
+ },
+ "when": "except before tmux 3.4"
}
],
"io.github.libtmux.scaladsl.Pane.pasteBuffer": [
diff --git a/site/src/data/tmux-usage/ts.json b/site/src/data/tmux-usage/ts.json
index 313aed0e3..43063d3cf 100644
--- a/site/src/data/tmux-usage/ts.json
+++ b/site/src/data/tmux-usage/ts.json
@@ -126,7 +126,7 @@
],
"reviewed": true,
"scope": null,
- "when": "a minimal launch, no explicit selection"
+ "when": "unless an explicit launch finds no server"
},
{
"command": "show-options",
@@ -987,7 +987,8 @@
"packages/libtmux/src/_internal/operations/session_nav.ts:40",
"packages/libtmux/src/session.ts:378"
],
- "scope": null
+ "scope": null,
+ "when": "the target is not last, next or previous"
}
],
"session.Session.setEnvironment": [
diff --git a/site/test/tmux-library-usage.test.ts b/site/test/tmux-library-usage.test.ts
index f2644addd..b9f63b687 100644
--- a/site/test/tmux-library-usage.test.ts
+++ b/site/test/tmux-library-usage.test.ts
@@ -314,6 +314,64 @@ describe('which sends through a helper are listed', () => {
})
})
+describe('a release a library refuses to send on', () => {
+ const use = (port: string, symbol: string, command: string) => TMUX_USAGE[port].symbols[symbol]?.find((entry) => entry.command === command)
+
+ it('says so on a command that exists on a supported release and that the library will not send there', () => {
+ // Pane.paste and Buffers.delete throw before tmux 3.4, where deleting a named buffer can remove another; java supports 3.2a.
+ const refused = [
+ ['java', 'io.github.libtmux.Pane.Pane.paste', ['load-buffer', 'paste-buffer']],
+ ['java', 'io.github.libtmux.Buffers.Buffers.delete', ['delete-buffer']],
+ ['kotlin', 'io.github.libtmux.kotlin.Pane.paste', ['load-buffer', 'paste-buffer']],
+ ['kotlin', 'io.github.libtmux.kotlin.Buffers.delete', ['delete-buffer']],
+ ['scala', 'io.github.libtmux.scaladsl.Pane.paste', ['load-buffer', 'paste-buffer']],
+ ['scala', 'io.github.libtmux.scaladsl.cats.Pane.paste', ['load-buffer', 'paste-buffer']],
+ ['scala', 'io.github.libtmux.scaladsl.cats.Buffers.delete', ['delete-buffer']],
+ ] as const
+ const entries = refused.flatMap(([port, symbol, commands]) => commands.map((command) => ({ label: `${port} ${symbol} ${command}`, entry: use(port, symbol, command) })))
+ expect(entries).toHaveLength(11)
+ for (const { label, entry } of entries) expect(entry?.when, label).toBe('except before tmux 3.4')
+ // Lua's delete_buffer refuses the same way; go's confirm-before and command-prompt always send -b, which tmux has from 3.3.
+ expect(use('lua', 'libtmux.Server:delete_buffer', 'delete-buffer')?.when).toBe('except before tmux 3.4')
+ expect(use('go', 'tmux.Server.ConfirmBefore', 'confirm-before')?.when).toBe('except before tmux 3.3')
+ expect(use('go', 'tmux.Server.CommandPrompt', 'command-prompt')?.when).toBe('except before tmux 3.3')
+ // run-shell's output is lost on every release from 3.3 until 3.5, which is a range and not two releases.
+ for (const [port, symbol] of [['java', 'io.github.libtmux.Shell.Shell.capturing'], ['kotlin', 'io.github.libtmux.kotlin.Shell.capturing'], ['scala', 'io.github.libtmux.scaladsl.cats.Shell.capturing']] as const) {
+ expect(use(port, symbol, 'run-shell')?.when, `${port} ${symbol}`).toBe('except from tmux 3.3 until 3.5')
+ }
+ // The controls: a method that pastes a buffer that already exists refuses nothing, and a command that tmux itself lacks before a release needs no qualifier.
+ expect(use('java', 'io.github.libtmux.Pane.Pane.pasteBuffer', 'paste-buffer')?.when).toBeUndefined()
+ for (const [port, symbol] of [['csharp', 'LibTmux.Pane.CreatePaneAsync'], ['csharp', 'LibTmux.Window.CreatePaneAsync'], ['go', 'tmux.Pane.NewPane'], ['go', 'tmux.Window.NewPane'], ['py', 'libtmux.Pane.new_pane'], ['py', 'libtmux.Window.new_pane']] as const) {
+ const entry = use(port, symbol, 'new-pane')
+ expect(entry, `${port} ${symbol}`).toBeDefined()
+ expect(entry?.when, `${port} ${symbol}`).toBeUndefined()
+ }
+ })
+
+ it('says when a launch sends what it sends, from the line the default launch reaches', () => {
+ // ts: only a minimal launch starts the server and reads the owner option; the facts are disclosed whenever the server is there.
+ expect(use('ts', 'mcp.server.main', 'start-server')?.when).toBe('a minimal launch, no explicit selection')
+ expect(use('ts', 'mcp.server.main', 'show-options')?.when).toBe('a minimal launch, no explicit selection')
+ expect(use('ts', 'mcp.server.main', 'display-message')?.when).toBe('unless an explicit launch finds no server')
+ // java: the default launch is the dedicated server, which starts it and reads its metadata; an explicit one only reads it.
+ const main = 'io.github.libtmux.mcp.Main.Main.main'
+ expect(use('java', main, 'start-server')).toMatchObject({ when: 'the launch chooses no socket', reviewed: true })
+ expect(use('java', main, 'start-server')?.evidence[0]).toBe('libtmux-mcp/src/main/java/io/github/libtmux/mcp/LaunchConfiguration.java:106')
+ expect(use('java', main, 'display-message')?.when).toBeUndefined()
+ expect(use('java', main, 'display-message')?.evidence[0]).toBe('libtmux-mcp/src/main/java/io/github/libtmux/mcp/LaunchConfiguration.java:111')
+ // go: the helper registers a kill for the end of the test, which is not a send of the call itself.
+ expect(use('go', 'tmuxtest.NewSession', 'kill-session')?.when).toBe('the test ends, in t.Cleanup')
+ })
+
+ it('records the command-alias inventory of a guarded Ruby call as list-commands and show-options, on the same symbols', () => {
+ const readers = (command: string) => Object.entries(TMUX_USAGE.ruby.symbols).filter(([, entries]) => entries.some((entry) => entry.command === command && entry.incidental)).map(([symbol]) => symbol).sort()
+ expect(readers('show-options')).toHaveLength(9)
+ expect(readers('list-commands')).toEqual(readers('show-options'))
+ // Pane#capture asks list-commands only when a flag it has to check is set, so a default call does not and it stays out.
+ expect(use('ruby', 'LibTmux::Pane#capture', 'list-commands')).toBeUndefined()
+ })
+})
+
describe('from a method to the command and its C function', () => {
it('names the scope and links the manual page and the C function behind it', () => {
const [send] = tmuxSymbolSends('swift', 'Server.panes()')
@@ -404,8 +462,12 @@ describe('from a method to the command and its C function', () => {
const listed = (port: string, symbol: string, command: string) => tmuxUsage(command)?.groups.flatMap((group) => group.ports).some((cell) => cell.port === port && cell.links.some((link) => link.symbolId === symbol)) ?? false
expect(listed('java', 'io.github.libtmux.Pane.Pane.sendKeys', 'display-message')).toBe(false)
// The same holds for the command-alias inventory a guarded Ruby call reads before it sends: on the method, not on the command's pages.
- expect(tmuxSymbolSends('ruby', 'LibTmux::WindowLink#kill').map((send) => send.command).sort()).toEqual(['kill-window', 'show-options'])
+ expect(tmuxSymbolSends('ruby', 'LibTmux::WindowLink#kill').map((send) => send.command).sort()).toEqual(['kill-window', 'list-commands', 'show-options'])
expect(listed('ruby', 'LibTmux::WindowLink#kill', 'show-options')).toBe(false)
+ expect(listed('ruby', 'LibTmux::WindowLink#kill', 'list-commands')).toBe(false)
+ // switch_client asks the same two questions before it sends, and neither is an exclusion: a default call sends both.
+ expect(tmuxSymbolSends('ruby', 'LibTmux::Server#switch_client').map((send) => send.command).sort()).toEqual(['list-commands', 'show-options', 'switch-client'])
+ expect(listed('ruby', 'LibTmux::Server#switch_client', 'list-commands')).toBe(false)
expect(listed('ruby', 'LibTmux::WindowLink#kill', 'kill-window')).toBe(true)
// The wrapper that stands on it is not listed either, and a claim that is not incidental still is.
expect(listed('kotlin', 'io.github.libtmux.kotlin.Pane.sendKeys', 'display-message')).toBe(false)
@@ -598,7 +660,7 @@ describe('the rendered lists', () => {
// The data agrees: no Julia use says it is on a receiver unless some method of the function does not send it.
for (const [symbol, uses] of Object.entries(TMUX_USAGE.julia.symbols)) {
for (const use of uses) {
- if (/^on a (?:Server|ControlConnection)$/.test(use.when ?? '')) expect(['capture_bytes', 'get_environment', 'load_buffer', 'save_buffer', 'snapshot'], `${symbol} ${use.command}`).toContain(symbol.split('.').at(-1))
+ if (/^on a (?:Server|ControlConnection)$/.test(use.when ?? '')) expect(['capture_bytes', 'get_environment', 'load_buffer', 'save_buffer', 'snapshot', 'set_option', 'unset_option', 'set_hook', 'unset_hook'], `${symbol} ${use.command}`).toContain(symbol.split('.').at(-1))
}
}
})
@@ -662,7 +724,9 @@ describe('the rendered lists', () => {
expect(previous.scopes[0].when).toBe('the target is "previous"')
const rows = tmuxCommandRows(sends, [])
expect(rows.find((row) => row.command === 'previous-window')!.when).toBe('the target is "previous"')
- expect(rows.find((row) => row.command === 'select-window')!.when).toBeUndefined()
+ // The window it selects when the target is none of those three says so too, and a method that selects on every call does not.
+ expect(rows.find((row) => row.command === 'select-window')!.when).toBe('the target is not last, next or previous')
+ expect(tmuxCommandRows(tmuxSymbolSends('ts', 'window.Window.select'), []).find((row) => row.command === 'select-window')!.when).toBeUndefined()
for (const document of Object.values(TMUX_USAGE)) {
for (const uses of Object.values(document.symbols)) for (const use of uses) if (use.when) expect(use.when.trim().split(/\s+/).length).toBeLessThanOrEqual(8)
}
From d39851e29a3449f0034595174f7d20099c87f023 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Tue, 20 Oct 2026 06:52:24 -0500
Subject: [PATCH 18/53] fix(site[tmux-usage]) Put the condition of a send in
parentheses on the method page, as the Markdown does
why: On a method page the condition of a scope followed its C function with only a
space: `list-panes -s, cmd_list_panes_session the spec names a first window;
list-panes -t, ...`, so a reader could take the words for part of the name, or for
the start of the next item. The Markdown of the same page already wrote it in
parentheses. A review of b8f892310 asked that the two match.
what:
- The method-page line puts a condition in parentheses after its scope's C function
(or after the command, for a command with no scope), keeping the muted
`.tmux-when` element for the words, so `list-panes -s, cmd_list_panes_session (the
spec names a first window); list-panes -t, cmd_list_panes_window (the spec has more
than one window)`.
- The README says this where it says each scope has its own condition. The test
reads the text of the line for the two-scope F# case.
---
site/src/components/api/ApiEntry.astro | 6 +++---
site/test/tmux-library-usage.test.ts | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/site/src/components/api/ApiEntry.astro b/site/src/components/api/ApiEntry.astro
index 530ea61d1..6e2049df3 100644
--- a/site/src/components/api/ApiEntry.astro
+++ b/site/src/components/api/ApiEntry.astro
@@ -679,10 +679,10 @@ const hasBody =
{commandItems.length > 0 &&
tmux command
- {/* No whitespace between an item and the separator that follows it, so a comma or semicolon never trails a space. */}
+ {/* No whitespace between an item and the separator that follows it, so a comma or semicolon never trails a space; a condition is in parentheses, as it is in the Markdown. */}
{commandItems.map((item, i) => <>{i > 0 ? commandSeparator : ' '}{item.command}{item.scope
- ? {item.scope.flag || item.scope.target ? <>{' '}-{item.scope.flag || item.scope.target}> : null}{item.function ? <>{', '}{item.function.name}> : <>{' '}{item.scope.label}>}{item.when && <>{' '}{item.when}>}
- : item.when && <>{' '}{item.when}>}>)}
+ ? {item.scope.flag || item.scope.target ? <>{' '}-{item.scope.flag || item.scope.target}> : null}{item.function ? <>{', '}{item.function.name}> : <>{' '}{item.scope.label}>}{item.when && <>{' ('}{item.when}{')'}>}
+ : item.when && <>{' ('}{item.when}{')'}>}>)}
}
{catalogEntries.length > 0 &&
tmux catalog
diff --git a/site/test/tmux-library-usage.test.ts b/site/test/tmux-library-usage.test.ts
index b9f63b687..b2d5f70aa 100644
--- a/site/test/tmux-library-usage.test.ts
+++ b/site/test/tmux-library-usage.test.ts
@@ -407,7 +407,7 @@ describe('from a method to the command and its C function', () => {
// A condition follows the scope it holds for, inside its item.
const fsharp = tmuxCommandRows(tmuxSymbolSends('fsharp', 'LibTmux.FSharp.Server.newSession'), []).filter((row) => row.command === 'list-panes')
expect((await line(fsharp)).text).toBe(
- 'tmux command list-panes -s, cmd_list_panes_session the spec names a first window; list-panes -t, cmd_list_panes_window the spec has more than one window')
+ 'tmux command list-panes -s, cmd_list_panes_session (the spec names a first window); list-panes -t, cmd_list_panes_window (the spec has more than one window)')
// Commands with no C function to name keep the comma, and a line that mixes the two uses the semicolon throughout.
const plain = [{ command: 'kill-pane', href: '/tmux/latest/manual/kill-pane/', scopes: [] }, { command: 'kill-window', href: '/tmux/latest/manual/kill-window/', scopes: [] }]
expect((await line(plain)).text).toBe('tmux command kill-pane, kill-window')
From ec24c927fa337adc31f90da54678a234bfe2478b Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Tue, 20 Oct 2026 06:52:35 -0500
Subject: [PATCH 19/53] fix(site[tmux-reference]) Show only the head of a long
declaration on a preview card
why: A review of b8f892310 found that tmux 3.7c's anonymous enum of key codes
(tmux.h:327) is one signature of 355,553 characters. Its preview payload was
712,008 bytes of JSON (the signature twice: as text and as the one token the
highlighter makes of a line that long), a card that laid it out was a wall of
text, and `renderPreviewSignature` would have written a style property for every
token of a payload that did tokenize one. A card is a glance before a reader
opens the page, which has the whole declaration.
what:
- `limitPreviewSignature` (preview-signature.ts) keeps the first 12 lines and 1,200
characters of a signature and ends a cut one with a line that says so ("..."). The
C preview builder applies it, so the payload holds the head and is highlighted as
the head, and its `detail` says the card shows the first lines.
- The browser renderer applies the same limit again, so a payload from any
producer, or one written before the limit, cannot make a card heavy; a payload
whose highlighting no longer matches the cut text renders it as plain text.
- Tests: the limit by lines, by characters and when it fits; the 3.7c enum's card is
at most 1,202 characters and under 40 KB highlighted, a function that fits has no cut,
and no declaration of any version exceeds the limit; the renderer cuts a 40-line
and a 480,000-character payload and keeps the highlighting of one that fits.
Measured over every payload the route writes, highlighted as the build does, before
and after: latest 19,741,003 to 18,944,280 bytes, 3.7c the same set under its own
address, 19,741,003 to 18,928,510, 3.2a 8,344,505 to 8,279,027; 47,826,511 to 46,151,817
bytes in 20,860 files, and 10.0 MB gzipped (8.3 MB brotli). The largest payload is
20,385 bytes where it was 712,008. The review's estimate of about 80 MB was high:
the limit removes the outlier, and the rest is ordinary highlighting, about 2.2 KB
for each of 20,860 declarations.
I kept a payload for every declaration rather than only the ones something links
to. Most of them are linked (4,738 of 7,885 in 3.7c are the target of another
declaration, 4,029 of 5,090 in 3.2a, before counting the index, the usage tables, the
manual and the catalog), the set of links is open to every page that renders a
reference link, and a link without a payload is the silent failure this route exists
to remove. Writing only the linked ones would save about a third of the 46 MB, at the
price of that failure returning with the next page that links an unlinked one.
---
site/src/lib/link-preview-browser.ts | 4 +++-
site/src/lib/preview-signature.ts | 22 ++++++++++++++++++++
site/src/lib/tmux-reference.ts | 9 +++++---
site/test/link-preview.test.ts | 31 ++++++++++++++++++++++++++++
site/test/tmux-reference.test.ts | 28 +++++++++++++++++++++++++
5 files changed, 90 insertions(+), 4 deletions(-)
create mode 100644 site/src/lib/preview-signature.ts
diff --git a/site/src/lib/link-preview-browser.ts b/site/src/lib/link-preview-browser.ts
index 6bee37e40..aaf18b725 100644
--- a/site/src/lib/link-preview-browser.ts
+++ b/site/src/lib/link-preview-browser.ts
@@ -3,6 +3,7 @@ import type { CodeHighlight } from './highlight'
import { linkPreviewTarget, linkPreviewCandidate, linkPreviewBlockLink, markLinkPreview } from './link-preview-paint'
import { abbreviateNamespace, kindMark, markClass } from './api-labels'
import { wordBreak } from './word-break'
+import { limitPreviewSignature } from './preview-signature'
export { linkPreviewTarget } from './link-preview-paint'
const cache = new Map()
@@ -62,7 +63,8 @@ export function renderPreviewKind(slot: HTMLElement | null, kind?: string) {
/** Optional token metadata can fail independently of the real reference link. */
export function renderPreviewSignature(element: HTMLElement, preview: LinkPreview) {
- const signature = preview.signature ?? ''
+ // The head of a declaration: a payload that carries more is cut here, and its highlighting no longer matches, so it is plain text.
+ const signature = limitPreviewSignature(preview.signature ?? '')
const value = preview.signatureHighlight
const color = (input: unknown) => typeof input === 'string' && /^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i.test(input)
const object = (input: unknown): input is Record => !!input && typeof input === 'object'
diff --git a/site/src/lib/preview-signature.ts b/site/src/lib/preview-signature.ts
new file mode 100644
index 000000000..1b745fd76
--- /dev/null
+++ b/site/src/lib/preview-signature.ts
@@ -0,0 +1,22 @@
+/**
+ * How much of a declaration a preview card shows.
+ *
+ * A card is a glance before a reader decides to open the page, so it shows the head of a declaration and not all of it.
+ * One declaration in tmux's source, an anonymous enum of the key codes, is a single signature of hundreds of
+ * thousands of characters; a payload that carried it was most of a megabyte, and a card that rendered it laid out a
+ * wall of text. The page the card links to has the whole declaration.
+ *
+ * The payload is built with the limit and the browser applies it again, so a payload from any producer, or one written
+ * before the limit, cannot make a card heavy.
+ */
+export const PREVIEW_SIGNATURE_LINES = 12
+export const PREVIEW_SIGNATURE_CHARS = 1200
+
+/** `signature` as it is shown: whole when it fits, otherwise its first lines and characters followed by a line that says so. */
+export function limitPreviewSignature(signature: string): string {
+ const lines = signature.split('\n')
+ let text = lines.slice(0, PREVIEW_SIGNATURE_LINES).join('\n')
+ let cut = lines.length > PREVIEW_SIGNATURE_LINES
+ if (text.length > PREVIEW_SIGNATURE_CHARS) { text = text.slice(0, PREVIEW_SIGNATURE_CHARS); cut = true }
+ return cut ? `${text.trimEnd()}\n…` : text
+}
diff --git a/site/src/lib/tmux-reference.ts b/site/src/lib/tmux-reference.ts
index f83f4a778..83b24e81d 100644
--- a/site/src/lib/tmux-reference.ts
+++ b/site/src/lib/tmux-reference.ts
@@ -5,6 +5,7 @@ import v37 from '../data/tmux/api/3.7c.json?raw'
import pins from '../data/tmux/versions.json'
import { createApiIndex, type PortNavData } from './api-models'
import type { LinkPreview } from './link-preview'
+import { limitPreviewSignature } from './preview-signature'
import { navTreeFor, referenceTreeFor, referenceBreadcrumbs } from './api-tree'
import { apiRelationshipPath } from './api-relationships'
import { PORTS } from './ports'
@@ -328,16 +329,18 @@ export function tmuxSymbolSends(port: string, publicId: string, version = 'lates
/**
* The card a link to a declaration of tmux's C source opens, from the same record as the page it leads to. tmux's source
* carries no Doxygen briefs, so the card says where the declaration is and shows it, which is what a reader following a
- * link from a method wants to see before leaving the page.
+ * link from a method wants to see before leaving the page. A declaration longer than a card holds shows its head, and the
+ * page has all of it (`limitPreviewSignature`).
*/
export function tmuxReferencePreview(version: string, symbol: ApiSymbol): LinkPreview {
const model = tmuxSourceModel(version)
- const signature = symbol.signatures[0]?.raw ?? (symbol.value !== undefined ? `${symbol.name} = ${symbol.value}` : undefined)
+ const full = symbol.signatures[0]?.raw ?? (symbol.value !== undefined ? `${symbol.name} = ${symbol.value}` : undefined)
+ const signature = full === undefined ? undefined : limitPreviewSignature(full)
const summary = symbol.doc?.summary ?? symbol.signatures.find((entry) => entry.doc?.summary)?.doc?.summary
return {
schema: 1, title: symbol.name, kind: symbol.kind,
description: summary ? docSummaryText(summary, 'c') : '',
- detail: `Defined in ${symbol.source.file}${symbol.source.line ? `, line ${symbol.source.line}` : ''} of tmux ${model.version}.`,
+ detail: `Defined in ${symbol.source.file}${symbol.source.line ? `, line ${symbol.source.line}` : ''} of tmux ${model.version}.${signature !== full ? ' The card shows the first lines of the declaration.' : ''}`,
signature, signatureLanguage: signature ? 'c' : undefined,
href: tmuxReferenceUrl(version, symbol), source: sourceUrl(model, symbol),
}
diff --git a/site/test/link-preview.test.ts b/site/test/link-preview.test.ts
index e1d219e21..1dc8188bd 100644
--- a/site/test/link-preview.test.ts
+++ b/site/test/link-preview.test.ts
@@ -16,6 +16,7 @@ import { apiGlossaryHref } from '../src/lib/api-glossary'
import { initLinkPreviews, disposeLinkPreviews, linkPreviewTarget, positionLinkPreview } from '../src/lib/link-preview-browser'
import { GET } from '../src/pages/[...slug].preview.json'
import { highlightTokens } from '../src/lib/highlight'
+import { PREVIEW_SIGNATURE_CHARS, PREVIEW_SIGNATURE_LINES } from '../src/lib/preview-signature'
import config from '../ec.config.mjs'
it.each([
@@ -250,6 +251,36 @@ describe('preview lifecycle', () => {
expect(code.classList.contains('lm-highlighted')).toBe(false)
})
+ it('shows only the head of a declaration too long for a card, whatever the payload carries', async () => {
+ const token = (content: string) => ({ content, light: { color: '#A626A4', fontStyle: 0 }, dark: { color: '#F97583', fontStyle: 0 } })
+ const lines = Array.from({ length: 40 }, (_, index) => `case_${index}`)
+ const signature = `enum {\n${lines.join('\n')}\n}`
+ const payload = { schema: 1, title: 'enum', description: '', signature, signatureLanguage: 'c', href: `${prefix}-a/`,
+ signatureHighlight: { language: 'c', light: { foreground: '#24292E', background: '#FFFFFF' }, dark: { foreground: '#E1E4E8', background: '#24292E' },
+ lines: signature.split('\n').map((line) => [token(line)]) } }
+ requests.mockResolvedValueOnce(new Response(JSON.stringify(payload)))
+ hover(); await settle()
+ const code = win.document.querySelector('[data-preview-signature]')!
+ // The lines it keeps, then a line that says the rest is on the page; the cut highlighting no longer fits, so it is plain text.
+ expect(code.textContent).toBe(`${signature.split('\n').slice(0, PREVIEW_SIGNATURE_LINES).join('\n')}\n…`)
+ expect(code.querySelectorAll('*')).toHaveLength(0)
+ escape()
+ // One line of hundreds of thousands of characters, as the tmux key-code enum is, is cut at the character limit.
+ requests.mockResolvedValueOnce(new Response(JSON.stringify({ ...payload, href: `${prefix}-b/`, signature: `enum { ${'KEYC_X, '.repeat(60_000)}}`, signatureHighlight: undefined })))
+ hover('b'); await settle()
+ expect(code.textContent!.length).toBeLessThanOrEqual(PREVIEW_SIGNATURE_CHARS + 2)
+ expect(code.textContent!.endsWith('\n…')).toBe(true)
+ escape()
+ // The control: a declaration that fits keeps its highlighting and its text, with nothing added.
+ win.document.body.insertAdjacentHTML('afterbegin', `c`)
+ const short = 'enum { A, B }'
+ requests.mockResolvedValueOnce(new Response(JSON.stringify({ ...payload, href: `${prefix}-c/`, signature: short,
+ signatureHighlight: { ...payload.signatureHighlight, lines: [[token(short)]] } })))
+ hover('c'); await settle()
+ expect(code.textContent).toBe(short)
+ expect(code.querySelectorAll('span')).toHaveLength(1)
+ })
+
it('keeps the destructor name and native signature intact with meaningful title breaks', async () => {
const name = 'libtmux::CommandOperation::~CommandOperation'
const signature = '~CommandOperation();'
diff --git a/site/test/tmux-reference.test.ts b/site/test/tmux-reference.test.ts
index 5962a4fd9..facb2dda2 100644
--- a/site/test/tmux-reference.test.ts
+++ b/site/test/tmux-reference.test.ts
@@ -8,6 +8,8 @@ import { symbolMarkdown } from '../src/lib/symbol-markdown'
import { relatedApiTypes } from '../src/lib/api-sections'
import { PORTS } from '../src/lib/ports'
import { linkPreviewTarget } from '../src/lib/link-preview-paint'
+import { highlightedPreview } from '../src/lib/link-preview'
+import { limitPreviewSignature, PREVIEW_SIGNATURE_CHARS, PREVIEW_SIGNATURE_LINES } from '../src/lib/preview-signature'
import { TMUX_VERSIONS } from '../src/lib/tmux-manual-data'
import { GET, getStaticPaths } from '../src/pages/tmux/[version]/reference/[...slug].preview.json'
import { getStaticPaths as genericPreviewPaths } from '../src/pages/[...slug].preview.json'
@@ -170,6 +172,32 @@ describe('the card a link to a C declaration opens', () => {
expect(tmuxReferencePreview('latest', bare)).toMatchObject({ schema: 1, title: bare.name, signature: undefined, signatureLanguage: undefined })
})
+ it('shows the head of a declaration too long for a card, and keeps one that fits whole', async () => {
+ expect(limitPreviewSignature('static void f(void)')).toBe('static void f(void)')
+ const lines = Array.from({ length: PREVIEW_SIGNATURE_LINES + 5 }, (_, index) => `line ${index}`)
+ expect(limitPreviewSignature(lines.join('\n'))).toBe(`${lines.slice(0, PREVIEW_SIGNATURE_LINES).join('\n')}\n…`)
+ expect(limitPreviewSignature(lines.slice(0, PREVIEW_SIGNATURE_LINES).join('\n'))).toBe(lines.slice(0, PREVIEW_SIGNATURE_LINES).join('\n'))
+ expect(limitPreviewSignature('x'.repeat(PREVIEW_SIGNATURE_CHARS * 3))).toBe(`${'x'.repeat(PREVIEW_SIGNATURE_CHARS)}\n…`)
+ // The key-code enum of tmux 3.7c is one signature of over three hundred thousand characters: its card carries the head, not all of it.
+ const model = tmuxSourceModel('3.7c')
+ const keycodes = model.symbols.reduce((longest, entry) => (entry.signatures[0]?.raw?.length ?? 0) > (longest.signatures[0]?.raw?.length ?? 0) ? entry : longest)
+ expect(keycodes.signatures[0].raw!.length).toBeGreaterThan(300_000)
+ const card = tmuxReferencePreview('3.7c', keycodes)
+ expect(card.signature!.length).toBeLessThanOrEqual(PREVIEW_SIGNATURE_CHARS + 2)
+ expect(card.signature!.endsWith('\n…')).toBe(true)
+ expect(card.detail).toContain('first lines')
+ expect(JSON.stringify(await highlightedPreview(card)).length).toBeLessThan(40_000)
+ // The control: a function that fits has no cut and says nothing of one.
+ const small = tmuxReferencePreview('3.7c', model.symbols.find((entry) => entry.name === 'cmd_list_panes_server')!)
+ expect(small.signature).toBe('static void cmd_list_panes_server(struct cmd *, struct cmdq_item *)')
+ expect(small.detail).not.toContain('first lines')
+ // No declaration of any version shows more than the limit.
+ for (const version of TMUX_VERSIONS) {
+ const over = tmuxSourceModel(version).symbols.filter((entry) => (tmuxReferencePreview(version, entry).signature ?? '').length > PREVIEW_SIGNATURE_CHARS + 2)
+ expect(over.map((entry) => entry.name), version).toEqual([])
+ }
+ })
+
it('catches a link with no card behind it, and the preview route that the generic one never covered', () => {
const real = tmuxReferenceUrl('latest', tmuxSourceModel('latest').symbols.find((entry) => entry.name === 'cmd_list_panes_server')!)
const invented = '/tmux/latest/reference/c-function-no-such-declaration/'
From 0661e68d80be8e273948c2188f5bb2ceed95a2b0 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Tue, 20 Oct 2026 07:04:36 -0500
Subject: [PATCH 20/53] fix(site[tmux-reference]) Ask the preview check only
for destinations the dev build serves
why: `check-dev.mjs --reference-previews` failed with 30 links to
`/en/py/stable/reference/...` answering 404. The pages the check reads (the C++ method
page, the manual page of list-panes and two C pages) link the Python reference at its
default version, `stable`, and the dev build serves each port's reference at one version,
its own target, `latest`. The assembly renders the stable Python reference with Sphinx
and skips it where there is no checkout, so no payload for it exists in either place; the
check had no notion of what the build contains. Every non-py link resolved.
what:
- `servedByBuild` decides whether the build contains a link's destination: a port's core
reference is a tree of its own, built for one version, and a link to another version of
it leaves for a tree the build does not contain. Everything else (tmux, products, the
glossary) is served at whatever version a link names. It reads the site's own sources:
`PORTS`, `buildTarget` (the version the dev build is) and `referenceSegment`, so no port is
named in it. check-dev.mjs now takes the version its mirror writes each port's reference
routes, preview endpoints and landing pages at from the same `buildTarget`, where it was
the literal `latest` in four places, and hands the check what it serves.
- `payloadGaps` is the sweep: it asks for the payload of each destination the build serves and
returns the missing ones apart from the ones it did not ask for. The check reports the
count it left out.
- The negative control runs the same function: a bogus declaration on a port the build
serves must be reported as answering 404, and one on a version the build does not serve
must be left out and not asked, so the sweep cannot go green by skipping what it should
ask. The control link with no payload now receives the pointer as a dispatched event, which
cannot be intercepted by a sticky header over the top of the page.
- vitest: py is left out and every other port asked with the defaults of the dev build; another default
moves which port is left out (a `ts` at `v1.2`), and none at all with no defaults; tmux's
pages, a product's pages and guides are served at any version; asking for everything
reports the destination the build does not contain, which is what the check did.
- CONTRIBUTING.md describes the check, what it asks for and why.
Where it runs: `scripts/test-all.sh` runs `node site/scripts/check-dev.mjs` (the 'fresh
browser matrix'), with no mode flag, which is the full run that includes both this check and
`--badge-centring`, and `.github/workflows/test.yml` runs test-all.sh. They run on check-dev's
own source mirror, not on the assembly, so the assembly's "py latest sphinx skipped" does not
reach them; what does is the same mirror, which serves py at `latest` and is linked to at
`stable`, and that is what this fixes. Not run in a browser.
---
CONTRIBUTING.md | 13 +++++
site/scripts/check-dev.mjs | 21 ++++---
site/scripts/check-page-readiness.mjs | 82 ++++++++++++++++++++++-----
site/test/preview-check.test.ts | 56 ++++++++++++++++++
4 files changed, 151 insertions(+), 21 deletions(-)
create mode 100644 site/test/preview-check.test.ts
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 219a60faa..7334ce240 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -166,6 +166,19 @@ holds and requires the gate to notice, by the problem it names:
$ node site/scripts/check-dev.mjs --badge-centring
```
+A link the page marks for a preview card must have a card to show. The preview
+check hovers the C function link of a method page, then asks for the payload of
+every marked link on four pages. It asks only for destinations the dev build
+serves: one version of each port's reference, as its build target says, so the
+Python reference that the other ports link to at `stable` is not asked for. A
+payload missing on a port the build does serve is reported, and the check fails
+if it would not report one. Both checks run in the publication audit through the
+full `check-dev.mjs` matrix, on its own source mirror and not on the assembly:
+
+```console
+$ node site/scripts/check-dev.mjs --reference-previews
+```
+
Keep the complete assembly, all output suites, link audits, source/model
freshness, and full browser matrix in the publication audit:
diff --git a/site/scripts/check-dev.mjs b/site/scripts/check-dev.mjs
index 6e2144a77..5ad912ce0 100644
--- a/site/scripts/check-dev.mjs
+++ b/site/scripts/check-dev.mjs
@@ -5,7 +5,8 @@ import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { dev } from 'astro'
import { chromium, firefox, webkit } from 'playwright'
-import { API_MODEL_PORTS, PORTS, productAvailable } from '../src/lib/ports.ts'
+import { API_MODEL_PORTS, PORTS, productAvailable, referenceSegment } from '../src/lib/ports.ts'
+import { buildTarget } from '../src/lib/versions.ts'
import { checkClipboard, checkCompleteApiExamples } from './check-clipboard.mjs'
import { checkApiAnchorArrival, checkApiExampleOwnership, checkApiNavigation, checkApiStickyHeadings, checkApiStickyHeadingsFail, checkDocumentationNavigation, checkNavigation } from './check-navigation.mjs'
import { checkReferencePreferences, checkGlobalHeader, checkHeaderLinksFail } from './check-reference-preferences.mjs'
@@ -56,6 +57,10 @@ Object.assign(process.env, {
LIBTMUX_DOCS_LOCALES_ROOT: '', LIBTMUX_DOCS_LOCALE: 'en', LIBTMUX_DOCS_PORT: '',
LIBTMUX_DOCS_VERSION: 'latest', LIBTMUX_DOCS_PORT_DEFAULTS: '{"py":"stable"}',
})
+// The one version of each port's reference this build serves: its own target, as the site's build target says it. A port's core
+// reference is a tree of its own, so a link to another version of it (the Python reference that the other ports link to at its
+// default, `stable`) names a tree this build does not contain. The routes below and the checks that ask what is served read it here.
+const MIRRORED_VERSION = buildTarget(process.env).version
// Astro always writes root/.astro, so a separate cacheDir alone cannot isolate it.
const source = fileURLToPath(new URL('../', import.meta.url))
// Astro resolves external component styles against the nearest shared path.
@@ -183,7 +188,7 @@ for (const { port, symbol } of entries) {
`)
for (const { slug: port } of PORTS) {
- const directory = join(root, `src/pages/${port}/latest/reference`)
+ const directory = join(root, `src/pages/${port}/${MIRRORED_VERSION}/reference`)
mkdirSync(directory, { recursive: true })
writeFileSync(join(directory, '[...slug].astro'), `---
import Reference from '../../../reference/[...slug].astro'
@@ -225,10 +230,10 @@ import { coreApiSymbols } from '../../../../lib/product-api'
export { GET } from '../../../[...slug].preview.json'
export function getStaticPaths() {
const model = API_MODELS.${port}
- const glossary = referenceUrl(PORT_BY_SLUG.${port}, 'latest') + 'glossary/'
+ const glossary = referenceUrl(PORT_BY_SLUG.${port}, '${MIRRORED_VERSION}') + 'glossary/'
return [{ params: { slug: 'glossary' }, props: { preview: glossaryPreview(glossary) } },
...coreApiSymbols(model).map((owner) => ({ params: { slug: owner.slug },
- props: { preview: symbolPreview(model, owner, 'latest') } }))]
+ props: { preview: symbolPreview(model, owner, '${MIRRORED_VERSION}') } }))]
}
`)
writeFileSync(join(directory, 'tree.json.ts'), `
@@ -237,12 +242,14 @@ export const GET = () => new Response(JSON.stringify(referenceTree('${port}')),
headers: { 'Content-Type': 'application/json' },
})
`)
- writeFileSync(join(root, `src/pages/${port}/latest/index.astro`), `---
+ writeFileSync(join(root, `src/pages/${port}/${MIRRORED_VERSION}/index.astro`), `---
import Home from '../../index.astro'
---
`)
}
+/** What this build serves, for a check that asks whether a link's destination is in it. */
+const servedBuild = (base) => ({ root: new URL(base).pathname.replace(/\/$/, ''), ports: PORTS, version: MIRRORED_VERSION, segment: referenceSegment('core') })
let server, browser
const terminate = async () => {
await browser?.close()
@@ -803,7 +810,7 @@ try {
await checkMentionDensity(browser, base)
await checkChipGrowth(browser, base)
} else if (referencePreviewsOnly) {
- await retryReload(() => checkTmuxReferencePreviews(browser, base))
+ await retryReload(() => checkTmuxReferencePreviews(browser, base, { served: servedBuild(base) }))
} else if (referencePreferencesOnly) {
await retryReload(() => checkReferencePreferences(browser, base))
await retryReload(() => checkGlobalHeader(browser, base))
@@ -881,7 +888,7 @@ try {
.then(() => checkMentionDensity(browser, base))
.then(() => checkChipGrowth(browser, base)))
const blockLinks = schedule(() => retryReload(() => checkBlockLinksUndecorated(browser, base)))
- const referencePreviews = schedule(() => retryReload(() => checkTmuxReferencePreviews(browser, base)))
+ const referencePreviews = schedule(() => retryReload(() => checkTmuxReferencePreviews(browser, base, { served: servedBuild(base) })))
await apiAnchors
const apiSticky = schedule(() => retryReload(() => checkApiStickyHeadings(browser, base))
.then(() => checkApiStickyHeadingsFail(browser, base)))
diff --git a/site/scripts/check-page-readiness.mjs b/site/scripts/check-page-readiness.mjs
index e79757c66..fe4d129c3 100644
--- a/site/scripts/check-page-readiness.mjs
+++ b/site/scripts/check-page-readiness.mjs
@@ -531,16 +531,59 @@ export async function checkBlockLinksUndecorated(browser, base, { sample = false
}
}
+/**
+ * Whether the build under test contains the destination of a link, as far as a preview payload is concerned.
+ *
+ * A port's core reference is a tree of its own, built for one version of the port, and the build under test serves
+ * one: `version`, the one its own target names. A link to another version of a port's reference leaves for a tree this
+ * build does not contain, such as the Python reference that the other ports' pages link to at its default, `stable`
+ * (the assembly renders that one with Sphinx, and skips it where there is no checkout). Everything else is served at
+ * whatever version a link names: tmux's pages, a product's pages, the glossary.
+ *
+ * `ports`, `version` and `segment` (the part of the path that makes a page a core reference) are the site's own:
+ * `PORTS`, `buildTarget` and `referenceSegment`, so a change to what is built moves this with it.
+ *
+ * @param {string} pathname the path of the link, root included
+ * @param {{ root: string, ports: readonly { slug: string, versionedDocs: boolean }[], version: string, segment: string }} build
+ */
+export function servedByBuild(pathname, { root, ports, version, segment }) {
+ const rest = pathname.startsWith(`${root}/`) ? pathname.slice(root.length + 1) : pathname.replace(/^\//, '')
+ const parts = rest.split('/')
+ const port = ports.find((entry) => entry.slug === parts[0])
+ if (!port) return true
+ const at = port.versionedDocs ? 2 : 1
+ if (parts.slice(at, at + segment.split('/').length).join('/') !== segment) return true
+ return !port.versionedDocs || parts[1] === version
+}
+
+/**
+ * The links of `hrefs` that the build serves and that have no payload, and the ones it does not serve, which are not asked.
+ * A payload is at the path of the page with `.preview.json`, as the preview policy computes it.
+ */
+export async function payloadGaps(request, origin, hrefs, served) {
+ const missing = []
+ const skipped = []
+ for (const href of hrefs) {
+ if (served && !served(href)) { skipped.push(href); continue }
+ const response = await request.get(`${origin}${href.slice(0, -1)}.preview.json`)
+ if (!response.ok()) missing.push(`${href} answers ${response.status()}`)
+ }
+ return { missing, skipped }
+}
+
/**
* A link marked for a preview card has a card to show. A C function a method links to carried `data-link-preview` and
* opened nothing, because no preview payload was served at its address. Hovering the link is what asks for the card,
- * so hover it and read the card, then ask the same of every marked link on the pages, and of one that has no payload.
+ * so hover it and read the card, then ask the same of every marked link on the pages whose destination the build
+ * serves (`served`, from `servedByBuild`; without it every destination is asked), and of one that has no payload.
*/
-export async function checkTmuxReferencePreviews(browser, base) {
+export async function checkTmuxReferencePreviews(browser, base, { served: build } = {}) {
const context = await browser.newContext({ reducedMotion: 'reduce', viewport: { width: 1440, height: 1000 } })
const page = await context.newPage()
page.setDefaultTimeout(process.env.CI ? 20000 : 10000)
const opened = () => page.evaluate(() => document.getElementById('reference-link-preview')?.matches(':popover-open') ?? false)
+ const origin = new URL(base).origin
+ const served = build ? (href) => servedByBuild(href, build) : undefined
try {
await page.goto(`${base}/cxx/latest/reference/libtmux-server-panes/`, { waitUntil: 'load' })
await page.waitForFunction(() => document.documentElement.dataset.pageReadiness === 'ready')
@@ -553,22 +596,32 @@ export async function checkTmuxReferencePreviews(browser, base) {
assert.equal(await page.locator('#reference-link-preview [data-preview-title]').textContent(), 'cmd_list_panes_server')
assert.match(await page.locator('#reference-link-preview [data-preview-signature]').textContent(), /^static void cmd_list_panes_server\(struct cmd \*, struct cmdq_item \*\)$/)
assert.match(await page.locator('#reference-link-preview [data-preview-open]').getAttribute('href'), /\/tmux\/latest\/reference\/c-function-cmd-list-panes-c-cmd_list_panes_server\/$/)
- // Every link a page marks for a card has a payload at the address the card asks for.
+ // Every link a page marks for a card, whose destination the build serves, has a payload at the address the card asks for.
const missing = []
- let marked = 0
+ const skipped = new Set()
+ let asked = 0
for (const path of ['/cxx/latest/reference/libtmux-server-panes/', '/tmux/latest/manual/list-panes/', '/tmux/latest/reference/c-function-cmd-list-panes-c-cmd_list_panes_server/', '/tmux/latest/reference/c-struct-window_pane/']) {
await page.goto(`${base}${path}`, { waitUntil: 'load' })
await page.waitForFunction(() => document.documentElement.dataset.pageReadiness === 'ready')
const hrefs = await page.evaluate(() => [...new Set([...document.querySelectorAll('a[data-link-preview]')].map((anchor) => new URL(anchor.href).pathname))])
- marked += hrefs.length
- for (const href of hrefs) {
- const response = await page.request.get(`${base.replace(/\/en$/, '')}${href.slice(0, -1)}.preview.json`)
- if (!response.ok()) missing.push(`${path}: ${href} answers ${response.status()}`)
- }
+ const gaps = await payloadGaps(page.request, origin, hrefs, served)
+ asked += hrefs.length - gaps.skipped.length
+ for (const href of gaps.skipped) skipped.add(href)
+ missing.push(...gaps.missing.map((gap) => `${path}: ${gap}`))
}
- assert(marked > 3, `Only ${marked} links were marked for a card, so the pages were not measured`)
+ assert(asked > 3, `Only ${asked} links were asked for a payload, so the pages were not measured`)
assert.deepEqual(missing, [], `A link marked for a card that has none:\n${missing.join('\n')}`)
- // The control: a link marked for a card whose payload does not exist opens nothing, and the sweep above would name it.
+ // The controls. A payload missing on a destination the build serves is reported, and a destination it does not serve is
+ // left out and not reported, so the sweep cannot go green by skipping what it should have asked.
+ if (served) {
+ const kept = `${build.root}/${build.ports[0].slug}/${build.version}/${build.segment}/no-such-declaration/`
+ const elsewhere = build.version === 'stable' ? 'latest' : 'stable'
+ const away = `${build.root}/${build.ports.find((port) => port.versionedDocs).slug}/${elsewhere}/${build.segment}/no-such-declaration/`
+ const control = await payloadGaps(page.request, origin, [kept, away], served)
+ assert.deepEqual(control.missing, [`${kept} answers 404`], 'A payload missing on a served port was not reported')
+ assert.deepEqual(control.skipped, [away], 'A destination the build does not serve was asked for a payload')
+ }
+ // A link marked for a card whose payload does not exist opens nothing.
await page.goto(`${base}/tmux/latest/manual/list-panes/`, { waitUntil: 'load' })
await page.waitForFunction(() => document.documentElement.dataset.pageReadiness === 'ready')
await page.evaluate(() => {
@@ -578,11 +631,12 @@ export async function checkTmuxReferencePreviews(browser, base) {
anchor.textContent = 'no_such_declaration'
document.querySelector('main').prepend(anchor)
})
- const absent = await page.request.get(`${base.replace(/\/en$/, '')}/en/tmux/latest/reference/c-function-no-such-declaration.preview.json`)
+ const absent = await page.request.get(`${origin}/en/tmux/latest/reference/c-function-no-such-declaration.preview.json`)
assert.equal(absent.status(), 404, 'The control address answered, so the sweep cannot show a missing payload')
- await page.locator('#no-card').hover()
+ // The pointer arrives as the browser delivers it, to the link itself, so a sticky header over the top of the page cannot take it.
+ await page.evaluate(() => document.getElementById('no-card').dispatchEvent(new PointerEvent('pointerover', { pointerType: 'mouse', bubbles: true })))
await page.waitForTimeout(700)
assert.equal(await opened(), false, 'A link with no payload opened a card')
- console.log(`Tmux reference previews: the C function link of a method page opens its card with its signature; ${marked} marked links on four pages each have a payload; a link with none opens nothing PASS`)
+ console.log(`Tmux reference previews: the C function link of a method page opens its card with its signature; ${asked} marked links on four pages each have a payload (${skipped.size} to trees this build does not serve were not asked); a payload missing on a served port is reported, and a link with none opens nothing PASS`)
} finally { await context.close() }
}
diff --git a/site/test/preview-check.test.ts b/site/test/preview-check.test.ts
new file mode 100644
index 000000000..bed3aa6b2
--- /dev/null
+++ b/site/test/preview-check.test.ts
@@ -0,0 +1,56 @@
+import { describe, expect, it } from 'vitest'
+import { payloadGaps, servedByBuild } from '../scripts/check-page-readiness.mjs'
+import { PORTS, referenceSegment, referenceUrl } from '../src/lib/ports'
+import { buildTarget, linkedVersionFor } from '../src/lib/versions'
+
+/**
+ * The browser check of preview cards asks each marked link's payload from the build it runs against. The build serves one
+ * version of each port's reference, so a link to another version names a tree it does not contain, and the check must
+ * leave that out and still ask for everything the build does serve.
+ */
+const environment = (defaults: Record) => ({ LIBTMUX_DOCS_VERSION: 'latest', LIBTMUX_DOCS_PORT_DEFAULTS: JSON.stringify(defaults) })
+const build = (env: Record) => ({ root: '', ports: PORTS, version: buildTarget(env).version, segment: referenceSegment('core') })
+/** Where the site sends a link to a port's core reference, at the version the assembly's defaults give it. */
+const linked = (env: Record) => PORTS.map((port) => ({ port, href: `${referenceUrl(port, linkedVersionFor(port.slug, env))}some-declaration/` }))
+
+describe('which destinations the build under test serves', () => {
+ it('leaves out a port whose reference the links name at another version, and asks for every other port', () => {
+ const env = environment({ py: 'stable' })
+ const unserved = linked(env).filter(({ href }) => !servedByBuild(href, build(env))).map(({ port }) => port.slug)
+ expect(unserved).toEqual(['py'])
+ // The links of the other ports name the version the build serves.
+ expect(linked(env).filter(({ port }) => port.slug !== 'py').every(({ href }) => servedByBuild(href, build(env)))).toBe(true)
+ })
+
+ it('follows the site: another default moves which port is left out, and none is named in the check', () => {
+ const env = environment({ ts: 'v1.2', go: 'latest' })
+ expect(linked(env).filter(({ href }) => !servedByBuild(href, build(env))).map(({ port }) => port.slug)).toEqual(['ts'])
+ expect(linked(environment({})).filter(({ href }) => !servedByBuild(href, build(environment({})))).map(({ port }) => port.slug)).toEqual([])
+ })
+
+ it('serves what is not a port reference at whatever version a link names', () => {
+ const env = environment({ py: 'stable' })
+ const py = PORTS.find((port) => port.slug === 'py')!
+ for (const href of [
+ '/tmux/latest/reference/c-function-cmd-list-panes-c-cmd_list_panes_server/', '/tmux/3.2a/manual/list-panes/', '/tmux/latest/catalog/options/status-left/',
+ `${referenceUrl(py, 'stable', 'mcp')}tool/`, `${referenceUrl(py, 'stable', 'workspace')}builder/`, '/py/stable/guides/attaching-to-tmux/',
+ ]) expect(servedByBuild(href, build(env)), href).toBe(true)
+ // The same pages under a root, as the dev server mounts them.
+ expect(servedByBuild('/en/py/stable/reference/libtmux-server-panes/', { ...build(env), root: '/en' })).toBe(false)
+ expect(servedByBuild('/en/cxx/latest/reference/libtmux-server-panes/', { ...build(env), root: '/en' })).toBe(true)
+ })
+})
+
+describe('asking for payloads', () => {
+ const request = (answers: Record) => ({ get: async (url: string) => ({ ok: () => answers[url] === 200, status: () => answers[url] ?? 404 }) })
+
+ it('reports a payload missing on a destination the build serves and names none it does not', async () => {
+ const env = environment({ py: 'stable' })
+ const served = (href: string) => servedByBuild(href, { ...build(env), root: '/en' })
+ const asked = request({ 'http://x/en/cxx/latest/reference/a.preview.json': 200 })
+ const hrefs = ['/en/cxx/latest/reference/a/', '/en/cxx/latest/reference/missing/', '/en/py/stable/reference/b/']
+ expect(await payloadGaps(asked, 'http://x', hrefs, served)).toEqual({ missing: ['/en/cxx/latest/reference/missing/ answers 404'], skipped: ['/en/py/stable/reference/b/'] })
+ // The control: asking for everything reports the destination the build does not contain too, which is the failure this check had.
+ expect(await payloadGaps(asked, 'http://x', hrefs, undefined)).toEqual({ missing: ['/en/cxx/latest/reference/missing/ answers 404', '/en/py/stable/reference/b/ answers 404'], skipped: [] })
+ })
+})
From 29d5890e7bc65bb8dafe0b52a962455971a2d063 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Tue, 20 Oct 2026 07:37:00 -0500
Subject: [PATCH 21/53] fix(site[tmux-usage]) Keep a chip at the width its name
needs beside its qualifier
why: On the list-panes manual page the F# `newSession` chip, a name of ten characters
with the qualifier "the spec names a first window", wrapped its name at 1440, 1134 and
900px, in a cell with room to spare. The item holding the chip and its qualifier was a
flex row that could not wrap, and the qualifier could not wrap either (`white-space:
nowrap`), so the row, narrower than the two side by side, took the width from the chip:
a flex item with `overflow: hidden` has no minimum width, so the chip shrank until its
name broke at its `` points. The chip should give up nothing to its qualifier.
what:
- The item may wrap (`flex-wrap: wrap`), the chip does not shrink (`flex: none`, still
limited to the cell by its `max-inline-size`), and the qualifier wraps in the cell
(`white-space: normal`). The qualifier sits beside the chip when it fits and drops under
it when it does not, and a name wider than the cell wraps inside its chip, which grows.
Every chip with a qualifier gets this, since it is the item's rule.
- `qualifierProblems` in the chip-growth browser check reads each qualified chip on the
page: it is at least as wide as the width its name needs, read from a copy in a box too
wide to wrap anything and set in the chip's own type (not by hiding the qualifier, which
would let the table lay out its columns again), or as wide as its cell when that is
narrower, and its qualifier is not over it. A copy of a qualified chip in an 11rem
cell is measured too, where the qualifier cannot sit beside the chip. The control puts the
old layout back and requires the check to say the chip is narrower than its name needs.
- Vitest: the layout test asserts the three rules and catches the layout of b8f892310 as a
variant; the check is also read on written-down boxes (a chip at its width with the
qualifier beside it or under it, a cell narrower than the name, a chip squeezed to 62px
of 290 that needs 80, a qualifier laid over its chip).
- CONTRIBUTING.md names the check.
Not run in a browser: whether the table gives the F# column less room now that its
qualifier can wrap, and whether the chip is then 20px at these widths, is for the
gate to show.
---
CONTRIBUTING.md | 7 +-
site/scripts/check-badge-centring.mjs | 148 +++++++++++++++++++++--
site/scripts/check-dev.mjs | 6 +-
site/src/components/tmux/TmuxUsage.astro | 11 +-
site/test/chip-growth.test.ts | 2 +-
site/test/tmux-library-usage.test.ts | 13 ++
site/test/usage-qualifier-check.test.ts | 61 ++++++++++
7 files changed, 232 insertions(+), 16 deletions(-)
create mode 100644 site/test/usage-qualifier-check.test.ts
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7334ce240..b8b15a132 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -159,8 +159,11 @@ grows with a name that wraps, so a related chip's mark is held flush with its
corner and as tall as the first line. The gate measures the Related APIs chips
on the Scala Server, Session, Window, Pane and Client pages at 1440 pixels,
where a name wraps onto several lines, and requires each chip to hold its name
-and clear the next. Each check ends with a negative control that breaks what it
-holds and requires the gate to notice, by the problem it names:
+and clear the next. It reads the chips of the usage table on the `list-panes`
+manual page the same way, and requires a chip with a qualifier to keep the width
+its name needs, with the qualifier beside it or under it. Each check ends with a
+negative control that breaks what it holds and requires the gate to notice, by
+the problem it names:
```console
$ node site/scripts/check-dev.mjs --badge-centring
diff --git a/site/scripts/check-badge-centring.mjs b/site/scripts/check-badge-centring.mjs
index a4fc6f0ba..0fab4b5bd 100644
--- a/site/scripts/check-badge-centring.mjs
+++ b/site/scripts/check-badge-centring.mjs
@@ -231,7 +231,7 @@ export function judgeChipGrowth(chips) {
const slack = 0.51
const problems = []
for (const chip of chips) {
- const { text, box, mark, lines, border, line, rail } = chip
+ const { text, box, mark, lines, border, line, rail, where = 'Related APIs column' } = chip
if (!lines.length) { problems.push(`${text}: the name has no line to measure`); continue }
const top = box.top + border
const bottom = box.bottom - border
@@ -245,7 +245,7 @@ export function judgeChipGrowth(chips) {
if (Math.abs(mark.top - top) > slack) problems.push(`${text}: the mark left the top of the chip`)
const offset = (lines[0].top + lines[0].bottom) / 2 - (mark.top + mark.bottom) / 2
if (Math.abs(offset) > 1) problems.push(`${text}: the first line of the name is ${Math.abs(offset).toFixed(1)}px ${offset < 0 ? 'above' : 'below'} the centre of the mark`)
- if (box.left < rail.left - slack || box.right > rail.right + slack) problems.push(`${text}: the chip runs out of the Related APIs column`)
+ if (box.left < rail.left - slack || box.right > rail.right + slack) problems.push(`${text}: the chip runs out of the ${where}`)
}
for (let i = 0; i < chips.length; i++) for (let j = i + 1; j < chips.length; j++) {
const a = chips[i].box
@@ -257,11 +257,14 @@ export function judgeChipGrowth(chips) {
return problems
}
-/** The boxes and lines of every Related APIs chip on the page, judged by `judgeChipGrowth`. */
-export async function chipGrowthProblems(page) {
- const chips = await page.evaluate(() => {
+/**
+ * The boxes and lines of every chip of one list on the page, judged by `judgeChipGrowth`. The list is the Related APIs
+ * rail unless `scope` names another: the `.tmux-usage` table of senders on a tmux command page.
+ */
+export async function chipGrowthProblems(page, scope = { list: 'nav.api-related', where: 'Related APIs column' }) {
+ const chips = await page.evaluate(({ list, where }) => {
const plain = (r) => ({ top: r.top, bottom: r.bottom, left: r.left, right: r.right })
- return [...document.querySelectorAll('nav.api-related a:has(> .api-nav__kind)')].filter((a) => a.offsetParent).map((a) => {
+ return [...document.querySelectorAll(`${list} a:has(> .api-nav__kind)`)].filter((a) => a.offsetParent).map((a) => {
const name = a.querySelector(':scope > .api-nav__kind + code')
const range = document.createRange()
range.selectNodeContents(name)
@@ -275,14 +278,53 @@ export async function chipGrowthProblems(page) {
const box = a.getBoundingClientRect()
return {
text: name.textContent.trim(), box: plain(box), mark: plain(a.querySelector(':scope > .api-nav__kind').getBoundingClientRect()), lines,
- border: parseFloat(style.borderTopWidth) || 0, line: parseFloat(style.minHeight) || box.height, rail: plain(a.closest('nav.api-related').getBoundingClientRect()),
+ border: parseFloat(style.borderTopWidth) || 0, line: parseFloat(style.minHeight) || box.height, rail: plain(a.closest(list).getBoundingClientRect()), where,
clipped: a.scrollHeight > a.clientHeight + 1 || a.scrollWidth > a.clientWidth + 1,
}
})
- })
+ }, scope)
return { chips: chips.length, wrapped: chips.filter((chip) => chip.lines.length > 1).length, problems: judgeChipGrowth(chips) }
}
+/**
+ * A qualifier ("the spec names a first window") sits beside its chip or under it, and the chip keeps the width its name needs
+ * unless the cell is narrower than that: a chip that shrank to make room for its qualifier wrapped a name of ten characters in
+ * a cell with room to spare. The width a chip needs is read from a copy of it in a box too wide to wrap anything, not by
+ * hiding the qualifier, which would let the table lay its columns out again and move the cell being measured.
+ */
+export async function qualifierProblems(page) {
+ return page.evaluate(() => {
+ const problems = []
+ let asked = 0
+ const wide = document.createElement('div')
+ wide.className = 'tmux-usage'
+ wide.style.cssText = 'position:fixed;top:0;left:0;visibility:hidden;pointer-events:none;inline-size:4000px'
+ document.body.append(wide)
+ for (const item of document.querySelectorAll('.tmux-usage__item')) {
+ const chip = item.querySelector(':scope > a')
+ const when = item.querySelector(':scope > .tmux-usage__when')
+ if (!chip || !when || !item.offsetParent) continue
+ asked++
+ const name = chip.textContent.trim()
+ // The copy is set in the type the chip is set in, since every length of a chip is in em.
+ const type = getComputedStyle(item)
+ Object.assign(wide.style, { fontSize: type.fontSize, fontFamily: type.fontFamily, fontWeight: type.fontWeight, letterSpacing: type.letterSpacing })
+ const copy = chip.cloneNode(true)
+ wide.replaceChildren(copy)
+ const needs = copy.getBoundingClientRect().width
+ const box = chip.getBoundingClientRect()
+ const room = item.getBoundingClientRect().width
+ if (box.width < Math.min(needs, room) - 1) problems.push(`${name}: it is ${box.width.toFixed(1)}px wide in ${room.toFixed(1)}px of room and its name needs ${needs.toFixed(1)}px`)
+ const qualifier = when.getBoundingClientRect()
+ const across = Math.min(qualifier.right, box.right) - Math.max(qualifier.left, box.left)
+ const down = Math.min(qualifier.bottom, box.bottom) - Math.max(qualifier.top, box.top)
+ if (across > 1 && down > 1) problems.push(`${name}: its qualifier is over it by ${down.toFixed(1)}px`)
+ }
+ wide.remove()
+ return { asked, problems }
+ })
+}
+
/**
* A group heading is one line: the title, the count and the permalink share a baseline.
* Each is probed with a zero-size inline box, which sits on the baseline of the line it is in.
@@ -647,6 +689,95 @@ export async function checkChipGrowth(browser, base) {
} finally { await context.close() }
}
+const USAGE = { list: '.tmux-usage', where: 'usage table' }
+
+/**
+ * The chips of the usage table on the page the maintainer saw them wrap on, `list-panes` at 1134px, and in a container narrow
+ * enough to wrap a name onto three lines, each judged as the Related APIs chips are. A chip with a qualifier keeps the width its
+ * name needs. Each control breaks one thing and the check must name it: a chip pinned to one line's height, a name below its chip,
+ * a chip squeezed by its qualifier and one chip moved onto another.
+ */
+export async function checkUsageChips(browser, base) {
+ const context = await browser.newContext({ viewport: { width: 1134, height: 900 } })
+ const page = await context.newPage()
+ page.setDefaultNavigationTimeout(60000)
+ const ready = () => page.waitForFunction(() => document.documentElement.dataset.pageReadiness === 'ready', null, { timeout: 30000 }).catch(() => {})
+ const measure = () => chipGrowthProblems(page, USAGE)
+ try {
+ await page.goto(`${base}/tmux/latest/manual/list-panes/`, { waitUntil: 'load' })
+ await ready()
+ const real = await measure()
+ assert(real.wrapped > 0, 'No chip wrapped its name at 1134px, so growth was not measured on the page that showed it')
+ assert.deepEqual(real.problems, [], `A chip of the usage table on the list-panes manual page:\n${real.problems.join('\n')}`)
+ // Each chip with a qualifier keeps the width its name needs, and its qualifier is beside it or under it.
+ const qualified = await qualifierProblems(page)
+ assert(qualified.asked > 0, 'No chip with a qualifier on the list-panes manual page, so none was measured')
+ assert.deepEqual(qualified.problems, [], `A qualifier took room from its chip:\n${qualified.problems.join('\n')}`)
+ // A narrow container with a name that fits, one that wraps twice and one that wraps three times.
+ await page.evaluate(() => {
+ const model = document.querySelector('.tmux-usage a:has(> .api-nav__kind)')
+ const box = document.createElement('div')
+ box.className = 'tmux-usage'
+ box.dataset.control = 'narrow'
+ box.style.cssText = 'display:flex;flex-direction:column;align-items:flex-start;gap:6px;inline-size:8.5rem;margin:1rem 0'
+ for (const name of ['Window#panes', 'Async::Server#list_panes', 'LibTmux::Server#search_panes_with_options']) {
+ const chip = model.cloneNode(true)
+ chip.querySelector(':scope > .api-nav__kind + code').innerHTML = name.replace(/(::|(?=[#_]))/g, '$1')
+ box.append(chip)
+ }
+ model.closest('main, article, body').append(box)
+ })
+ const narrow = await measure()
+ assert(narrow.wrapped >= real.wrapped + 2, 'The narrow container did not wrap the long names')
+ assert.deepEqual(narrow.problems, [], `A wrapped chip in a narrow container:\n${narrow.problems.join('\n')}`)
+ // A qualified chip in a cell too narrow to hold it and its qualifier side by side: the qualifier goes under the chip, which keeps its size.
+ const addQualified = () => page.evaluate(() => {
+ const item = [...document.querySelectorAll('.tmux-usage__item')].find((entry) => entry.querySelector(':scope > .tmux-usage__when'))
+ const links = item.parentElement.cloneNode(false)
+ links.dataset.control = 'qualified'
+ links.style.cssText = 'inline-size:11rem;margin:1rem 0'
+ links.append(item.cloneNode(true))
+ item.closest('.tmux-usage').append(links)
+ })
+ await addQualified()
+ const narrowQualified = await qualifierProblems(page)
+ assert(narrowQualified.asked === qualified.asked + 1, 'The qualified chip in a narrow cell was not measured')
+ assert.deepEqual(narrowQualified.problems, [], `A qualifier took room from its chip in a narrow cell:\n${narrowQualified.problems.join('\n')}`)
+ const fresh = async () => {
+ await page.reload({ waitUntil: 'load' })
+ await ready()
+ }
+ const CHIP = '.tmux-usage a:has(> .api-nav__kind)'
+ // Control 1: a chip held to one line's height cannot hold a name of two lines, so the name spills out of it.
+ await fresh()
+ await page.addStyleTag({ content: `${CHIP} { height: var(--sp-h) !important; min-height: 0 !important; }` })
+ const pinned = await measure()
+ assert(pinned.problems.some((problem) => /the chip is still one line tall/.test(problem)), 'The check did not notice a chip too short for its name')
+ assert(pinned.problems.some((problem) => /the name starts .* above the chip's top edge/.test(problem)), 'The check did not notice a name spilling out of the top of its chip')
+ // Control 2: a name that ends below its chip's bottom edge.
+ await fresh()
+ await page.addStyleTag({ content: `${CHIP} > .api-nav__kind + code { margin-bottom: -8px !important; }` })
+ const below = await measure()
+ assert(below.problems.some((problem) => /runs .* past the chip's bottom edge/.test(problem)), 'The check did not notice a name running past its chip')
+ // Control 3: the layout this replaced, in which the chip shrinks beside a qualifier that cannot wrap, so its name wraps with room to spare.
+ await fresh()
+ await addQualified()
+ await page.addStyleTag({ content: '.tmux-usage__item { flex-wrap: nowrap !important; white-space: nowrap !important; } .tmux-usage__item > a { flex: 0 1 auto !important; } .tmux-usage__when { white-space: nowrap !important; }' })
+ const squeezed = await qualifierProblems(page)
+ assert(squeezed.problems.some((problem) => /px wide in .*px of room and its name needs/.test(problem)), 'The check did not notice a chip that shrank for its qualifier')
+ // Control 4: a chip moved onto the one above it overlaps.
+ await fresh()
+ await page.evaluate(() => {
+ const items = [...document.querySelectorAll('.tmux-usage__item a:has(> .api-nav__kind)')]
+ const second = items.find((chip, index) => items[index - 1] && chip.parentElement === items[index - 1].parentElement) ?? items[1]
+ second.style.transform = 'translateY(-12px)'
+ })
+ const moved = await measure()
+ assert(moved.problems.some((problem) => /overlaps/.test(problem)), 'The check did not notice a chip on top of the one above')
+ console.log(`Usage chips: ${real.chips} chips on the list-panes manual page (${real.wrapped} wrapped) and 3 in an 8.5rem container, each tall enough for its name, level with its mark and clear of the next, and ${qualified.asked + 1} qualified chips at the width their names need; controls caught a pinned height (${pinned.problems.length} problems), a name below its chip (${below.problems.length}), a chip squeezed by its qualifier (${squeezed.problems.length}) and an overlap (${moved.problems.length}) PASS`)
+ } finally { await context.close() }
+}
+
if (import.meta.url === `file://${process.argv[1]}`) {
const url = process.argv.find((arg) => arg.startsWith('--url='))?.slice(6) ?? 'http://localhost:47392/en'
const browser = await chromium.launch()
@@ -654,5 +785,6 @@ if (import.meta.url === `file://${process.argv[1]}`) {
await checkBadgeCentring(browser, url, { sample: process.argv.includes('--sample') })
await checkMentionDensity(browser, url)
await checkChipGrowth(browser, url)
+ await checkUsageChips(browser, url)
} finally { await browser.close() }
}
diff --git a/site/scripts/check-dev.mjs b/site/scripts/check-dev.mjs
index 5ad912ce0..7b785ec30 100644
--- a/site/scripts/check-dev.mjs
+++ b/site/scripts/check-dev.mjs
@@ -18,7 +18,7 @@ import { checkColorScheme } from './check-color-scheme.mjs'
import { checkHomeExampleOptions } from './check-home-example-options.mjs'
import { checkDevSample, checkRowPermalinks } from './check-dev-sample.mjs'
import { checkDeclarationControlAlignment, checkDeclarationControlsLevel, checkMemberBodyInsets, checkNativeSignatureGeometry, checkNativeSignatureLinks } from './check-native-layout.mjs'
-import { checkBadgeCentring, checkChipGrowth, checkMentionDensity } from './check-badge-centring.mjs'
+import { checkBadgeCentring, checkChipGrowth, checkMentionDensity, checkUsageChips } from './check-badge-centring.mjs'
import { checkBlockLinksUndecorated, checkKindBadgeLinks, checkRequiredAppearance, checkTmuxReferencePreviews, checkWebAnalytics, checkWebAnalyticsTransitions } from './check-page-readiness.mjs'
import { checkTypeParameters } from './check-type-parameters.mjs'
import { checkTmuxKeys, TMUX_KEY_PAGES } from './check-tmux-keys.mjs'
@@ -809,6 +809,7 @@ try {
await retryReload(() => checkBadgeCentring(browser, base))
await checkMentionDensity(browser, base)
await checkChipGrowth(browser, base)
+ await checkUsageChips(browser, base)
} else if (referencePreviewsOnly) {
await retryReload(() => checkTmuxReferencePreviews(browser, base, { served: servedBuild(base) }))
} else if (referencePreferencesOnly) {
@@ -886,7 +887,8 @@ try {
const kindBadges = schedule(() => retryReload(() => checkKindBadgeLinks(browser, base)))
const badgeCentring = schedule(() => retryReload(() => checkBadgeCentring(browser, base, { sample: sampleOnly }))
.then(() => checkMentionDensity(browser, base))
- .then(() => checkChipGrowth(browser, base)))
+ .then(() => checkChipGrowth(browser, base))
+ .then(() => checkUsageChips(browser, base)))
const blockLinks = schedule(() => retryReload(() => checkBlockLinksUndecorated(browser, base)))
const referencePreviews = schedule(() => retryReload(() => checkTmuxReferencePreviews(browser, base, { served: servedBuild(base) })))
await apiAnchors
diff --git a/site/src/components/tmux/TmuxUsage.astro b/site/src/components/tmux/TmuxUsage.astro
index ac2143083..343c94ff4 100644
--- a/site/src/components/tmux/TmuxUsage.astro
+++ b/site/src/components/tmux/TmuxUsage.astro
@@ -73,9 +73,14 @@ const headingOf = (group: (typeof usage.groups)[number]) => group.scope ? group.
/* Chips stack flush at the start of the cell, one to a line, with an even gap. */
.tmux-usage__links { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.tmux-usage__links a, .tmux-usage__links code { white-space: nowrap; overflow-wrap: normal; }
- /* A send that only some calls make says when, beside the method on its line, quieter than the name. */
- .tmux-usage__item { display: inline-flex; align-items: baseline; gap: 0.5rem; white-space: nowrap; }
- .tmux-usage__when { opacity: 0.65; font-size: 0.75rem; }
+ /*
+ * A send that only some calls make says when, beside the method on its line, quieter than the name. The chip never gives
+ * up width to it: a chip that shrank wrapped its name to make room, so the qualifier goes under the chip when it does not
+ * fit beside it, and wraps in the cell when it is wider than that.
+ */
+ .tmux-usage__item { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.5rem; max-inline-size: 100%; }
+ .tmux-usage__item > a { flex: none; }
+ .tmux-usage__when { opacity: 0.65; font-size: 0.75rem; white-space: normal; }
/* The scope columns no longer fit beside each other: give each language its own block. */
@container tmux-usage (max-width: 50rem) {
.tmux-usage thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
diff --git a/site/test/chip-growth.test.ts b/site/test/chip-growth.test.ts
index bfeeae36a..1659a79d1 100644
--- a/site/test/chip-growth.test.ts
+++ b/site/test/chip-growth.test.ts
@@ -9,7 +9,7 @@ import { judgeChipGrowth, railProblems } from '../scripts/check-badge-centring.m
*/
const marks = readFileSync(new URL('../src/styles/kind-marks.css', import.meta.url), 'utf8')
-const CHIPS = ':is(.api-elsewhere-value, .api-command-related, nav.api-related)'
+const CHIPS = ':is(.api-elsewhere-value, .api-command-related, .tmux-usage, nav.api-related)'
/** The declarations of the rule whose selector is `selector`, comments removed. */
function declarations(css: string, selector: string): Record | undefined {
const plain = css.replace(/\/\*[\s\S]*?\*\//g, '')
diff --git a/site/test/tmux-library-usage.test.ts b/site/test/tmux-library-usage.test.ts
index b2d5f70aa..9879c50a4 100644
--- a/site/test/tmux-library-usage.test.ts
+++ b/site/test/tmux-library-usage.test.ts
@@ -895,6 +895,13 @@ function layoutProblems(css: string): string[] {
const held = rules.some((rule) => chips(rule) && rule.selector.split(',').some((part) => part.trim().endsWith(` ${target}`)) && rule.body['white-space'] === 'nowrap')
if (!held) problems.push(`a chip's ${target} can wrap`)
}
+ // A qualifier never takes the chip's width: the chip does not shrink, and the qualifier drops under it and wraps instead.
+ const item = rules.find((rule) => rule.selector.trim() === '.tmux-usage__item')?.body
+ const chip = rules.find((rule) => rule.selector.trim() === '.tmux-usage__item > a')?.body
+ const when = rules.find((rule) => rule.selector.trim() === '.tmux-usage__when')?.body
+ if (!chip || !(chip.flex === 'none' || chip['flex-shrink'] === '0')) problems.push('a chip shrinks to make room for its qualifier')
+ if (item?.['flex-wrap'] !== 'wrap') problems.push('a qualifier cannot drop under its chip')
+ if (item?.['white-space'] === 'nowrap' || when?.['white-space'] !== 'normal') problems.push('a qualifier cannot wrap in the cell')
for (const rule of rules.filter((candidate) => /(?:^|[\s,])td\b|__links/.test(candidate.selector) && !/__function/.test(candidate.selector))) {
if (/anywhere|break-word/.test(rule.body['overflow-wrap'] ?? '') || rule.body['word-break'] === 'break-all') problems.push(`${rule.selector} breaks a name anywhere`)
}
@@ -923,6 +930,12 @@ describe('the chip layout of the usage table', () => {
.replace(/\.tmux-usage__links a, \.tmux-usage__links code \{[^}]*\}/, '.tmux-usage__links > a + a { margin-inline-start: 0.4rem; }\n .tmux-usage__links > a { white-space: nowrap; }\n .tmux-usage td { overflow-wrap: anywhere; }')
.replace(' overflow-x: auto; container: tmux-usage / inline-size;', '')
.replace(/@container tmux-usage \(max-width: 50rem\)/, '@media (max-width: 40rem)')
+ // The layout of b8f892310: the chip shrinks beside a qualifier that cannot wrap, so a name of ten characters wraps in a wide cell.
+ const squeezed = css
+ .replace(/\.tmux-usage__item \{[^}]*\}/, '.tmux-usage__item { display: inline-flex; align-items: baseline; gap: 0.5rem; white-space: nowrap; }')
+ .replace(/\s*\.tmux-usage__item > a \{[^}]*\}/, '')
+ .replace(/\.tmux-usage__when \{[^}]*\}/, '.tmux-usage__when { opacity: 0.65; font-size: 0.75rem; }')
+ expect(layoutProblems(squeezed)).toEqual(['a chip shrinks to make room for its qualifier', 'a qualifier cannot drop under its chip', 'a qualifier cannot wrap in the cell'])
const collision = css.replace(':is(table, tbody, th) {', ':is(table, tbody, th, td) {')
expect(layoutProblems(collision)).toEqual(['td is both block and grid when stacked'])
const problems = layoutProblems(before)
diff --git a/site/test/usage-qualifier-check.test.ts b/site/test/usage-qualifier-check.test.ts
new file mode 100644
index 000000000..6da4ecc23
--- /dev/null
+++ b/site/test/usage-qualifier-check.test.ts
@@ -0,0 +1,61 @@
+import { Window } from 'happy-dom'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import { qualifierProblems } from '../scripts/check-badge-centring.mjs'
+
+/**
+ * The browser check of the usage table judges boxes it reads from the page. Here the boxes are written down, one chip and
+ * its qualifier at a time, so the judgement can be read without a browser: a chip that keeps the width its name needs passes,
+ * and a chip that gave up width to its qualifier, or a qualifier laid over its chip, is named.
+ */
+const windows: Window[] = []
+afterEach(async () => { vi.unstubAllGlobals(); for (const win of windows.splice(0)) await win.happyDOM.abort() })
+
+interface Box { top: number; left: number; width: number; height: number }
+interface Qualified { chip: Box; needs: number; room: number; when: Box }
+
+/** Items of the usage table, each a chip and its qualifier, with the width the chip's name needs and the room its cell gives it. */
+async function qualified(items: Qualified[]) {
+ const win = new Window()
+ windows.push(win)
+ const { document } = win
+ document.body.innerHTML = '
'
+ const links = document.querySelector('.tmux-usage__links')!
+ const rect = (box: Box) => ({ top: box.top, left: box.left, bottom: box.top + box.height, right: box.left + box.width, width: box.width, height: box.height })
+ const place = (element: object, box: Box) => Object.defineProperty(element, 'getBoundingClientRect', { value: () => rect(box), configurable: true })
+ Object.defineProperty(win.HTMLElement.prototype, 'offsetParent', { get() { return document.body }, configurable: true })
+ for (const spec of items) {
+ const item = document.createElement('span')
+ item.className = 'tmux-usage__item'
+ item.innerHTML = 'fnewSessionthe spec names a first window'
+ const [chip, when] = [item.querySelector('a')!, item.querySelector('.tmux-usage__when')!]
+ links.append(item)
+ place(item, { top: spec.chip.top, left: spec.chip.left, width: spec.room, height: spec.chip.height })
+ place(chip, spec.chip)
+ place(when, spec.when)
+ // A copy of the chip in the wide measuring box is as wide as its name needs.
+ const clone = chip.cloneNode.bind(chip)
+ Object.defineProperty(chip, 'cloneNode', { value: (deep?: boolean) => { const copy = clone(deep); place(copy, { ...spec.chip, width: spec.needs }); return copy }, configurable: true })
+ }
+ vi.stubGlobal('document', document)
+ vi.stubGlobal('getComputedStyle', win.getComputedStyle.bind(win))
+ return (await qualifierProblems({ evaluate: async (read: () => unknown) => read() })).problems
+}
+
+describe('the qualifier check of the browser gate', () => {
+ const chip = (width: number): Box => ({ top: 0, left: 0, width, height: 20 })
+ const beside: Box = { top: 4, left: 90, width: 190, height: 14 }
+ const under: Box = { top: 22, left: 0, width: 160, height: 28 }
+
+ it('passes a chip at the width its name needs, with its qualifier beside it or under it', async () => {
+ expect(await qualified([{ chip: chip(80), needs: 80, room: 290, when: beside }])).toEqual([])
+ expect(await qualified([{ chip: chip(80), needs: 80, room: 176, when: under }])).toEqual([])
+ // A cell narrower than the name gives it the cell: the chip is as wide as the room, and wraps its name inside.
+ expect(await qualified([{ chip: { top: 0, left: 0, width: 100, height: 35 }, needs: 190, room: 100, when: { top: 38, left: 0, width: 100, height: 28 } }])).toEqual([])
+ })
+
+ it('names a chip that gave up width to its qualifier in a cell with room, and a qualifier laid over its chip', async () => {
+ // The layout of b8f892310: the chip is 62px of 290 and its name of ten characters needs 80.
+ expect(await qualified([{ chip: chip(62), needs: 80, room: 290, when: beside }])).toEqual(['fnewSession: it is 62.0px wide in 290.0px of room and its name needs 80.0px'])
+ expect(await qualified([{ chip: chip(80), needs: 80, room: 290, when: { top: 4, left: 40, width: 190, height: 14 } }])).toEqual(['fnewSession: its qualifier is over it by 14.0px'])
+ })
+})
From 04d5d7f21941894644225ab34fb8cc3b0cf99627 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Tue, 20 Oct 2026 08:06:17 -0500
Subject: [PATCH 22/53] fix(site[tmux-usage]) Forward go's observation
list-windows, record julia's get_hook and the ts launch probe
why: A review of 6c9bfce7b found three sends that no entry recorded, and one sentence
of the README wrong. go `Pane.OpenObservation` list-windows (control_observation.go:350)
holds on every call, but its claim lacked `forwardable`, and the forwarding reads
only forwardable claims, so `Running.StreamTo`, which calls `OpenObservation` at
session_run.go:549, had the other four sends of it and not this one. julia `get_hook`
has no entry, though it reads a hook's command array with `show-options -H` through
`_configuration_hook_rows`, as `set_hook` and `unset_hook` check one before they
write. ts `main` asks `server.isAlive()` on an explicit launch (startup.ts:107), which
sends list-sessions (server_utils.ts:129), and no entry said so. The README said every
default call makes the command-alias reads of a guarded Ruby call, which `Session#kill`
does not: its default takes `super`, so its two entries say `when`.
what:
- The claim for `OpenObservation` list-windows is `forwardable`, so `StreamTo` has it too.
I looked for others: every reviewed claim of java, csharp and go was made forwardable
in a copy of the rules and the wrapper entries regenerated. The claims added since
fbf0b3a3b that gain callers are this one (which holds for every call) and go
`NewSession`'s name lookup (which holds only when a name is given, so it is not
forwarded); the other additions of that experiment are older claims, and the PowerShell
ones stand on `CaptureSnapshotAsync`, which holds only for the depth it was read with.
- julia `get_hook` has show-options, not incidental and with no qualifier: it is what the
function is for, and its ControlConnection method sends it too (control_options.jl:81),
so neither receiver lacks it. Its claim cites the server method's chain.
- ts `main` has list-sessions "an explicit launch", through `isAlive` (server.ts:1301), and
its display-message claim cites startup.ts:107, :110 and :124, the lines that make the
"unless an explicit launch finds no server" qualifier true.
- README: the incidental paragraph says a send a call makes whether or not the caller
asked for it, and says `Session#kill` reads the inventory only when it is given
expected windows or panes.
- Tests: StreamTo has all five sends of `OpenObservation`, get_hook's entry is not
incidental and has no qualifier while `set_hook`'s is, and the ts entries and the lines
cited.
Entries 1851 to 1854 (go 228 to 229, julia 73 to 74, ts 119 to 120); conditions 122 to 123 (ts 12 to 13).
---
scripts/README.md | 11 ++--
scripts/tmux-usage/claims.json | 94 ++++++++++++++++++++++++++++
site/src/data/tmux-usage/go.json | 18 ++++++
site/src/data/tmux-usage/julia.json | 14 +++++
site/src/data/tmux-usage/ts.json | 15 +++++
site/test/tmux-library-usage.test.ts | 16 +++++
6 files changed, 164 insertions(+), 4 deletions(-)
diff --git a/scripts/README.md b/scripts/README.md
index 549790528..25abe015e 100644
--- a/scripts/README.md
+++ b/scripts/README.md
@@ -302,10 +302,13 @@ negative script seeds a rule that is wrong:
`copy-mode` branch of a helper that `enterCopyMode` shares), or a request
option that a wrapper never sets. Each cites the lines that show the guard,
an exclusion that removes nothing fails, and `commands` limits it to those
- commands of the symbols it names. A send that every default call makes is not an
- exclusion, even when the method only makes it to prepare the call: it is
- `incidental`, as the command-alias inventory a guarded Ruby call reads before
- it sends is (`show-options` and `list-commands`, on the same nine symbols).
+ commands of the symbols it names. A send that a call makes whether or not the
+ caller asked for it is not an exclusion, even when the method only makes it to
+ prepare the call: it is `incidental`, as the command-alias inventory a guarded
+ Ruby call reads before it sends is (`show-options` and `list-commands`, on the
+ same nine symbols). `Session#kill` reads it only when it is given expected
+ windows or panes, since its default call takes `super`, so its two entries say
+ `when`.
- `dispatchers.json`: the calls that send what they are given, per port, and the
calls that only build a command value. Each cites the lines of the pinned
source that show it and, for a call that sends, the chain from there to a
diff --git a/scripts/tmux-usage/claims.json b/scripts/tmux-usage/claims.json
index 0d2fa8c3b..8209aabca 100644
--- a/scripts/tmux-usage/claims.json
+++ b/scripts/tmux-usage/claims.json
@@ -2021,6 +2021,60 @@
"server.cmd(\"display-message\""
]
},
+ {
+ "at": "packages/mcp/src/startup.ts:107",
+ "has": [
+ "server.isAlive()"
+ ]
+ },
+ {
+ "at": "packages/mcp/src/startup.ts:110",
+ "has": [
+ "server.cmd(\"display-message\""
+ ]
+ },
+ {
+ "at": "packages/mcp/src/startup.ts:124",
+ "has": [
+ "return Object.freeze("
+ ]
+ },
+ {
+ "at": "packages/mcp/src/server.ts:244",
+ "has": [
+ "inspectServerStartup("
+ ],
+ "in": "mcp.server.main"
+ }
+ ]
+ },
+ {
+ "port": "ts",
+ "symbol": "mcp.server.main",
+ "command": "list-sessions",
+ "scope": null,
+ "when": "an explicit launch",
+ "evidence": [
+ {
+ "at": "packages/libtmux/src/_internal/operations/server_utils.ts:129",
+ "has": [
+ "runtime.transport.execute(",
+ "[\"list-sessions\"]"
+ ],
+ "span": 6
+ },
+ {
+ "at": "packages/libtmux/src/server.ts:1301",
+ "has": [
+ "isAlive(runtimeForServer(this))"
+ ]
+ },
+ {
+ "at": "packages/mcp/src/startup.ts:107",
+ "has": [
+ "server.isAlive()"
+ ]
+ },
{
"at": "packages/mcp/src/server.ts:244",
"has": [
@@ -11016,6 +11070,45 @@
}
]
},
+ {
+ "port": "julia",
+ "symbol": "LibTmux.get_hook",
+ "command": "show-options",
+ "scope": null,
+ "evidence": [
+ {
+ "at": "src/configuration.jl:159",
+ "has": [
+ "\"show-options\""
+ ]
+ },
+ {
+ "at": "src/configuration.jl:160",
+ "has": [
+ "_operation_command(context, args...)"
+ ]
+ },
+ {
+ "at": "src/configuration.jl:176",
+ "has": [
+ "_configuration_rows(context, scope, name)"
+ ]
+ },
+ {
+ "at": "src/configuration.jl:403",
+ "has": [
+ "_configuration_option_rows(context, scope, name)"
+ ]
+ },
+ {
+ "at": "src/configuration.jl:439",
+ "has": [
+ "_configuration_hook_rows(context, scope, args.name)"
+ ],
+ "in": "LibTmux.get_hook"
+ }
+ ]
+ },
{
"port": "cxx",
"symbol": "libtmux::Connection::set_pane_output",
@@ -13252,6 +13345,7 @@
"symbol": "tmux.Pane.OpenObservation",
"command": "list-windows",
"scope": "session",
+ "forwardable": true,
"evidence": [
{
"at": "tmux/control_observation.go:346",
diff --git a/site/src/data/tmux-usage/go.json b/site/src/data/tmux-usage/go.json
index 0cfca0dde..9a534b5a8 100644
--- a/site/src/data/tmux-usage/go.json
+++ b/site/src/data/tmux-usage/go.json
@@ -751,6 +751,7 @@
"tmux/control_observation.go:346",
"tmux/control_observation.go:301"
],
+ "forwardable": true,
"reviewed": true,
"scope": "session"
},
@@ -1071,6 +1072,23 @@
"symbol": "tmux.Pane.OpenObservation"
}
},
+ {
+ "command": "list-windows",
+ "evidence": [
+ "tmux/session_run.go:549"
+ ],
+ "scope": "session",
+ "via": {
+ "evidence": [
+ "tmux/control_observation.go:346",
+ "tmux/control_observation.go:301"
+ ],
+ "port": "go",
+ "reviewed": true,
+ "revision": "6f3df55f8a41999e41225eefb3940545b834e6a2",
+ "symbol": "tmux.Pane.OpenObservation"
+ }
+ },
{
"command": "refresh-client",
"evidence": [
diff --git a/site/src/data/tmux-usage/julia.json b/site/src/data/tmux-usage/julia.json
index 22d9f8011..59866eddc 100644
--- a/site/src/data/tmux-usage/julia.json
+++ b/site/src/data/tmux-usage/julia.json
@@ -208,6 +208,20 @@
"when": "on a Server"
}
],
+ "LibTmux.get_hook": [
+ {
+ "command": "show-options",
+ "evidence": [
+ "src/configuration.jl:159",
+ "src/configuration.jl:160",
+ "src/configuration.jl:176",
+ "src/configuration.jl:403",
+ "src/configuration.jl:439"
+ ],
+ "reviewed": true,
+ "scope": null
+ }
+ ],
"LibTmux.get_option": [
{
"command": "show-options",
diff --git a/site/src/data/tmux-usage/ts.json b/site/src/data/tmux-usage/ts.json
index 43063d3cf..a0c607d6d 100644
--- a/site/src/data/tmux-usage/ts.json
+++ b/site/src/data/tmux-usage/ts.json
@@ -122,12 +122,27 @@
"command": "display-message",
"evidence": [
"packages/mcp/src/startup.ts:92",
+ "packages/mcp/src/startup.ts:107",
+ "packages/mcp/src/startup.ts:110",
+ "packages/mcp/src/startup.ts:124",
"packages/mcp/src/server.ts:244"
],
"reviewed": true,
"scope": null,
"when": "unless an explicit launch finds no server"
},
+ {
+ "command": "list-sessions",
+ "evidence": [
+ "packages/libtmux/src/_internal/operations/server_utils.ts:129",
+ "packages/libtmux/src/server.ts:1301",
+ "packages/mcp/src/startup.ts:107",
+ "packages/mcp/src/server.ts:244"
+ ],
+ "reviewed": true,
+ "scope": null,
+ "when": "an explicit launch"
+ },
{
"command": "show-options",
"evidence": [
diff --git a/site/test/tmux-library-usage.test.ts b/site/test/tmux-library-usage.test.ts
index 9879c50a4..bce6268cc 100644
--- a/site/test/tmux-library-usage.test.ts
+++ b/site/test/tmux-library-usage.test.ts
@@ -361,6 +361,22 @@ describe('a release a library refuses to send on', () => {
expect(use('java', main, 'display-message')?.evidence[0]).toBe('libtmux-mcp/src/main/java/io/github/libtmux/mcp/LaunchConfiguration.java:111')
// go: the helper registers a kill for the end of the test, which is not a send of the call itself.
expect(use('go', 'tmuxtest.NewSession', 'kill-session')?.when).toBe('the test ends, in t.Cleanup')
+ // ts: an explicit launch asks whether the server is there (list-sessions) and, if it is, for its socket path; the lines that say so are cited.
+ expect(use('ts', 'mcp.server.main', 'list-sessions')).toMatchObject({ when: 'an explicit launch', reviewed: true })
+ expect(use('ts', 'mcp.server.main', 'display-message')?.evidence).toEqual(expect.arrayContaining(['packages/mcp/src/startup.ts:107', 'packages/mcp/src/startup.ts:110', 'packages/mcp/src/startup.ts:124']))
+ })
+
+ it('credits a wrapper with every send of a method it calls, and reads a hook the way it reads an option', () => {
+ // OpenObservation sends list-windows on every call, as it does the other four, so the method that opens one has all five.
+ const sends = (symbol: string) => (TMUX_USAGE.go.symbols[symbol] ?? []).map((entry) => entry.command).sort()
+ expect(sends('tmux.Pane.OpenObservation')).toEqual(['capture-pane', 'delete-buffer', 'list-windows', 'refresh-client', 'save-buffer'])
+ expect(sends('tmux.Running.StreamTo')).toEqual(expect.arrayContaining(sends('tmux.Pane.OpenObservation')))
+ expect(use('go', 'tmux.Running.StreamTo', 'list-windows')).toMatchObject({ scope: 'session', via: { symbol: 'tmux.Pane.OpenObservation' } })
+ // julia's get_hook reads hooks with show-options -H on either receiver, as set_hook and unset_hook check them first; it is what it is for.
+ expect(use('julia', 'LibTmux.get_hook', 'show-options')).toMatchObject({ reviewed: true })
+ expect(use('julia', 'LibTmux.get_hook', 'show-options')?.incidental).toBeUndefined()
+ expect(use('julia', 'LibTmux.get_hook', 'show-options')?.when).toBeUndefined()
+ expect(use('julia', 'LibTmux.set_hook', 'show-options')).toMatchObject({ incidental: true, when: 'on a Server' })
})
it('records the command-alias inventory of a guarded Ruby call as list-commands and show-options, on the same symbols', () => {
From c1c87e91dbc8c24bbfa1d08b4f2fc6cd9a7ecadb Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Tue, 20 Oct 2026 08:06:41 -0500
Subject: [PATCH 23/53] fix(site[tmux-usage]) Record go's name lookups: an
exclusion had been removing the claim for them
why: Writing a test for the forwarding in the last commit found that go `Server.NewSession`'s
list-sessions, the name lookup that 5c4a7cc2b says it recorded as a claim, is in no
entry of go.json. exclusions.json carries an exclusion of the same send ("lists sessions
to look up a name only when the request carries one"), exclusions are applied after claims,
and the exclusion removed the claim's entry. The claim was verified against the source on
every generation and never shown, and nothing said so. `NewSessionConnection` has the same
lookup (connection.go:176) and the same exclusion.
what:
- The exclusions of `NewSession` and `NewSessionConnection` for list-sessions are gone, and
`NewSessionConnection` has a claim like `NewSession`'s: list-sessions "a name is given",
incidental, citing the dispatch at session_lifecycle.go:155, the condition and the call.
The method pages show it, and the command's pages do not list the methods for it.
- Neither claim is forwardable: it holds only when a name is given, so a wrapper that passes
its own request does not inherit it (tested).
- An exclusion that removes the entry of a reviewed claim is now an error, naming the
exclusion and the claim. Regenerating every port with it found no other (the ruby
`switch_client` one went in 1d9cebd44 for the same reason). The negative script puts the
`NewSession` exclusion back and requires the generator to refuse it, with the committed
go rules passing as the control.
- README: the claim-or-exclusion rule is stated so that this cannot be read both ways. A read
the method makes of the server for its own argument is a claim with `when`, marked
incidental; an exclusion is for a probe that asks the running tmux whether it knows a
flag the caller set (`capture` asking `list-commands`) and for a branch the caller's argument
never takes; and the two for one send contradict each other.
Entries 1854 to 1856 (go 229 to 231); conditions 123 to 125 (go 23 to 25).
---
scripts/README.md | 15 ++++++---
scripts/gen-tmux-usage.negative.mjs | 4 +++
scripts/lib/tmux-usage-derive.mjs | 6 +++-
scripts/tmux-usage/claims.json | 29 ++++++++++++++++
scripts/tmux-usage/exclusions.json | 50 ----------------------------
site/src/data/tmux-usage/go.json | 24 +++++++++++++
site/test/tmux-library-usage.test.ts | 4 +++
7 files changed, 77 insertions(+), 55 deletions(-)
diff --git a/scripts/README.md b/scripts/README.md
index 25abe015e..606121d18 100644
--- a/scripts/README.md
+++ b/scripts/README.md
@@ -296,8 +296,8 @@ negative script seeds a rule that is wrong:
evidence; a wrapper that only builds a request sends nothing and is named in
the page's "No method in" line.
- `exclusions.json`: the symbols whose scanned send is not what a default call
- does: a probe that runs only when an optional argument, a name or a tmux
- release asks for it (`capture` asking `list-commands` whether a flag exists),
+ does: a probe that runs only when a flag or a tmux release asks for it
+ (`capture` asking `list-commands` whether a flag exists),
a branch that the caller's argument never takes (`exitCopyMode` reaching the
`copy-mode` branch of a helper that `enterCopyMode` shares), or a request
option that a wrapper never sets. Each cites the lines that show the guard,
@@ -388,8 +388,15 @@ same port.
An entry records what the default call sends, on every tmux release the port
supports at its revision. What an argument changes (`new_session` killing an
existing session of the same name, `breakPane` sending `if-shell` when no
-`named:` is given) belongs to a claim that says the condition in `when`, and an
-auxiliary probe that only an argument asks for belongs to an exclusion. The scan
+`named:` is given) belongs to a claim that says the condition in `when`, and so
+does a read the method makes of the server for its own argument, marked
+`incidental` (go's `NewSession` and `NewSessionConnection` listing sessions to
+find the name they were given). An exclusion is for a probe that asks the
+running tmux whether it knows a flag the caller set (`capture` asking
+`list-commands`), and for a branch the caller's argument never takes. An
+exclusion and a claim for the same symbol, command and scope contradict each
+other: the exclusion removes the claim's entry, which is how a claim recorded
+once and never shown was found. The scan
does not tell a send guarded by a parameter from an unguarded one, so these were
found by listing every entry whose cited lines sit under an `if`, a `case` or a
loop and reading each; a guard written as an early `return` or `next unless`
diff --git a/scripts/gen-tmux-usage.negative.mjs b/scripts/gen-tmux-usage.negative.mjs
index 02eb3da0b..d493d3f2b 100644
--- a/scripts/gen-tmux-usage.negative.mjs
+++ b/scripts/gen-tmux-usage.negative.mjs
@@ -263,6 +263,10 @@ const BAD_RULES = [
}, /rs: plan.Plan.run set-option null: is marked conditional, so it must say when/],
['a condition that qualifies no entry', 'fsharp', 'conditions.json', (document) => { document.conditions.find((item) => item.port === 'fsharp').command = 'no-such-command' },
/fsharp: LibTmux.FSharp.Server.newSession no-such-command session: condition qualifies no entry/],
+ ['an exclusion that removes the entry of a claim for the same send', 'go', 'exclusions.json', (document) => {
+ document.exclusions.push({ port: 'go', owner: 'Server', names: ['NewSession'], commands: ['list-sessions'], why: 'NewSession lists sessions to look up a name only when the request carries one.',
+ evidence: [{ at: 'tmux/session_lifecycle.go:208', has: ['request.Name != ""'] }, { at: 'tmux/session_lifecycle.go:215', has: ['sessionNamed('] }] })
+ }, /go: exclusion of Server\.NewSession for list-sessions: removes the reviewed claim of tmux\.Server\.NewSession list-sessions null, which says it sends it/],
['a conditional guard that does not say when', 'go', 'guards.json', (document) => { delete document.guards.find((guard) => guard.port === 'go' && guard.name === 'guardCommand').when },
/go: guard guardCommand: is conditional, so it must say when/],
['a guard whose function builds no if-shell', 'java', 'guards.json', (document) => {
diff --git a/scripts/lib/tmux-usage-derive.mjs b/scripts/lib/tmux-usage-derive.mjs
index a74e15a1d..b9bd9bdd2 100644
--- a/scripts/lib/tmux-usage-derive.mjs
+++ b/scripts/lib/tmux-usage-derive.mjs
@@ -502,7 +502,11 @@ export function applyExclusions({ exclusions, found, symbols, readSource }) {
&& (!exclusion.in || symbol.file.startsWith(exclusion.in))).map((symbol) => symbol.id))
let count = 0
for (const [key, entry] of found) {
- if (matched.has(entry.symbol) && (!exclusion.commands || exclusion.commands.includes(entry.command))) { found.delete(key); removed.push(entry); count++ }
+ if (matched.has(entry.symbol) && (!exclusion.commands || exclusion.commands.includes(entry.command))) {
+ // A claim says the send is made and an exclusion says it is not: the exclusion would win and the claim would never show.
+ if (entry.reviewed) problems.push(`${label}: removes the reviewed claim of ${entry.symbol} ${entry.command} ${entry.scope}, which says it sends it`)
+ found.delete(key); removed.push(entry); count++
+ }
}
if (!count) problems.push(`${label}: removes no entry, so it is stale`)
}
diff --git a/scripts/tmux-usage/claims.json b/scripts/tmux-usage/claims.json
index 8209aabca..4caca585b 100644
--- a/scripts/tmux-usage/claims.json
+++ b/scripts/tmux-usage/claims.json
@@ -12619,6 +12619,35 @@
],
"incidental": true
},
+ {
+ "port": "go",
+ "symbol": "tmux.Server.NewSessionConnection",
+ "command": "list-sessions",
+ "scope": null,
+ "when": "a name is given",
+ "evidence": [
+ {
+ "at": "tmux/session_lifecycle.go:155",
+ "has": [
+ "s.literalCmd(ctx, \"list-sessions\""
+ ]
+ },
+ {
+ "at": "tmux/connection.go:176",
+ "has": [
+ "if request.Name != \"\""
+ ]
+ },
+ {
+ "at": "tmux/connection.go:177",
+ "has": [
+ "effective.sessionNamed(ctx, request.Name)"
+ ],
+ "in": "tmux.Server.NewSessionConnection"
+ }
+ ],
+ "incidental": true
+ },
{
"port": "swift",
"symbol": "Server.capture(_:includingHistory:maximumLines:)",
diff --git a/scripts/tmux-usage/exclusions.json b/scripts/tmux-usage/exclusions.json
index 1d86aed8a..e22ca4d76 100644
--- a/scripts/tmux-usage/exclusions.json
+++ b/scripts/tmux-usage/exclusions.json
@@ -195,56 +195,6 @@
}
]
},
- {
- "port": "go",
- "owner": "Server",
- "names": [
- "NewSession"
- ],
- "commands": [
- "list-sessions"
- ],
- "why": "NewSession lists sessions to look up a name only when the request carries one.",
- "evidence": [
- {
- "at": "tmux/session_lifecycle.go:208",
- "has": [
- "request.Name != \"\""
- ]
- },
- {
- "at": "tmux/session_lifecycle.go:215",
- "has": [
- "sessionNamed("
- ]
- }
- ]
- },
- {
- "port": "go",
- "owner": "Server",
- "names": [
- "NewSessionConnection"
- ],
- "commands": [
- "list-sessions"
- ],
- "why": "NewSessionConnection lists sessions to look up a name only when the request carries one.",
- "evidence": [
- {
- "at": "tmux/connection.go:176",
- "has": [
- "request.Name != \"\""
- ]
- },
- {
- "at": "tmux/connection.go:177",
- "has": [
- "sessionNamed("
- ]
- }
- ]
- },
{
"port": "go",
"owner": "Server",
diff --git a/site/src/data/tmux-usage/go.json b/site/src/data/tmux-usage/go.json
index 9a534b5a8..e4497cad2 100644
--- a/site/src/data/tmux-usage/go.json
+++ b/site/src/data/tmux-usage/go.json
@@ -1412,6 +1412,18 @@
"scope": null,
"when": "KillExisting is set, session exists"
},
+ {
+ "command": "list-sessions",
+ "evidence": [
+ "tmux/session_lifecycle.go:155",
+ "tmux/session_lifecycle.go:208",
+ "tmux/session_lifecycle.go:215"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null,
+ "when": "a name is given"
+ },
{
"command": "new-session",
"evidence": [
@@ -1426,6 +1438,18 @@
}
],
"tmux.Server.NewSessionConnection": [
+ {
+ "command": "list-sessions",
+ "evidence": [
+ "tmux/session_lifecycle.go:155",
+ "tmux/connection.go:176",
+ "tmux/connection.go:177"
+ ],
+ "incidental": true,
+ "reviewed": true,
+ "scope": null,
+ "when": "a name is given"
+ },
{
"command": "new-session",
"evidence": [
diff --git a/site/test/tmux-library-usage.test.ts b/site/test/tmux-library-usage.test.ts
index bce6268cc..0e6977877 100644
--- a/site/test/tmux-library-usage.test.ts
+++ b/site/test/tmux-library-usage.test.ts
@@ -372,6 +372,10 @@ describe('a release a library refuses to send on', () => {
expect(sends('tmux.Pane.OpenObservation')).toEqual(['capture-pane', 'delete-buffer', 'list-windows', 'refresh-client', 'save-buffer'])
expect(sends('tmux.Running.StreamTo')).toEqual(expect.arrayContaining(sends('tmux.Pane.OpenObservation')))
expect(use('go', 'tmux.Running.StreamTo', 'list-windows')).toMatchObject({ scope: 'session', via: { symbol: 'tmux.Pane.OpenObservation' } })
+ // The control: a claim that only some arguments reach is not forwarded, so a wrapper that passes its own does not inherit it.
+ expect(use('go', 'tmux.Server.NewSession', 'list-sessions')).toMatchObject({ when: 'a name is given', incidental: true, reviewed: true })
+ expect(use('go', 'tmux.Server.NewSessionConnection', 'list-sessions')).toMatchObject({ when: 'a name is given', incidental: true, reviewed: true })
+ expect(Object.entries(TMUX_USAGE.go.symbols).filter(([symbol, entries]) => symbol !== 'tmux.Server.NewSession' && entries.some((entry) => entry.via?.symbol === 'tmux.Server.NewSession' && entry.command === 'list-sessions'))).toEqual([])
// julia's get_hook reads hooks with show-options -H on either receiver, as set_hook and unset_hook check them first; it is what it is for.
expect(use('julia', 'LibTmux.get_hook', 'show-options')).toMatchObject({ reviewed: true })
expect(use('julia', 'LibTmux.get_hook', 'show-options')?.incidental).toBeUndefined()
From 89776ead6e2054de347a9fd377d5d528a99e89f0 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Tue, 20 Oct 2026 08:09:13 -0500
Subject: [PATCH 24/53] fix(site[tmux-reference]) Check the reference trees the
dev build does not serve in the assembly, and bound what the preview check
leaves out
why: df1c19ff8 made the dev-build preview check ask only for destinations the dev build
serves, which leaves out the links into `/py/stable/reference/`. A review of 6c9bfce7b
pointed out that the link policy still marks those links for a card, that nothing then
checks they have one, and offered two ways out: stop marking links into trees the site
does not build, or check them in the assembly. The first rests on the sentence in
df1c19ff8, which is wrong, and I should not have written it: it said the assembly renders
the stable Python reference with Sphinx and skips it where there is no checkout, so no
payload exists for it in either place. Sphinx output is each port's `api/` tree
(`publishesOwnApi`); `build-site.sh` says the reference is "one reference per port and
version, at ///reference/, rendered by that port's own shell build", and
that build writes `reference/.preview.json` beside each page. `publishesOwnTree`
(set on every port, wrappers included) says the port's publisher owns the version
subtree, not that it is made another way. The dev build serves py at `latest` only, which
is why the check could not see it. Links into the stable tree do have cards, so they stay
marked, and the assembly is where to check it.
what:
- `reference-previews.test.ts` reads an assembled tree (the publication audit's, skipped
without one like the other output suites): for every version tree of every port, its
products' and tmux's, each `reference//` the preview policy marks for a card has
a payload at the address the policy computes, which is a card (schema, title, description)
that leads back to that page. The walk is tested on a written tree: pages whose payloads
lead back pass, a page with none, one that is not a card, one that is not JSON and one that
leads elsewhere are each named, and the index and a page two segments down are not read.
I could not run it on an assembly here.
- The dev-build check bounds what it leaves out. `ownTreeElsewhere` says a destination is a
core reference of a port whose publisher owns its tree (`publishesOwnTree`) at a version the
build does not serve, and the check asserts that every destination it did not ask for is of
that kind and that none it asked for is. The kind is the site's own statement, so a link
that the check leaves out for any other reason, such as a port that stops publishing its
tree or a version that is not another version, fails the check.
- Tests: the two rules agree on a set of links (py at `stable` is out and every other
destination is in), a port whose publisher does not own its tree is not one that is left out,
and the version the build serves is not.
- CONTRIBUTING.md says what the check leaves out and where the rest is checked.
Not run in a browser or on an assembly.
---
CONTRIBUTING.md | 14 ++--
site/scripts/check-page-readiness.mjs | 59 ++++++++++++----
site/test/preview-check.test.ts | 23 ++++++-
site/test/reference-previews.test.ts | 96 +++++++++++++++++++++++++++
4 files changed, 173 insertions(+), 19 deletions(-)
create mode 100644 site/test/reference-previews.test.ts
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index b8b15a132..c17c1d498 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -173,10 +173,16 @@ A link the page marks for a preview card must have a card to show. The preview
check hovers the C function link of a method page, then asks for the payload of
every marked link on four pages. It asks only for destinations the dev build
serves: one version of each port's reference, as its build target says, so the
-Python reference that the other ports link to at `stable` is not asked for. A
-payload missing on a port the build does serve is reported, and the check fails
-if it would not report one. Both checks run in the publication audit through the
-full `check-dev.mjs` matrix, on its own source mirror and not on the assembly:
+Python reference that the other ports link to at `stable` is not asked for. What
+it leaves out is bounded: only reference trees whose publisher owns the version
+tree (`publishesOwnTree`), at versions the dev build does not serve. A payload
+missing on a port the build does serve is reported, and the check fails if it
+would not report one. Both checks run in the publication audit through the full
+`check-dev.mjs` matrix, on its own source mirror and not on the assembly. The
+trees it leaves out are the shell's own in the assembly (each port's shell build
+renders `//reference/`), and `reference-previews.test.ts` reads
+every port and tmux tree there and requires a payload beside each page a link is
+marked for:
```console
$ node site/scripts/check-dev.mjs --reference-previews
diff --git a/site/scripts/check-page-readiness.mjs b/site/scripts/check-page-readiness.mjs
index fe4d129c3..74f649e88 100644
--- a/site/scripts/check-page-readiness.mjs
+++ b/site/scripts/check-page-readiness.mjs
@@ -532,28 +532,52 @@ export async function checkBlockLinksUndecorated(browser, base, { sample = false
}
/**
- * Whether the build under test contains the destination of a link, as far as a preview payload is concerned.
- *
- * A port's core reference is a tree of its own, built for one version of the port, and the build under test serves
- * one: `version`, the one its own target names. A link to another version of a port's reference leaves for a tree this
- * build does not contain, such as the Python reference that the other ports' pages link to at its default, `stable`
- * (the assembly renders that one with Sphinx, and skips it where there is no checkout). Everything else is served at
- * whatever version a link names: tmux's pages, a product's pages, the glossary.
+ * The port and version a link's destination is a core reference of, if it is one.
*
- * `ports`, `version` and `segment` (the part of the path that makes a page a core reference) are the site's own:
- * `PORTS`, `buildTarget` and `referenceSegment`, so a change to what is built moves this with it.
+ * A port's core reference is a tree of its own, built for one version of the port. `ports`, `segment` (the part of the path
+ * that makes a page a core reference) and `root` are the site's own: `PORTS`, `referenceSegment` and the mount of the build.
*
* @param {string} pathname the path of the link, root included
- * @param {{ root: string, ports: readonly { slug: string, versionedDocs: boolean }[], version: string, segment: string }} build
+ * @param {{ root: string, ports: readonly { slug: string, versionedDocs: boolean }[], segment: string }} build
*/
-export function servedByBuild(pathname, { root, ports, version, segment }) {
+function coreReference(pathname, { root, ports, segment }) {
const rest = pathname.startsWith(`${root}/`) ? pathname.slice(root.length + 1) : pathname.replace(/^\//, '')
const parts = rest.split('/')
const port = ports.find((entry) => entry.slug === parts[0])
- if (!port) return true
+ if (!port) return undefined
const at = port.versionedDocs ? 2 : 1
- if (parts.slice(at, at + segment.split('/').length).join('/') !== segment) return true
- return !port.versionedDocs || parts[1] === version
+ if (parts.slice(at, at + segment.split('/').length).join('/') !== segment) return undefined
+ return { port, version: port.versionedDocs ? parts[1] : undefined }
+}
+
+/**
+ * Whether the build under test contains the destination of a link, as far as a preview payload is concerned.
+ *
+ * The build under test serves one version of each port's core reference: `version`, the one its own target names. A link
+ * to another version of a port's reference leaves for a tree this build does not contain, such as the Python reference that
+ * the other ports' pages link to at its default, `stable`. That tree exists in the assembly, where the port's own shell build
+ * renders it at `///reference/` with its payloads; `reference-previews.test.ts` checks them there.
+ * Everything else is served at whatever version a link names: tmux's pages, a product's pages, the glossary.
+ *
+ * @param {string} pathname the path of the link, root included
+ * @param {{ root: string, ports: readonly { slug: string, versionedDocs: boolean }[], version: string, segment: string }} build
+ */
+export function servedByBuild(pathname, build) {
+ const target = coreReference(pathname, build)
+ return !target || target.version === undefined || target.version === build.version
+}
+
+/**
+ * Whether a destination is a core reference of a port whose publisher owns its version tree (`publishesOwnTree`), at a
+ * version this build does not serve: the one kind of destination the check leaves out, so that what it leaves out is
+ * bounded by what the site says and not by what the check finds convenient.
+ *
+ * @param {string} pathname the path of the link, root included
+ * @param {{ root: string, ports: readonly { slug: string, versionedDocs: boolean, publishesOwnTree?: boolean }[], version: string, segment: string }} build
+ */
+export function ownTreeElsewhere(pathname, build) {
+ const target = coreReference(pathname, build)
+ return Boolean(target?.port.publishesOwnTree) && target?.version !== undefined && target.version !== build.version
}
/**
@@ -599,6 +623,7 @@ export async function checkTmuxReferencePreviews(browser, base, { served: build
// Every link a page marks for a card, whose destination the build serves, has a payload at the address the card asks for.
const missing = []
const skipped = new Set()
+ const questioned = new Set()
let asked = 0
for (const path of ['/cxx/latest/reference/libtmux-server-panes/', '/tmux/latest/manual/list-panes/', '/tmux/latest/reference/c-function-cmd-list-panes-c-cmd_list_panes_server/', '/tmux/latest/reference/c-struct-window_pane/']) {
await page.goto(`${base}${path}`, { waitUntil: 'load' })
@@ -607,10 +632,16 @@ export async function checkTmuxReferencePreviews(browser, base, { served: build
const gaps = await payloadGaps(page.request, origin, hrefs, served)
asked += hrefs.length - gaps.skipped.length
for (const href of gaps.skipped) skipped.add(href)
+ for (const href of hrefs) if (!gaps.skipped.includes(href)) questioned.add(href)
missing.push(...gaps.missing.map((gap) => `${path}: ${gap}`))
}
assert(asked > 3, `Only ${asked} links were asked for a payload, so the pages were not measured`)
assert.deepEqual(missing, [], `A link marked for a card that has none:\n${missing.join('\n')}`)
+ // What was left out is bounded by what the site says: only reference trees that a port's publisher owns, at versions this build does not serve.
+ if (build) {
+ assert.deepEqual([...skipped].filter((href) => !ownTreeElsewhere(href, build)), [], 'A destination was left out of the payload check that is not another version of a port tree')
+ assert.deepEqual([...questioned].filter((href) => ownTreeElsewhere(href, build)), [], 'A destination in another version of a port tree was asked for a payload')
+ }
// The controls. A payload missing on a destination the build serves is reported, and a destination it does not serve is
// left out and not reported, so the sweep cannot go green by skipping what it should have asked.
if (served) {
diff --git a/site/test/preview-check.test.ts b/site/test/preview-check.test.ts
index bed3aa6b2..1d652085e 100644
--- a/site/test/preview-check.test.ts
+++ b/site/test/preview-check.test.ts
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest'
-import { payloadGaps, servedByBuild } from '../scripts/check-page-readiness.mjs'
+import { ownTreeElsewhere, payloadGaps, servedByBuild } from '../scripts/check-page-readiness.mjs'
import { PORTS, referenceSegment, referenceUrl } from '../src/lib/ports'
import { buildTarget, linkedVersionFor } from '../src/lib/versions'
@@ -54,3 +54,24 @@ describe('asking for payloads', () => {
expect(await payloadGaps(asked, 'http://x', hrefs, undefined)).toEqual({ missing: ['/en/cxx/latest/reference/missing/ answers 404', '/en/py/stable/reference/b/ answers 404'], skipped: [] })
})
})
+
+describe('what the check leaves out', () => {
+ it('is only a core reference of a port whose publisher owns its tree, at a version the build does not serve', () => {
+ const env = environment({ py: 'stable' })
+ const mounted = { ...build(env), root: '/en' }
+ const links = ['/en/py/stable/reference/libtmux-server-panes/', '/en/cxx/latest/reference/libtmux-server-panes/', '/en/py/stable/mcp/reference/x/', '/en/tmux/latest/reference/c-function-x/', '/en/py/latest/reference/a/']
+ // Every link the check leaves out is of that kind, and every one of that kind is left out: the two rules agree on these links.
+ expect(links.filter((href) => !servedByBuild(href, mounted))).toEqual(['/en/py/stable/reference/libtmux-server-panes/'])
+ expect(links.filter((href) => ownTreeElsewhere(href, mounted))).toEqual(['/en/py/stable/reference/libtmux-server-panes/'])
+ expect(PORTS.filter((port) => !port.publishesOwnTree).map((port) => port.slug)).toEqual([])
+ })
+
+ it('does not call a port tree that its publisher does not own, or one of the version the build serves, one that is left out', () => {
+ const env = environment({ py: 'stable' })
+ const ports = PORTS.map((port) => (port.slug === 'py' ? { ...port, publishesOwnTree: false } : port))
+ expect(ownTreeElsewhere('/py/stable/reference/a/', { ...build(env), ports })).toBe(false)
+ expect(ownTreeElsewhere('/py/latest/reference/a/', build(env))).toBe(false)
+ // A destination the check would leave out with no port tree behind it is the difference the check asserts on.
+ expect(servedByBuild('/py/stable/reference/a/', { ...build(env), ports })).toBe(false)
+ })
+})
diff --git a/site/test/reference-previews.test.ts b/site/test/reference-previews.test.ts
new file mode 100644
index 000000000..eb859e6cb
--- /dev/null
+++ b/site/test/reference-previews.test.ts
@@ -0,0 +1,96 @@
+import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { afterEach, describe, expect, it } from 'vitest'
+import { createLinkPreviewPolicy } from '../src/lib/link-preview-paint'
+import { SITE_BUILT, SITE_ROOT } from './site-root'
+
+/**
+ * Every reference page a link can lead to has a preview payload beside it.
+ *
+ * The preview policy marks a link to `//reference//` for a card, and the card asks for `.preview.json`. The
+ * browser check of the dev build serves one version of each port's reference, so it cannot ask for the trees at the other
+ * versions the assembly builds, such as the Python reference that the other ports link to at `stable`. Those trees are the
+ * shell's own: each port's shell build renders `///reference/` (the native Sphinx output of a port is `api/`),
+ * and `publishesOwnTree` says the port's publisher owns the subtree, not that it is made another way. This reads the assembly.
+ */
+const ORIGIN = 'https://libtmux.org'
+const policy = createLinkPreviewPolicy()
+
+/** The directories of a tree under `root` that hold reference pages: a port's version trees, its products', and tmux's. */
+function referenceRoots(root: string): string[] {
+ const directories = (path: string) => (existsSync(path) ? readdirSync(path, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name) : [])
+ return directories(root).flatMap((tree) => directories(join(root, tree)).flatMap((version) => ['reference', 'mcp/reference', 'workspace/reference']
+ .map((section) => `${tree}/${version}/${section}`))).filter((path) => existsSync(join(root, path)))
+}
+
+/** The reference pages the policy marks for a card, and what is wrong with each one's payload. */
+export function referencePayloadProblems(root: string) {
+ const pages: string[] = []
+ const problems: string[] = []
+ for (const base of referenceRoots(root)) {
+ for (const entry of readdirSync(join(root, base), { withFileTypes: true })) {
+ const url = `/${base}/${entry.name}/`
+ if (!entry.isDirectory() || !existsSync(join(root, base, entry.name, 'index.html'))) continue
+ const target = policy.target(url, ORIGIN)
+ if (!target || !/\/reference\/[^/]+\/$/.test(url)) continue
+ pages.push(url)
+ const file = join(root, target.endpoint)
+ if (!existsSync(file)) { problems.push(`${url} has no payload at ${target.endpoint}`); continue }
+ let card: { schema?: unknown; title?: unknown; description?: unknown; href?: unknown }
+ try { card = JSON.parse(readFileSync(file, 'utf8')) } catch { problems.push(`${target.endpoint} is not JSON`); continue }
+ if (card.schema !== 1 || typeof card.title !== 'string' || typeof card.description !== 'string') problems.push(`${target.endpoint} is not a card`)
+ else if (typeof card.href !== 'string' || !new URL(card.href, ORIGIN).pathname.endsWith(url)) problems.push(`${target.endpoint} leads to ${String(card.href)}, not to ${url}`)
+ }
+ }
+ return { pages, problems }
+}
+
+/** A bare shell build has no port trees to read; an assembly has them, and then there must be pages in them. */
+const assembledTrees = SITE_BUILT && referenceRoots(SITE_ROOT).length > 0
+
+describe('the reference trees of the assembly', () => {
+ it.runIf(assembledTrees)('has a payload beside every reference page the preview policy marks, in every port version and in tmux', () => {
+ const { pages, problems } = referencePayloadProblems(SITE_ROOT)
+ expect(pages.length).toBeGreaterThan(0)
+ expect(problems).toEqual([])
+ })
+})
+
+describe('the walk over a tree', () => {
+ const made: string[] = []
+ afterEach(() => { for (const path of made.splice(0)) rmSync(path, { recursive: true, force: true }) })
+ const tree = (files: Record) => {
+ const root = mkdtempSync(join(tmpdir(), 'reference-previews-'))
+ made.push(root)
+ for (const [path, body] of Object.entries(files)) {
+ mkdirSync(join(root, path, '..'), { recursive: true })
+ writeFileSync(join(root, path), body)
+ }
+ return root
+ }
+ const card = (href: string) => JSON.stringify({ schema: 1, title: 'x', description: '', href })
+
+ it('passes a tree whose pages each have a payload that leads back to them, and names the page that has none', () => {
+ const root = tree({
+ 'py/stable/reference/a/index.html': '', 'py/stable/reference/a.preview.json': card('/en/py/stable/reference/a/'),
+ 'ruby/latest/mcp/reference/b/index.html': '', 'ruby/latest/mcp/reference/b.preview.json': card('/en/ruby/latest/mcp/reference/b/'),
+ // Not pages a link is marked for: the index of the tree, and a page two segments down.
+ 'py/stable/reference/index.html': '', 'py/stable/reference/symbols/a/index.html': '',
+ })
+ expect(referencePayloadProblems(root)).toEqual({ pages: ['/py/stable/reference/a/', '/ruby/latest/mcp/reference/b/'], problems: [] })
+ const missing = tree({ 'py/stable/reference/a/index.html': '', 'py/stable/reference/b/index.html': '', 'py/stable/reference/a.preview.json': card('/en/py/stable/reference/a/') })
+ expect(referencePayloadProblems(missing).problems).toEqual(['/py/stable/reference/b/ has no payload at /py/stable/reference/b.preview.json'])
+ })
+
+ it('names a payload that is not a card or leads to another page', () => {
+ const root = tree({
+ 'go/latest/reference/a/index.html': '', 'go/latest/reference/a.preview.json': JSON.stringify({ schema: 2, title: 'x', description: '' }),
+ 'go/latest/reference/b/index.html': '', 'go/latest/reference/b.preview.json': card('/en/go/latest/reference/c/'),
+ 'go/latest/reference/c/index.html': '', 'go/latest/reference/c.preview.json': '{',
+ })
+ expect(referencePayloadProblems(root).problems).toEqual([
+ '/go/latest/reference/a.preview.json is not a card', '/go/latest/reference/b.preview.json leads to /en/go/latest/reference/c/, not to /go/latest/reference/b/', '/go/latest/reference/c.preview.json is not JSON',
+ ])
+ })
+})
From 8785a973a14a9f8c7f58baaa0f1c183b46f6be8d Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Tue, 20 Oct 2026 08:11:26 -0500
Subject: [PATCH 25/53] fix(site[tmux-usage]) Record PowerShell's senders at
its model revision
why: The PowerShell API model on main moved to libtmux-powershell
48d77050, which adds README links to 00a482f6, so the usage data no
longer matched the model it describes and its check refused it.
what:
- Regenerate the PowerShell usage data at 48d77050; only the revision
changes, since no source file the scan reads differs
---
site/src/data/tmux-usage/powershell.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/site/src/data/tmux-usage/powershell.json b/site/src/data/tmux-usage/powershell.json
index bb3571623..6b303cf29 100644
--- a/site/src/data/tmux-usage/powershell.json
+++ b/site/src/data/tmux-usage/powershell.json
@@ -94,7 +94,7 @@
],
"port": "powershell",
"repo": "libtmux/libtmux-powershell",
- "revision": "00a482f6be0f3b24a0c2bf52018efe401aef8c13",
+ "revision": "48d770503a01e36426839b94951109dea6ce4562",
"schemaVersion": 1,
"symbols": {
"LibTmux\\Connect-TmuxControl": [
From d2830f784f860d87b70f5c260bd01ec4e9dac0f0 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Sat, 24 Oct 2026 05:34:03 -0500
Subject: [PATCH 26/53] refactor(site[api-reference]) Build related types in
one place
why: The Related types cards and the Related APIs chips share one list,
but the list was assembled inline in ApiReference's frontmatter and the
cards were inline in its markup. Nothing outside a full page render
could ask what a page's related list says, so no test could check the
labels of every page, and no template could be rendered on its own.
what:
- Add relatedTypeLinks in api-sections.ts. It resolves the declaring
type from the model and returns each entry's label, qualified name,
kind, link and symbol, with the label the page already used: the name,
plus the module of a top-level type whose name repeats
- Move the Related types section into ApiRelatedTypes.astro with the
same markup
- ApiReference calls the function and the component
No label changes: the lists of all 14,794 pages across the 16 ports'
committed models are identical before and after.
---
site/src/components/api/ApiReference.astro | 21 +++-----------
site/src/components/api/ApiRelatedTypes.astro | 24 +++++++++++++++
site/src/lib/api-sections.ts | 29 +++++++++++++++++--
3 files changed, 55 insertions(+), 19 deletions(-)
create mode 100644 site/src/components/api/ApiRelatedTypes.astro
diff --git a/site/src/components/api/ApiReference.astro b/site/src/components/api/ApiReference.astro
index 7ed2c1548..1f905706f 100644
--- a/site/src/components/api/ApiReference.astro
+++ b/site/src/components/api/ApiReference.astro
@@ -12,7 +12,8 @@ import { apiGlossary, apiGlossaryHeadings, API_GLOSSARY_TITLE, apiGlossaryHref }
import ApiQualifiedName from '../../components/api/ApiQualifiedName.astro'
import ApiType from '../../components/api/ApiType.astro'
import ApiPageContents from '../../components/api/ApiPageContents.astro'
-import { apiEntryFields, apiEntrySections, apiMemberGroups, hasScalarMembers, relatedApiTypes, type ApiSection } from '../../lib/api-sections'
+import ApiRelatedTypes from './ApiRelatedTypes.astro'
+import { apiEntryFields, apiEntrySections, apiMemberGroups, hasScalarMembers, relatedTypeLinks, type ApiSection } from '../../lib/api-sections'
import PageToolbar from '../../components/PageToolbar.astro'
import PagePortSwitcher from '../../components/PagePortSwitcher.astro'
import DocumentationContext from '../../components/docs/DocumentationContext.astro'
@@ -362,10 +363,7 @@ const paths = (source?.paths ?? []).filter((path) => !owner || path.symbols.some
if (relationshipSections.some((section) => ['api-calls', 'api-called-by'].includes(section.id))) pageSections.push({ id: 'api-call-network', label: 'Call neighborhood' })
if (paths.length) pageSections.push({ id: 'api-source-paths', label: 'Paths through the source', count: paths.length })
pageSections.push(...relationshipSections.map((section) => ({ id: section.id, label: section.label, count: section.items.length })))
-const related = owner ? relatedApiTypes(owner, members, index, declaringType, { includeInternal: Boolean(source) }).map((symbol) => ({
- name: ownerNames.get(symbol.name)! > 1 ? `${symbol.name} (${moduleOf(symbol)})` : symbol.name,
- identity: qualifiedNameOf(symbol), kind: symbol.kind, href: hrefFor(symbol), symbol,
-})) : []
+const related = owner && model ? relatedTypeLinks(model, owner, members, index, hrefFor, { repeated: ownerNames, includeInternal: Boolean(source) }) : []
if (related.length) pageSections.push({ id: 'api-related-types', label: 'Related types', count: related.length })
const title = glossary ? API_GLOSSARY_TITLE : owner
? qualifiedNameOf(owner)
@@ -827,18 +825,7 @@ const bases = owner && 'extends' in owner ? owner.extends ?? [] : []
>
)}
- {related.length > 0 &&
-
+}
diff --git a/site/src/lib/api-sections.ts b/site/src/lib/api-sections.ts
index be398402c..e79e1a2a2 100644
--- a/site/src/lib/api-sections.ts
+++ b/site/src/lib/api-sections.ts
@@ -1,5 +1,5 @@
import { createHash } from 'node:crypto'
-import { builtinHref, memberTier, typeParametersOf, type ApiSymbol, type MemberSignals, type Param, type Signature, type SymbolIndex } from '@libtmux/api-model'
+import { builtinHref, memberTier, moduleOf, qualifiedNameOf, typeParametersOf, type ApiModelBase, type ApiSymbol, type MemberSignals, type Param, type Signature, type SymbolIndex } from '@libtmux/api-model'
import { apiGlossaryHref } from './api-glossary'
import { csharpParameters, supportsCSharpSignatures, supportsElixirSignatures, supportsGoSignatures, supportsJavaSignatures, supportsLuaSignatures, supportsRubySignatures, supportsRustSignatures, supportsTypeScriptSignatures, swiftBaseName } from './code-layout'
@@ -300,12 +300,15 @@ export function apiMemberGroups(members: ApiSymbol[], signals: MemberSignals) {
return groups.filter((group) => group.members.length > 0)
}
+/** The declarations a related-types list can hold. */
+const RELATED_KINDS: ReadonlySet = new Set(['class', 'struct', 'union', 'interface', 'trait', 'enum', 'typealias'])
+
/** Related declarations come from ownership, inheritance and return types. */
export function relatedApiTypes(owner: ApiSymbol, members: ApiSymbol[], index: SymbolIndex, parent?: ApiSymbol, options: { includeInternal?: boolean } = {}) {
const types = new Map()
const add = (symbol?: ApiSymbol) => {
if (!symbol || symbol.id === owner.id || (!options.includeInternal && symbol.apiScope === 'internal') ||
- !['class', 'struct', 'union', 'interface', 'trait', 'enum', 'typealias'].includes(symbol.kind)) return
+ !RELATED_KINDS.has(symbol.kind)) return
types.set(symbol.publicId ?? symbol.id, symbol)
}
add(parent)
@@ -325,6 +328,28 @@ export function relatedApiTypes(owner: ApiSymbol, members: ApiSymbol[], index: S
return [...types.values()].slice(0, 6)
}
+export interface RelatedTypeLink {
+ /** The label the page shows. */
+ name: string
+ /** The source-qualified name, for the link's title. */
+ identity: string
+ kind: ApiSymbol['kind']
+ href: string
+ symbol: ApiSymbol
+}
+
+/** The related types of a page with the label it shows for each; `repeated` counts the top-level types that share a name. */
+export function relatedTypeLinks(
+ model: ApiModelBase, owner: ApiSymbol, members: ApiSymbol[], index: SymbolIndex, hrefFor: (symbol: ApiSymbol) => string,
+ options: { repeated: ReadonlyMap; includeInternal?: boolean },
+): RelatedTypeLink[] {
+ const parent = owner.parent ? model.symbols.find((symbol) => symbol.id === owner.parent) : undefined
+ return relatedApiTypes(owner, members, index, parent, { includeInternal: options.includeInternal }).map((symbol) => ({
+ name: (options.repeated.get(symbol.name) ?? 0) > 1 ? `${symbol.name} (${moduleOf(symbol)})` : symbol.name,
+ identity: qualifiedNameOf(symbol), kind: symbol.kind, href: hrefFor(symbol), symbol,
+ }))
+}
+
/** Describe unnamed native types without inventing a compilable declaration. */
export function anonymousDeclarationLabel(symbol: ApiSymbol): string {
return symbol.type ? `${symbol.name}: ${symbol.type}` : `Anonymous ${symbol.kind}`
From 0dd6de44892ecbb0a33ad379ceb96a408f8bc55e Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Sat, 24 Oct 2026 05:59:29 -0500
Subject: [PATCH 27/53] fix(site[api-labels]) Name the owner of ambiguous
related types
why: The Elixir Server reference listed its Related types as `t/0`,
`t/0`, `result/0` and `t/0`: the types of Snapshot, Error,
Transport.OneShot and Server, which a reader could not tell apart.
Elixir writes a type as `name/arity` and calls every module's main type
`t`, so the name means nothing until its module is attached; ExDoc
spells them `LibTmux.Snapshot.t/0`. The list used the bare symbol name
and qualified only a top-level type whose name repeats, which never
reaches a member type. Ruby had the same fault on a smaller scale:
LibTmux::Async::Server and LibTmux::Server both read `Server`.
what:
- relatedLabels in api-labels.ts labels the entries of one page's list.
A bare name stands when the page's subject, or the declaration that
holds it, owns the entry, so Server's own page keeps `t/0` where
ExDoc lists a module's own types unqualified. An entry that another
declaration owns takes `Owner.name`: always for Elixir, through the
OWNER_BOUND_TYPES language hook, and in other languages only when more
than one type in the port carries the name. Entries that still read
alike then take their owner, and last their full qualified name
- Spell the owner with the separator the language's qualified name
uses: `Snapshot.t/0`, the form the page heading and breadcrumb of an
Elixir type already use, and `Async::Server` in Ruby. The full name
stays in the link title and aria label
- relatedTypeLinks passes the language and the repeated names, and marks
a label that carries its owner. ApiRelatedTypes and the Related APIs
chips render such a label through SymbolName, so it breaks at the
owner's separator and reads the same without the break
- Test the rule on the reported Server page, a same-owner control, a
cross-port control and collisions. On every page of the 16 ports,
require that no related list repeats a label and that a label outside
Elixir changes only for a shared name or a collision. Render the real
cards and chips of every list longer than one entry and compare
labels, titles, links, marks and break points. Check the tmux C
source reference is untouched
Measured on the committed models, over 14,794 pages: before, 21 Elixir
pages (51 entries) and 2 Ruby pages (4 entries) listed a label twice;
after, none do. Labels change on 56 Elixir pages (84 entries) and 6 Ruby
pages (8 entries). The lists of the other 14 ports are identical, as are
those of the tmux C source reference. Java's nested Builder, carried by
seven types, is always owned by its own page, so it stays bare.
Verified: reverting the rule fails 12 of the 18 new tests, including
both no-duplicate checks; turning the Elixir hook off, dropping the
collision pass, qualifying an entry at home, qualifying every owned
entry and rendering a card without break points each fail the tests that
name them. On a dev server, the Elixir Server page reads `Snapshot.t/0`,
`Error.t/0`, `OneShot.result/0` and `t/0` at desktop and phone widths,
the Ruby Async::Server.open page reads `Async::Server` and
`LibTmux::Server`, and the Scala Server chips are unchanged;
check-dev.mjs --badge-centring passes its Related APIs chip-growth check
and negative controls.
---
site/src/components/api/ApiPageContents.astro | 5 +-
site/src/components/api/ApiReference.astro | 2 +-
site/src/components/api/ApiRelatedTypes.astro | 3 +-
site/src/lib/api-labels.ts | 54 ++++
site/src/lib/api-sections.ts | 38 ++-
site/test/related-labels.test.ts | 253 ++++++++++++++++++
6 files changed, 345 insertions(+), 10 deletions(-)
create mode 100644 site/test/related-labels.test.ts
diff --git a/site/src/components/api/ApiPageContents.astro b/site/src/components/api/ApiPageContents.astro
index 7d1508b8f..4d09d4884 100644
--- a/site/src/components/api/ApiPageContents.astro
+++ b/site/src/components/api/ApiPageContents.astro
@@ -1,10 +1,11 @@
---
import type { ApiSection } from '../../lib/api-sections'
import ApiBadge from './ApiBadge.astro'
+import SymbolName from './SymbolName.astro'
interface Props {
sections: ApiSection[]
- related: { name: string; identity: string; kind: string; href: string }[]
+ related: { name: string; qualified?: boolean; identity: string; kind: string; href: string }[]
}
const { sections, related } = Astro.props as Props
---
@@ -22,7 +23,7 @@ const { sections, related } = Astro.props as Props
`,
+}
+const body = Object.entries(CHIPS).map(([name, wrap]) => chip(name, wrap)).join('')
+
+const CHIP_PROPERTIES = ['background-color', 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color', 'box-shadow', 'outline-style', 'outline-width', 'outline-color', 'outline-offset', 'color']
+const MARK_PROPERTIES = ['background-color', 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color', 'box-shadow', 'color']
+
+type Painted = Record>
+
+/** The computed style of each chip and its mark at rest, hovered and focused by keyboard, in one load of `sheets`. */
+async function painted(page: Page, marks: string): Promise {
+ await page.emulateMedia({ colorScheme: 'light', reducedMotion: 'reduce' })
+ await page.setContent(`${css(marks).map((sheet) => ``).join('')}${body}`)
+ const read = (id: string) => page.evaluate(({ id, chipProperties, markProperties }) => {
+ const link = document.getElementById(id)!
+ const style = (node: Element, names: string[]) => Object.fromEntries(names.map((name) => [name, getComputedStyle(node).getPropertyValue(name)]))
+ return { ...Object.fromEntries(Object.entries(style(link, chipProperties)).map(([name, value]) => [`chip ${name}`, value])), ...Object.fromEntries(Object.entries(style(link.querySelector('.api-nav__kind')!, markProperties)).map(([name, value]) => [`mark ${name}`, value])) }
+ }, { id, chipProperties: CHIP_PROPERTIES, markProperties: MARK_PROPERTIES })
+ const result: Painted = {}
+ for (const id of Object.keys(CHIPS)) {
+ await page.mouse.move(0, 0)
+ await page.evaluate(() => (document.activeElement as HTMLElement | null)?.blur())
+ result[`${id} at rest`] = await read(id)
+ await page.hover(`#${id}`)
+ result[`${id} hovered`] = await read(id)
+ await page.mouse.move(0, 0)
+ // Tab to the chip, so the focus is the keyboard's and :focus-visible matches.
+ for (let tries = 0; tries < 8 && (await page.evaluate(() => document.activeElement?.id)) !== id; tries++) await page.keyboard.press('Tab')
+ expect(await page.evaluate((id) => document.getElementById(id)!.matches(':focus-visible'), id), `${id} is focused by keyboard`).toBe(true)
+ result[`${id} focused`] = await read(id)
+ }
+ return result
+}
+
+/** The properties that differ between two loads, by state. */
+const differences = (left: Painted, right: Painted, ids: string[]): string[] => Object.keys(left).filter((state) => ids.includes(state.split(' ')[0]!)).flatMap((state) =>
+ Object.keys(left[state]!).filter((name) => left[state]![name] !== right[state]![name]).map((name) => `${state}: ${name} ${right[state]![name]} became ${left[state]![name]}`))
+
+let browser: Browser
+let page: Page
+let main: Painted
+beforeAll(async () => {
+ browser = await chromium.launch({ headless: true })
+ page = await browser.newPage()
+ main = await painted(page, MAIN)
+})
+afterAll(async () => { await browser?.close() })
+
+const OTHERS = ['related', 'elsewhere', 'command']
+
+describe('the hover and focus of a chip, against main', () => {
+ it('paints a Related APIs chip, a command\'s related chip and an In other ports chip, at rest, hovered and focused, as main does', async () => {
+ const now = await painted(page, CURRENT)
+ expect(differences(now, main, OTHERS)).toEqual([])
+ })
+
+ it('measures something: the states differ from rest, and the usage table\'s chip hovers and focuses differently from main\'s', async () => {
+ const now = await painted(page, CURRENT)
+ // A hovered related chip darkens its surface, and a keyboard focus is a state the browser paints.
+ expect(now['related hovered']!['chip background-color']).not.toBe(now['related at rest']!['chip background-color'])
+ // The usage table's chip darkens its border and rings the whole chip on focus; main never styled it.
+ expect(now['usage hovered']!['chip border-top-color']).not.toBe(main['usage hovered']!['chip border-top-color'])
+ expect(now['usage hovered']!['chip border-top-color']).not.toBe(now['usage at rest']!['chip border-top-color'])
+ expect(now['usage focused']!['chip outline-style']).toBe('solid')
+ expect(now['usage focused']!['chip outline-width']).toBe('2px')
+ // Its mark keeps the fill and shadow it rests with.
+ expect(now['usage hovered']!['mark background-color']).toBe(now['usage at rest']!['mark background-color'])
+ expect(now['usage hovered']!['mark box-shadow']).toBe(now['usage at rest']!['mark box-shadow'])
+ })
+
+ it('notices the usage rules applied to every chip, which is how they once shipped', async () => {
+ expect(SITEWIDE).not.toBe(CURRENT)
+ const sitewide = await painted(page, SITEWIDE)
+ const moved = differences(sitewide, main, OTHERS)
+ expect(moved.some((line) => /related hovered: chip border-top-color/.test(line)), moved.join('\n')).toBe(true)
+ expect(moved.some((line) => /related focused: chip outline-style/.test(line)), moved.join('\n')).toBe(true)
+ expect(moved.some((line) => /related hovered: mark box-shadow/.test(line)), moved.join('\n')).toBe(true)
+ })
+})
diff --git a/site/test/fixtures/kind-marks.main.css b/site/test/fixtures/kind-marks.main.css
new file mode 100644
index 000000000..49baf2934
--- /dev/null
+++ b/site/test/fixtures/kind-marks.main.css
@@ -0,0 +1,382 @@
+/*
+ * The kind mark and the treatments that adapt it to its context.
+ *
+ * One mark everywhere: a tuned per-mode tint on the six-family palette in
+ * `api-kinds.css`, built em-scaled, sans 600. Three rules choose how loud it is:
+ *
+ * 1. Fill follows crowding. Alone, a tint; a short run or a column, an outline
+ * or a split chip; a long run, chrome, or no colour budget, ink.
+ * 2. The word appears wherever the reader cannot hover: headings (the legend
+ * chip), menus, tables, tooltips.
+ * 3. Solid is a state or a hero, never a default. A pill is status, never kind.
+ *
+ * Centring. A mark's box snaps to an even height with `round()`, and its
+ * baseline snaps to a whole pixel from the box floor, so the ink centres at any
+ * sub-pixel position and zoom. The label is trimmed to the cap height, or the
+ * x-height for a m o r and the colon (`data-mark`), and sits on that floor.
+ * Centring the em box instead leaves capitals about half a pixel high and
+ * x-height letters low, and the baseline and the box edge round apart.
+ */
+
+:root { --mark-step: 1px; }
+@media (min-resolution: 2dppx) { :root { --mark-step: .5px; } }
+@media (min-resolution: 3dppx) { :root { --mark-step: .3333px; } }
+
+/* ---- The mark ---- */
+
+.api-nav__kind {
+ --mk-w: 1.35em; --mk-r: .2em; --mk-bw: 1px; --mk-gh: calc(.8 * 1cap);
+ --mk-bh: round(var(--mk-w), 2px);
+ display: inline-flex;
+ align-items: flex-end;
+ justify-content: center;
+ flex: none;
+ box-sizing: border-box;
+ min-width: var(--mk-bh);
+ height: var(--mk-bh);
+ padding: 0 0 round(calc((var(--mk-bh) - 2 * var(--mk-bwv, var(--mk-bw)) - var(--mk-gh)) / 2), var(--mark-step));
+ border: var(--mk-bw) solid var(--mk-bd, color-mix(in srgb, var(--mk-hue, currentColor) var(--mark-border-alpha), transparent));
+ border-radius: var(--mk-r);
+ background: var(--mk-fill, var(--mk-bg, transparent));
+ color: var(--mk-ink, var(--mk-fg, inherit));
+ box-shadow: var(--mk-shadow, none);
+ font: 600 min(1em, 1.25rem)/1 var(--font-sans, ui-sans-serif, system-ui, sans-serif);
+ white-space: nowrap;
+ vertical-align: middle;
+ align-self: center;
+}
+.api-nav__kind > .api-badge__label {
+ display: block;
+ font-size: .8em;
+ line-height: 1;
+ text-box: trim-both cap alphabetic;
+}
+.api-nav__kind > .api-badge__label[data-mark='x'],
+.api-nav__kind > .api-badge__label[data-mark='col'] { text-box: trim-both ex alphabetic; }
+.api-nav__kind:has(> [data-mark='x']) { --mk-gh: calc(.8 * (1ex + .01em)); }
+.api-nav__kind:has(> [data-mark='col']) { --mk-gh: calc(.8 * 1ex); }
+.api-nav__kind:has(> [data-mark='asc']) { --mk-gh: calc(.8 * (1cap + .04em)); }
+.api-nav__kind:has(> [data-mark='tee']) { --mk-gh: calc(.8 * (1cap - .035em)); }
+
+/* Without text-box, centre the em box and lift the x-height marks. */
+@supports not (text-box: trim-both cap alphabetic) {
+ .api-nav__kind { align-items: center; padding-bottom: 0; }
+ .api-nav__kind > .api-badge__label[data-mark='x'] { translate: 0 -.06em; }
+}
+
+/* ---- Treatments by context ---- */
+
+/* T outline, in a fixed gutter: the navigation tree, its search results, and member and index lists. */
+:is(.api-nav, .api-member-list, .api-index-card__heading, .api-related-cards) .api-nav__kind {
+ --mk-fill: transparent;
+ --mk-bd: color-mix(in srgb, var(--mk-hue, currentColor) 60%, transparent);
+}
+
+/* U ink: secondary navigation, the contents column, and tables. No hue, so chrome stays calm. */
+:is(a.sidebar-link, summary a, .api-page-contents, .api-contents, table) .api-nav__kind {
+ --mk-fill: color-mix(in srgb, var(--color-foreground-primary, currentColor) 7%, transparent);
+ --mk-bd: color-mix(in srgb, var(--color-foreground-primary, currentColor) 14%, transparent);
+ --mk-ink: var(--color-foreground-primary, currentColor);
+}
+
+/* T outline on an opaque base: a callout tints its own surface, so the mark keeps the page colour under its outline. */
+:is(.aside, aside[role='note']) .api-nav__kind {
+ --mk-fill: var(--background-color, Canvas);
+ --mk-bd: color-mix(in srgb, var(--mk-hue, currentColor) 60%, transparent);
+}
+
+/* ---- The active state ---- */
+
+/*
+ * The selected node, the targeted heading and the hovered or focused link:
+ * the one loud mark. Solid in the family hue, or a 2px ring where white on the
+ * solid step is under 4.5:1.
+ */
+.api-nav__leaf[aria-current='page'] > .api-nav__kind,
+.api-nav__row:has(> [aria-current='page']) > .api-nav__kind,
+:is(a, summary):is(:hover, :focus-visible) > .api-nav__kind,
+:is(h1, h2, h3, h4, h5, h6):target .api-nav__kind {
+ background: var(--mk-act-bg, var(--mk-fill, var(--mk-bg)));
+ color: var(--mk-act-fg, var(--mk-fg));
+ border-color: var(--mk-hue, currentColor);
+ box-shadow: var(--mk-act-ring, none);
+}
+
+/* ---- The legend chip: mark and word in one token ---- */
+
+/*
+ * One box with one border and radius. The mark and the word are equal-height
+ * segments inside it, split by a 1px divider with the mark on a darker tint.
+ * They are one line of text: both sit on the same snapped baseline, and the run
+ * is centred as a whole by its cap height, never each segment on its own.
+ * Registered lengths resolve the em units once, on the chip.
+ */
+@property --leg-h { syntax: ''; inherits: true; initial-value: 0px; }
+@property --leg-pb { syntax: ''; inherits: true; initial-value: 0px; }
+
+.api-badge.api-leg {
+ --leg-h: round(1.35em, 2px);
+ --leg-pb: round(calc((var(--leg-h) - 2px - .8 * 1cap) / 2), var(--mark-step));
+ display: inline-flex;
+ align-items: stretch;
+ box-sizing: border-box;
+ height: var(--leg-h);
+ padding: 0;
+ overflow: hidden;
+ vertical-align: middle;
+ border: 1px solid color-mix(in srgb, var(--mk-hue, currentColor) var(--mark-border-alpha), transparent);
+ border-radius: .2em;
+ background: var(--mk-bg, transparent);
+ color: var(--mk-fg, inherit);
+ font: 600 .8125rem/1 var(--font-sans, ui-sans-serif, system-ui, sans-serif);
+ letter-spacing: 0;
+ text-transform: none;
+ text-decoration: none;
+ white-space: nowrap;
+}
+.api-leg__m {
+ display: flex;
+ align-items: flex-end;
+ justify-content: center;
+ min-width: 1.3em;
+ padding: 0 .4em var(--leg-pb);
+ border-inline-end: 1px solid color-mix(in srgb, var(--mk-hue, currentColor) var(--mark-border-alpha), transparent);
+ background: color-mix(in srgb, var(--mk-hue, currentColor) 22%, var(--mk-bg, transparent));
+}
+.api-leg__g { display: block; font-size: .8em; line-height: 1; text-box: trim-both cap alphabetic; }
+.api-leg__w {
+ display: flex;
+ align-items: flex-end;
+ padding: 0 .55em var(--leg-pb) .5em;
+ font-size: .8em;
+ line-height: 1;
+}
+.api-leg__wl { display: block; text-box: trim-both cap alphabetic; }
+@supports not (text-box: trim-both cap alphabetic) {
+ .api-leg__m, .api-leg__w { align-items: center; padding-bottom: 0; }
+}
+
+/* A plain kind word, for a table's kind column and the trailing word of a list row or a result. */
+.api-kind-word {
+ color: var(--color-foreground-muted);
+ font: .75rem/1.3 var(--font-sans, ui-sans-serif, system-ui, sans-serif);
+ text-transform: none;
+ letter-spacing: 0;
+}
+
+/* ---- Navigation: the gutter, and the word that trails a result ---- */
+
+/*
+ * In the API tree, marks sit in one fixed column and the names indent after
+ * them, so a reader scans down the left edge to filter methods from properties.
+ * A tree whose groups name their kind (`data-marks='mixed'`, the MCP sidebar)
+ * has no gutter: a row's mark, where it has one, is inline before its name at
+ * the row's normal gap, and a row without a mark starts at the row's indent.
+ */
+.api-nav:not([data-marks='mixed']) .api-nav__row {
+ padding-inline-start: .5rem;
+}
+.api-nav:not([data-marks='mixed']) .api-nav__row > .api-nav__label {
+ padding-inline-start: calc((var(--level, 1) - 1) * var(--api-nav-indent));
+}
+.api-nav:not([data-marks='mixed']) .api-nav__row:not(:has(> .api-nav__kind)) > .api-nav__label {
+ padding-inline-start: calc(1.35em + .25rem + (var(--level, 1) - 1) * var(--api-nav-indent));
+}
+.api-nav__results strong > .api-kind-word { margin-inline-start: auto; padding-inline-start: .5rem; font-weight: 400; }
+
+/* ---- A mark that leads a bare name ---- */
+
+/*
+ * One rule for every place a compact mark precedes a name that is not in a code
+ * chip: index and tool cards, and the rows of a member list. The mark and the
+ * name are one run, centred as a unit: a gap clear of the name, and the mark's
+ * baseline raised by half the difference between the name's capital height and
+ * the mark's ink, so the two share a centre. A card's link is a row that holds
+ * the mark on the first line's baseline when a long name wraps. (The name's own
+ * code chip, in prose, supplies part of that gap with its padding.)
+ */
+:root { --mark-gap: .5em; }
+:is(.api-index-card:not(.api-related-card) .api-index-card__link, .api-member-list li > span:first-child) > .api-nav__kind:first-child {
+ align-self: baseline;
+ vertical-align: baseline;
+ position: relative;
+ top: calc(-1 * round(calc((1cap - var(--mk-gh)) / 2), var(--mark-step)));
+ margin-inline-end: var(--mark-gap);
+}
+.api-index-card:not(.api-related-card) .api-index-card__link:has(> .api-nav__kind:first-child) {
+ display: flex;
+ align-items: baseline;
+ gap: 0;
+}
+
+/* ---- A split chip: the mark and the name bound into one token ---- */
+
+/*
+ * Contiguous runs ("In other ports", related APIs): the mark is the cap of a
+ * single outlined chip, the name sits on a quiet surface, and the chip replaces
+ * the link underline. The cap and the name are one line of text: both sit on
+ * the name's snapped baseline.
+ */
+@property --sp-h { syntax: ''; inherits: true; initial-value: 0px; }
+@property --sp-pb { syntax: ''; inherits: true; initial-value: 0px; }
+:is(.api-elsewhere-value, .api-command-related, nav.api-related) a:has(> .api-nav__kind) {
+ --sp-h: round(1.6em, 2px);
+ --sp-pb: round(calc((var(--sp-h) - 2px - .875 * 1cap) / 2), var(--mark-step));
+ display: inline-flex;
+ align-items: stretch;
+ gap: 0;
+ box-sizing: border-box;
+ /* One line keeps the snapped height; a name that wraps at its points grows the chip instead of spilling out of it. */
+ min-height: var(--sp-h);
+ max-inline-size: 100%;
+ /* The contents column pads and flags its links; a chip's box is its own. */
+ padding: 0;
+ overflow: hidden;
+ vertical-align: middle;
+ border: 1px solid color-mix(in srgb, var(--color-foreground-primary, currentColor) 16%, transparent);
+ border-radius: .25em;
+ background: color-mix(in srgb, var(--color-foreground-primary, currentColor) 4%, transparent);
+ text-decoration: none;
+}
+:is(.api-elsewhere-value, .api-command-related, nav.api-related) a > .api-nav__kind {
+ --mk-w: 1.6em; --mk-bwv: 0px;
+ --mk-fill: color-mix(in srgb, var(--mk-hue, currentColor) 18%, var(--background-color, transparent));
+ /* The mark is one line tall and stays on the first line, however many lines the name takes. */
+ align-self: flex-start;
+ height: calc(var(--sp-h) - 2px);
+ min-width: 1.6em;
+ padding-bottom: var(--sp-pb);
+ border-width: 0;
+ border-inline-end: 1px solid color-mix(in srgb, var(--mk-hue, currentColor) 30%, transparent);
+ border-radius: 0;
+}
+:is(.api-elsewhere-value, .api-command-related, nav.api-related) a > .api-nav__kind + code {
+ /*
+ * The last line's baseline keeps its gap from the bottom edge. The top margin reserves exactly the space the first
+ * line has in a one-line chip (a hair less, so a single line never grows it), so the first line sits level with
+ * the mark, and each line after it adds one line of height to the chip.
+ */
+ align-self: flex-end;
+ margin: calc(var(--sp-h) - 2px - var(--sp-pb) - 1cap - .1px) 0 var(--sp-pb);
+ padding: 0 .45em;
+ border: 0;
+ background: none;
+ font-size: .875em;
+ /* The text is trimmed to its cap and baseline, so this spaces the lines of a wrapped name and does not move one line. */
+ line-height: 1.3;
+ text-box: trim-both cap alphabetic;
+ text-decoration: none;
+}
+@supports not (text-box: trim-both cap alphabetic) {
+ :is(.api-elsewhere-value, .api-command-related, nav.api-related) a > .api-nav__kind + code { margin: 0 0 var(--sp-pb); line-height: 1; }
+}
+:is(.api-elsewhere-value, .api-command-related, nav.api-related) a:has(> .api-nav__kind):is(:hover, :focus-visible) {
+ background: color-mix(in srgb, var(--color-foreground-primary, currentColor) 9%, transparent);
+}
+/* In the contents column each chip is its own row: as wide as its content, with an even gap between rows. */
+.api-page-contents nav.api-related ul { display: grid; gap: .5rem; justify-items: start; }
+.api-page-contents nav.api-related a:has(> .api-nav__kind) { display: flex; }
+/* In the contents column the cap is ink, like the rest of the chrome. */
+.api-page-contents nav.api-related a > .api-nav__kind {
+ --mk-fill: color-mix(in srgb, var(--color-foreground-primary, currentColor) 7%, transparent);
+ --mk-ink: var(--color-foreground-primary, currentColor);
+ border-inline-end-color: color-mix(in srgb, var(--color-foreground-primary, currentColor) 14%, transparent);
+}
+
+/* ---- Modifier chips: outline-only, on the legend chip's geometry ---- */
+
+/*
+ * Kind is filled and a modifier is an outline, so an entry has one loud thing.
+ * A modifier keeps its gp-sphinx hue (async violet, abstract indigo, classmethod
+ * and static amber, final and readonly green, the rest a readable grey), taken
+ * from the tokens in the vendored stylesheet, which scopes them to `dl.py`; they
+ * apply here wherever a modifier sits. Text is the token's ink, never a muted
+ * grey on a transparent fill. Deprecated is a status and takes the warning ink.
+ * A package names the container of a type, so it takes the types hue.
+ *
+ * The chip is the legend chip's box: the same snapped height, radius and sans
+ * 600 word, trimmed to its cap height on a whole-pixel baseline, so a row of
+ * kind and modifiers reads as one family.
+ */
+/* gp-sphinx's light amber ink is 4.4:1 on the declaration band; five percent darker clears 4.5:1 and keeps the hue. Dark takes the token as it is. */
+:root { --md-amber-fg: color-mix(in srgb, var(--gp-sphinx-badge-mod-classmethod-fg) 95%, #000); }
+[data-theme-mode='dark'] { --md-amber-fg: var(--gp-sphinx-badge-mod-classmethod-fg); }
+.api-badge--mod {
+ --md-fg: var(--gp-sphinx-badge-mod-default-fg);
+ --md-bd: var(--gp-sphinx-badge-mod-default-border);
+}
+.api-badge--mod-async { --md-fg: var(--gp-sphinx-badge-mod-async-fg); --md-bd: var(--gp-sphinx-badge-mod-async-border); }
+.api-badge--mod-abstract { --md-fg: var(--gp-sphinx-badge-mod-abstract-fg); --md-bd: var(--gp-sphinx-badge-mod-abstract-border); }
+.api-badge--mod-classmethod, .api-badge--mod-static { --md-fg: var(--md-amber-fg); --md-bd: var(--gp-sphinx-badge-mod-classmethod-border); }
+.api-badge--mod-final, .api-badge--mod-readonly { --md-fg: var(--gp-sphinx-badge-mod-final-fg); --md-bd: var(--gp-sphinx-badge-mod-final-border); }
+.api-badge--mod-deprecated { --md-fg: var(--api-ink-keyword); --md-bd: var(--api-ink-danger-border); }
+.api-badge--mod-package { --md-fg: var(--mark-types-fg); --md-bd: var(--mark-types-hue); }
+
+/* The doubled class outranks the vendored `dl.py .api-badge--mod`, which would otherwise repaint a deprecated or package chip grey. */
+.api-badge.api-badge--mod.api-badge--mod {
+ --leg-h: round(1.35em, 2px);
+ --leg-pb: round(calc((var(--leg-h) - 2px - .8 * 1cap) / 2), var(--mark-step));
+ display: inline-flex;
+ align-items: flex-end;
+ box-sizing: border-box;
+ height: var(--leg-h);
+ max-inline-size: 100%;
+ padding: 0 .4em var(--leg-pb);
+ overflow: hidden;
+ vertical-align: middle;
+ border: 1px solid var(--md-bd);
+ border-radius: .2em;
+ background: transparent;
+ color: var(--md-fg);
+ font: 600 .8125rem/1 var(--font-sans, ui-sans-serif, system-ui, sans-serif);
+ letter-spacing: 0;
+ text-transform: none;
+ text-decoration: none;
+ white-space: nowrap;
+}
+.api-badge--mod > .api-badge__label { display: block; font-size: .8em; line-height: 1; text-box: trim-both cap alphabetic; }
+@supports not (text-box: trim-both cap alphabetic) {
+ .api-badge.api-badge--mod.api-badge--mod { align-items: center; padding-bottom: 0; }
+}
+
+/* ---- Print, forced colours and increased contrast ---- */
+
+/* Print is ink: tints stripped, a 1px border, the glyph in black. */
+@media print {
+ .api-nav__kind, .api-badge.api-leg, .api-leg__m, .api-badge.api-badge--mod.api-badge--mod {
+ background: transparent !important;
+ color: #000 !important;
+ border-color: #000 !important;
+ box-shadow: none !important;
+ }
+ .api-leg__m { border-inline-end-color: #000 !important; }
+}
+
+/* Forced colours: an outline in system colours, Highlight where active. */
+@media (forced-colors: active) {
+ .api-nav__kind, .api-badge.api-leg, .api-badge.api-badge--mod.api-badge--mod {
+ forced-color-adjust: none;
+ background: Canvas;
+ color: CanvasText;
+ border-color: CanvasText;
+ box-shadow: none;
+ }
+ .api-leg__m { background: Canvas; border-inline-end-color: CanvasText; }
+ .api-nav__leaf[aria-current='page'] > .api-nav__kind,
+ .api-nav__row:has(> [aria-current='page']) > .api-nav__kind,
+ :is(a, summary):is(:hover, :focus-visible) > .api-nav__kind {
+ background: Highlight;
+ color: HighlightText;
+ border-color: Highlight;
+ }
+}
+
+/* More contrast: the border at full strength. */
+@media (prefers-contrast: more) {
+ .api-nav__kind, .api-badge.api-leg, .api-badge.api-badge--mod.api-badge--mod {
+ --mk-bd: currentColor;
+ --md-bd: currentColor;
+ border-color: currentColor;
+ }
+ .api-leg__m { border-inline-end-color: currentColor; }
+}
diff --git a/site/test/tmux-library-usage.test.ts b/site/test/tmux-library-usage.test.ts
index 8b7ea7df3..b98036252 100644
--- a/site/test/tmux-library-usage.test.ts
+++ b/site/test/tmux-library-usage.test.ts
@@ -1029,7 +1029,8 @@ describe('the chip layout of the usage table', () => {
})
const MARKS_CSS = readFileSync(new URL('../src/styles/kind-marks.css', import.meta.url), 'utf8')
-const CHIP_CONTAINERS = ['.api-elsewhere-value', '.api-command-related', '.tmux-usage', 'nav.api-related']
+/** The chips that were there before the usage table, whose hover and focus stay as they were. */
+const OLDER_CHIPS = /\.api-elsewhere-value|\.api-command-related|nav\.api-related/
const squash = (selector: string) => selector.replace(/\s+/g, ' ').trim()
/**
@@ -1041,7 +1042,7 @@ const squash = (selector: string) => selector.replace(/\s+/g, ' ').trim()
function chipStateProblems(css: string): string[] {
const all = parseRules(css)
const problems: string[] = []
- const inChip = (rule: { selector: string }) => CHIP_CONTAINERS.every((container) => rule.selector.includes(container)) && rule.selector.includes('a:has(> .api-nav__kind)')
+ const inChip = (rule: { selector: string }) => rule.selector.includes('.tmux-usage') && !OLDER_CHIPS.test(rule.selector) && rule.selector.includes('a:has(> .api-nav__kind)')
const chipRules = all.filter((rule) => !rule.at && inChip(rule))
const reachesChip = (rule: { selector: string }, state: string) => squash(rule.selector).includes(state)
/** The selector without the `:has(> .api-nav__kind)` that picks out the chip, so `> .api-nav__kind` means its mark. */
@@ -1067,6 +1068,10 @@ function chipStateProblems(css: string): string[] {
const forcedReset = forced.find((rule) => inChip(rule) && reachesChip(rule, ':is(:hover, :focus-visible) > .api-nav__kind'))
if (!forcedReset || forcedReset.body.background !== 'Canvas') problems.push("forced colours light a hovered chip's mark alone")
+ // The chips that were there before it keep their hover and focus: nothing that reaches one of them takes the border, the outline or the reset of the mark.
+ const older = all.filter((rule) => OLDER_CHIPS.test(rule.selector) && /:hover|:focus-visible/.test(rule.selector) && rule.selector.includes('a:has(> .api-nav__kind)'))
+ if (older.some((rule) => 'border-color' in rule.body || 'outline' in rule.body || 'outline-offset' in rule.body || targetsMark(rule))) problems.push('the usage table\'s hover and focus reach the other chips')
+
// The control: the tree still selects a node with the ring.
const selected = ring.find((rule) => squash(rule.selector).includes(".api-nav__leaf[aria-current='page'] > .api-nav__kind"))
if (!selected) problems.push("the tree's selected node lost its ring")
@@ -1093,15 +1098,21 @@ describe('the hover and focus of a split chip', () => {
})
it('catches the mark-only ring, the surface-only hover and a focus that rings the mark', () => {
- const chipReset = /:is\(\.api-elsewhere-value[^{]*a:has\(> \.api-nav__kind\):is\(:hover, :focus-visible\) > \.api-nav__kind \{[^}]*\}\n/
+ const chipReset = /\.tmux-usage a:has\(> \.api-nav__kind\):is\(:hover, :focus-visible\) > \.api-nav__kind \{[^}]*\}\n/
expect(MARKS_CSS).toMatch(chipReset)
expect(chipStateProblems(MARKS_CSS.replace(chipReset, ''))).toEqual(["a hovered chip's mark takes the active ring"])
- expect(chipStateProblems(MARKS_CSS.replace(/(a:has\(> \.api-nav__kind\):is\(:hover, :focus-visible\) \{\n[^}]*?)\n border-color:[^\n]*/, '$1')))
+ expect(chipStateProblems(MARKS_CSS.replace(/(\.tmux-usage a:has\(> \.api-nav__kind\):is\(:hover, :focus-visible\) \{\n[^}]*?)\n border-color:[^\n]*/, '$1')))
.toEqual(['a hovered chip changes its surface but not its border'])
- expect(chipStateProblems(MARKS_CSS.replace(/(a:has\(> \.api-nav__kind\):focus-visible \{\n) outline: [^\n]*\n outline-offset: [^\n]*\n/, '$1 box-shadow: var(--mk-act-ring, none);\n')))
+ expect(chipStateProblems(MARKS_CSS.replace(/(\.tmux-usage a:has\(> \.api-nav__kind\):focus-visible \{\n) outline: [^\n]*\n outline-offset: [^\n]*\n/, '$1 box-shadow: var(--mk-act-ring, none);\n')))
.toEqual(expect.arrayContaining(['focus is not one outline clear of the whole chip', 'focus rings the chip with a shadow', 'a chip rule sets the active ring']))
})
+ it('catches the usage table\'s rules reaching the other chips', () => {
+ const widened = MARKS_CSS.replace('.tmux-usage a:has(> .api-nav__kind):focus-visible {', ':is(.api-elsewhere-value, .api-command-related, .tmux-usage, nav.api-related) a:has(> .api-nav__kind):focus-visible {')
+ expect(widened).not.toBe(MARKS_CSS)
+ expect(chipStateProblems(widened)).toEqual(expect.arrayContaining(["the usage table's hover and focus reach the other chips"]))
+ })
+
it('keeps the ring on the tree, so the fix is not to drop it everywhere', () => {
// A fix that deletes the active ring would pass the chip checks and lose the tree's selected node.
const noRing = MARKS_CSS.replace('box-shadow: var(--mk-act-ring, none);', '')
From 1d444c2514cf5d12735c22d0e9af80a5d94e2969 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Sat, 24 Oct 2026 07:51:39 -0500
Subject: [PATCH 39/53] feat(site[port-picker]) Group Elixir under a BEAM
family
why: Elixir compiles to bytecode for the BEAM, Erlang's virtual machine.
The picker already groups JVM and .NET ports by runtime, but listed
Elixir under "Scripting & web", where it sat beside languages with no
shared runtime. The maintainer decided it belongs in a runtime group of
its own.
what:
- Add a BEAM family holding Elixir and drop Elixir from "Scripting &
web". BEAM follows .NET so the three runtime families stay together,
after the two language families and before the "Other languages"
catch-all, which stays last. JVM and .NET keep their positions.
- Move the family list out of PagePortSwitcher.astro into
lib/port-families.ts so a test can import it. The component calls
portFamilies(), which appends the catch-all for any port no family
names, as before.
- Map the new module in the picker test's component compiler, which
resolves the component's imports by hand.
- Add port-families.test.ts: every registered port is in exactly one
family, each family names only registered ports once, Elixir is in
BEAM and nowhere else, the runtime families keep their order, and an
unlisted port lands in the catch-all once.
- Render the picker and check the drawn headings and ports: Elixir under
BEAM only, every registered port drawn once.
Verified: putting Elixir back under "Scripting & web" without BEAM fails
the Elixir-in-BEAM test, the family-order test and the rendered-picker
test. Listing Elixir under both families fails the exactly-one-family,
the once-each, the Elixir-in-BEAM and the rendered tests, plus five
picker tests that count rows. The Elixir reference page on a dev server
at desktop width draws Scripting & web, Compiled & native, JVM, .NET and
BEAM, with Elixir checked under BEAM. Site tests with
LIBTMUX_DOCS_TEST_SOURCE_ONLY=1, pnpm run lint and astro check pass.
No label is translated: the picker's group headings are English-only
strings, so there is no Japanese label to add.
---
site/src/components/PagePortSwitcher.astro | 10 +---
site/src/lib/port-families.ts | 30 ++++++++++++
.../documentation-picker-interaction.test.ts | 14 ++++++
site/test/port-families.test.ts | 46 +++++++++++++++++++
4 files changed, 92 insertions(+), 8 deletions(-)
create mode 100644 site/src/lib/port-families.ts
create mode 100644 site/test/port-families.test.ts
diff --git a/site/src/components/PagePortSwitcher.astro b/site/src/components/PagePortSwitcher.astro
index c67e6c9f1..8a1bdc597 100644
--- a/site/src/components/PagePortSwitcher.astro
+++ b/site/src/components/PagePortSwitcher.astro
@@ -1,6 +1,7 @@
---
import type { PagePortLink } from '../lib/page-port-links'
import { PORT_BY_SLUG } from '../lib/ports'
+import { portFamilies } from '../lib/port-families'
import { branding } from '../lib/branding'
import { withRoot, withPortRoot } from '../lib/site-root'
import TmuxLogo from './tmux/Logo.astro'
@@ -20,14 +21,7 @@ const { entries, portSlug, label, tmux = false, homeLanguageIcons = false, reser
const current = entries.find((entry) => entry.port === portSlug)
const name = tmux ? 'tmux CLI' : current?.name ?? PORT_BY_SLUG[portSlug ?? '']?.name ?? 'In other ports'
const shortName = tmux ? 'tmux' : PORT_BY_SLUG[portSlug ?? '']?.shortName ?? name
-const families = [
- { label: 'Scripting & web', ports: ['py', 'ruby', 'lua', 'julia', 'elixir', 'ts'] },
- { label: 'Compiled & native', ports: ['rs', 'go', 'cxx', 'swift'] },
- { label: 'JVM', ports: ['java', 'kotlin', 'scala'] },
- { label: '.NET', ports: ['csharp', 'fsharp', 'powershell'] },
-]
-const known = new Set(families.flatMap((family) => family.ports))
-families.push({ label: 'Other languages', ports: entries.filter((entry) => !known.has(entry.port)).map((entry) => entry.port) })
+const families = portFamilies(entries.map((entry) => entry.port))
---
diff --git a/site/src/lib/port-families.ts b/site/src/lib/port-families.ts
new file mode 100644
index 000000000..7ebee4884
--- /dev/null
+++ b/site/src/lib/port-families.ts
@@ -0,0 +1,30 @@
+/** A heading in the port picker and the ports listed under it, in display order. */
+export interface PortFamily {
+ label: string
+ ports: string[]
+}
+
+/**
+ * The picker's groups, in display order. Ports that share a language runtime
+ * (the JVM, .NET, the BEAM) sit in a group named for it; the rest are split
+ * by how they are built and run. A port belongs to one group.
+ */
+export const PORT_FAMILIES: readonly PortFamily[] = [
+ { label: 'Scripting & web', ports: ['py', 'ruby', 'lua', 'julia', 'ts'] },
+ { label: 'Compiled & native', ports: ['rs', 'go', 'cxx', 'swift'] },
+ { label: 'JVM', ports: ['java', 'kotlin', 'scala'] },
+ { label: '.NET', ports: ['csharp', 'fsharp', 'powershell'] },
+ { label: 'BEAM', ports: ['elixir'] },
+]
+
+/** The label of the group that collects every port no family names. */
+export const OTHER_FAMILY_LABEL = 'Other languages'
+
+/** The groups to draw for these ports, ending with the ports no family names. */
+export function portFamilies(ports: readonly string[]): PortFamily[] {
+ const known = new Set(PORT_FAMILIES.flatMap((family) => family.ports))
+ return [
+ ...PORT_FAMILIES.map((family) => ({ label: family.label, ports: [...family.ports] })),
+ { label: OTHER_FAMILY_LABEL, ports: ports.filter((port) => !known.has(port)) },
+ ]
+}
diff --git a/site/test/documentation-picker-interaction.test.ts b/site/test/documentation-picker-interaction.test.ts
index 3381a9c40..acb547b3e 100644
--- a/site/test/documentation-picker-interaction.test.ts
+++ b/site/test/documentation-picker-interaction.test.ts
@@ -5,6 +5,7 @@ import { experimental_AstroContainer } from 'astro/container'
import { pagePortLinks, type PagePortLink } from '../src/lib/page-port-links'
import { API_MODELS } from '../src/lib/api-models'
import { PORTS, productAvailable } from '../src/lib/ports'
+import { PORT_FAMILIES } from '../src/lib/port-families'
import ts from 'typescript'
import { Window, type HTMLAnchorElement, type HTMLElement } from 'happy-dom'
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
@@ -126,6 +127,7 @@ async function renderPicker(entries: PagePortLink[], portSlug = 'julia') {
const component = await compile('../src/components/PagePortSwitcher.astro', {
'../lib/ports': new URL('../src/lib/ports.ts', import.meta.url).href,
'../lib/branding': new URL('../src/lib/branding.ts', import.meta.url).href,
+ '../lib/port-families': new URL('../src/lib/port-families.ts', import.meta.url).href,
'../lib/site-root': root, './tmux/Logo.astro': logo,
})
return (await import(/* @vite-ignore */ component)).default
@@ -134,6 +136,18 @@ async function renderPicker(entries: PagePortLink[], portSlug = 'julia') {
win.document.body.innerHTML = await container.renderToString(await pickerComponent, { props: { entries, portSlug } })
}
+it('draws each port once, under its family, with Elixir under BEAM', async () => {
+ await renderPicker(pagePortLinks({ pagePath: 'reference/glossary', portSlug: 'elixir', version: 'latest', defaults: {}, docs: [] }), 'elixir')
+ const drawn = Array.from(win.document.querySelectorAll('.port-family')).map((section) => ({
+ label: section.querySelector('h3')!.textContent,
+ ports: [...new Set(Array.from(section.querySelectorAll('[data-port]')).map((row) => row.getAttribute('data-port')))],
+ }))
+ expect(drawn.map((family) => family.label)).toEqual(PORT_FAMILIES.map((family) => family.label))
+ expect(drawn.find((family) => family.label === 'BEAM')?.ports).toEqual(['elixir'])
+ expect(drawn.filter((family) => family.ports.includes('elixir'))).toHaveLength(1)
+ expect(drawn.flatMap((family) => family.ports).sort()).toEqual(PORTS.map((port) => port.slug).sort())
+})
+
it('renders safe native glossary destinations without JavaScript', async () => {
const entries = pagePortLinks({ pagePath: 'reference/glossary', portSlug: 'scala', version: 'latest', defaults: {}, docs: [] })
await renderPicker(entries, 'scala')
diff --git a/site/test/port-families.test.ts b/site/test/port-families.test.ts
new file mode 100644
index 000000000..b9c74ad11
--- /dev/null
+++ b/site/test/port-families.test.ts
@@ -0,0 +1,46 @@
+import { describe, expect, it } from 'vitest'
+import { OTHER_FAMILY_LABEL, PORT_FAMILIES, portFamilies } from '../src/lib/port-families'
+import { PORTS } from '../src/lib/ports'
+
+const slugs = PORTS.map((port) => port.slug)
+const familiesOf = (slug: string) => PORT_FAMILIES.filter((family) => family.ports.includes(slug)).map((family) => family.label)
+
+describe('port picker families', () => {
+ it('files every registered port under exactly one family', () => {
+ for (const slug of slugs) expect(familiesOf(slug), slug).toHaveLength(1)
+ })
+
+ it('names only registered ports, once each, under distinct labels', () => {
+ const named = PORT_FAMILIES.flatMap((family) => family.ports)
+ expect(named.filter((slug) => !slugs.includes(slug))).toEqual([])
+ expect(new Set(named).size).toBe(named.length)
+ const labels = [...PORT_FAMILIES.map((family) => family.label), OTHER_FAMILY_LABEL]
+ expect(new Set(labels).size).toBe(labels.length)
+ expect(PORT_FAMILIES.filter((family) => family.ports.length === 0)).toEqual([])
+ })
+
+ it('puts Elixir in the BEAM family and in no other', () => {
+ expect(familiesOf('elixir')).toEqual(['BEAM'])
+ for (const family of portFamilies(slugs)) {
+ expect(family.ports.includes('elixir'), family.label).toBe(family.label === 'BEAM')
+ }
+ })
+
+ it('keeps the runtime families together, after the language families', () => {
+ const labels = PORT_FAMILIES.map((family) => family.label)
+ expect(labels.slice(0, 2)).toEqual(['Scripting & web', 'Compiled & native'])
+ expect(labels.slice(2)).toEqual(['JVM', '.NET', 'BEAM'])
+ })
+
+ it('leaves the catch-all family empty for the registered ports, and last', () => {
+ const drawn = portFamilies(slugs)
+ expect(drawn.at(-1)).toEqual({ label: OTHER_FAMILY_LABEL, ports: [] })
+ expect(drawn.slice(0, -1)).toEqual(PORT_FAMILIES)
+ })
+
+ it('collects a port no family names under the catch-all, once', () => {
+ const drawn = portFamilies([...slugs, 'zig'])
+ expect(drawn.at(-1)).toEqual({ label: OTHER_FAMILY_LABEL, ports: ['zig'] })
+ expect(drawn.filter((family) => family.ports.includes('zig'))).toHaveLength(1)
+ })
+})
From 81448295207fca6ccc8309435ad0b39b5c0e815f Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Sat, 24 Oct 2026 08:18:02 -0500
Subject: [PATCH 40/53] fix(site[api-reference]) Keep the related section in
ApiReference
why: The merge train of #183, #184 and #185 lost the Related types
section on the tmux C reference pages. #184's page test renders
ApiReference with only the components that sit beside the section
listed as real, and an unlisted child renders as its slot. #183 had
moved the section into ApiRelatedTypes.astro, so under that harness it
drew nothing, and `api-related-types` vanished from every page. The
related types themselves were intact: the data and the rail, which
ApiPageContents draws, were the same at the base and at #183's head.
Only the markup moved, and #183's own tests listed the new component, so
none of them could see the loss.
what:
- Put the Related types section back inline in ApiReference and delete
ApiRelatedTypes.astro. The page now differs from the base only in how
it builds the list and in the break points of a label that carries its
owner, so a harness that names what is real still gets the section
- Render the Related types cards in tests from the real ApiReference,
with the page-adjacent components real, as #184's test lists them:
every page where the rule changed a label, and the first list of each
other port. The Related APIs chips stay checked for every list through
ApiPageContents. Choose the pages by the label change, not by the
`qualified` flag the pages are meant to test
- Pin the C pages: cmd_list_panes_exec and cmd_list_panes_window keep
the related types they listed before, with their labels, titles and
links, in a section that follows the declarations the function
references and in the chips, and carry no break points. A section that
a later change appends after it does not disturb the pin
Verified: the two tests that pin the C pages and the card test of the
Elixir and Ruby pages fail on 498a1545d, where the section is missing,
and pass here. Rebuilt on main with this branch, #184 and #185, the
train passes #184's C page tests and these. Against the base fcf99651e,
the lists of 14,794 pages of the 16 ports differ on 62 pages (56 Elixir,
6 Ruby, 92 labels) and on none in the other 14 ports, and the lists of
the tmux C references differ on none: 7,885 pages of 3.7c and 5,090 of
3.2a. Of 200 C pages drawn under the #184 harness, none differs from the
base in sections, cards, chips, titles or links. The full site suite,
lint and astro check pass.
---
site/src/components/api/ApiReference.astro | 14 +-
site/src/components/api/ApiRelatedTypes.astro | 25 ----
site/test/related-labels.test.ts | 121 ++++++++++++++----
3 files changed, 107 insertions(+), 53 deletions(-)
delete mode 100644 site/src/components/api/ApiRelatedTypes.astro
diff --git a/site/src/components/api/ApiReference.astro b/site/src/components/api/ApiReference.astro
index 926f58d77..52eaaf677 100644
--- a/site/src/components/api/ApiReference.astro
+++ b/site/src/components/api/ApiReference.astro
@@ -12,7 +12,6 @@ import { apiGlossary, apiGlossaryHeadings, API_GLOSSARY_TITLE, apiGlossaryHref }
import ApiQualifiedName from '../../components/api/ApiQualifiedName.astro'
import ApiType from '../../components/api/ApiType.astro'
import ApiPageContents from '../../components/api/ApiPageContents.astro'
-import ApiRelatedTypes from './ApiRelatedTypes.astro'
import { apiEntryFields, apiEntrySections, apiMemberGroups, hasScalarMembers, relatedTypeLinks, type ApiSection } from '../../lib/api-sections'
import PageToolbar from '../../components/PageToolbar.astro'
import PagePortSwitcher from '../../components/PagePortSwitcher.astro'
@@ -825,7 +824,18 @@ const bases = owner && 'extends' in owner ? owner.extends ?? [] : []
>
)}
-
+ {related.length > 0 &&
+
-}
diff --git a/site/test/related-labels.test.ts b/site/test/related-labels.test.ts
index e0c76f353..7a29ce84d 100644
--- a/site/test/related-labels.test.ts
+++ b/site/test/related-labels.test.ts
@@ -1,4 +1,4 @@
-import { afterEach, beforeAll, describe, expect, it } from 'vitest'
+import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest'
import { experimental_AstroContainer } from 'astro/container'
import { Window, type Document } from 'happy-dom'
import { membersOf, memberSignals, moduleOf, qualifiedNameOf, type ApiSymbol } from '@libtmux/api-model'
@@ -8,9 +8,11 @@ import { ownerQualifiedName, relatedLabels, type RelatedLabelInput } from '../sr
import { relatedApiTypes, relatedTypeLinks, type RelatedTypeLink } from '../src/lib/api-sections'
import { coreApiSymbols } from '../src/lib/product-api'
import { wordBreak } from '../src/lib/word-break'
-import { tmuxReferenceIndex, tmuxReferenceUrl, tmuxSourceModel } from '../src/lib/tmux-reference'
+import { tmuxReferenceContext, tmuxReferenceIndex, tmuxReferenceUrl, tmuxSourceModel } from '../src/lib/tmux-reference'
import { loadAstroTemplate, withoutScope } from './astro-templates'
+vi.mock('astro:content', () => ({ getCollection: async () => [] }))
+
/**
* A related type is labelled so that a reader can tell which entity it is. A bare name stays when it is unambiguous and the page's
* own subject owns it; an Elixir type, whose `t/0` means nothing outside its module, and any name more than one type in the port carries
@@ -213,11 +215,11 @@ describe('the rendered related lists', () => {
const windows: Window[] = []
afterEach(async () => { for (const win of windows.splice(0)) await win.happyDOM.abort() })
- async function templates() {
- const cards = await loadAstroTemplate('components/api/ApiRelatedTypes.astro', { real: ['components/api/ApiBadge.astro', 'components/api/SymbolName.astro'] })
- const rail = await loadAstroTemplate('components/api/ApiPageContents.astro', { real: ['components/api/ApiBadge.astro', 'components/api/SymbolName.astro'] })
- return { cards, rail }
- }
+ /**
+ * A page as its own components draw it. Only what a page shows beside the related section is real, as a harness that
+ * renders a reference page lists it: the section is part of `ApiReference`, so no child has to be named for it to appear.
+ */
+ const PAGE_COMPONENTS = ['components/api/ApiPageContents.astro', 'components/api/ApiBadge.astro', 'components/api/SymbolName.astro', 'components/api/ApiRelationships.astro']
/** One related list as the reader sees it: the label and title of each link, and the label's markup. */
function shown(root: Document, selector: string) {
@@ -227,35 +229,102 @@ describe('the rendered related lists', () => {
})
}
- it('draws the same unique labels in the Related types cards and the Related APIs chips of every list', async () => {
- const { cards, rail } = await templates()
+ /** What a chip or card draws for a label: break points where the rule changed it, plain text where it did not. */
+ const markup = (label: string, before: string) => (label !== before ? wordBreak(label).join('') : label).replaceAll('&', '&')
+
+ it('draws the Related APIs chips of every list with unique labels, titles, links, marks and break points', async () => {
+ const rail = await loadAstroTemplate('components/api/ApiPageContents.astro', { real: ['components/api/ApiBadge.astro', 'components/api/SymbolName.astro'] })
const win = new Window({ url: 'https://libtmux.org/' })
windows.push(win)
const container = await experimental_AstroContainer.create()
- const render = async (template: unknown, props: Record) => withoutScope(await container.renderToString(
- template as Parameters[0], { request: new Request('https://libtmux.org/'), props }))
let lists = 0
for (const { port, owner, links, before } of pages().filter((entry) => entry.links.length > 1)) {
const where = `${port} ${qualifiedNameOf(owner)}`
- win.document.body.innerHTML = await render(cards, { related: links, index: undefined }) + await render(rail, { sections: [], related: links })
- const card = shown(win.document, '.api-related-card > a')
- const chip = shown(win.document, 'nav.api-related a')
- expect(card.map((item) => item.label), where).toEqual(links.map((link) => link.name))
- expect(chip.map((item) => item.label), where).toEqual(links.map((link) => link.name))
- expect(duplicates(card.map((item) => item.label!)), where).toEqual([])
- expect(duplicates(chip.map((item) => item.label!)), where).toEqual([])
+ win.document.body.innerHTML = withoutScope(await container.renderToString(rail as Parameters[0], {
+ request: new Request('https://libtmux.org/'), props: { sections: [], related: links },
+ }))
+ const chips = shown(win.document, 'nav.api-related a')
+ expect(chips.map((item) => item.label), where).toEqual(links.map((link) => link.name))
+ expect(duplicates(chips.map((item) => item.label!)), where).toEqual([])
for (const [i, link] of links.entries()) {
- for (const item of [card[i]!, chip[i]!]) {
- expect(item.title, where).toBe(link.identity)
- expect(item.href, where).toBe(link.href)
- expect(item.mark, where).toBeTruthy()
- // A label the rule changed breaks where a symbol name breaks; one it left alone has no break points.
- const changed = link.name !== before[i]
- expect(item.markup, `${where}: ${link.name}`).toBe((changed ? wordBreak(link.name).join('') : link.name).replaceAll('&', '&'))
- }
+ expect(chips[i]!.title, where).toBe(link.identity)
+ expect(chips[i]!.href, where).toBe(link.href)
+ expect(chips[i]!.mark, where).toBeTruthy()
+ expect(chips[i]!.markup, `${where}: ${link.name}`).toBe(markup(link.name, before[i]!))
}
lists++
}
expect(lists).toBeGreaterThan(1000)
}, 300_000)
+
+ async function reference(props: Record, slug: string | undefined, path: string) {
+ const template = await loadAstroTemplate('components/api/ApiReference.astro', { real: PAGE_COMPONENTS })
+ const container = await experimental_AstroContainer.create({ astroConfig: { site: 'https://libtmux.org' } } as never)
+ const win = new Window()
+ windows.push(win)
+ win.document.body.innerHTML = withoutScope(await container.renderToString(template as never, {
+ request: new Request(`https://libtmux.org${path}`), params: slug ? { slug } : undefined, props,
+ }))
+ return win.document
+ }
+
+ it('draws the Related types cards of a page from ApiReference, beside the chips that name the same entries', async () => {
+ const all = pages()
+ // Every page where the rule changed a label, and the first page of each other port with a list to compare.
+ const changed = all.filter((entry) => entry.links.some((link, i) => link.name !== entry.before[i]))
+ const others = Object.keys(API_MODELS).flatMap((port) => changed.some((entry) => entry.port === port) ? [] : all.filter((entry) => entry.port === port && entry.links.length > 1).slice(0, 1))
+ const template = await loadAstroTemplate('components/api/ApiReference.astro', { real: PAGE_COMPONENTS })
+ const container = await experimental_AstroContainer.create({ astroConfig: { site: 'https://libtmux.org' } } as never)
+ const win = new Window()
+ windows.push(win)
+ for (const { port, owner, links, before } of [...changed, ...others]) {
+ const where = `${port} ${qualifiedNameOf(owner)}`
+ win.document.body.innerHTML = withoutScope(await container.renderToString(template as never, {
+ request: new Request(`https://libtmux.org/en/${port}/latest/reference/${owner.slug}/`), params: { slug: owner.slug }, props: { model: API_MODELS[port], owner },
+ }))
+ const ids = [...win.document.querySelectorAll('h2[id^="api-"]')].map((heading) => heading.id)
+ expect(ids, where).toContain('api-related-types')
+ const cards = shown(win.document, '.api-related-card > a')
+ const chips = shown(win.document, 'nav.api-related a')
+ expect(cards.map((item) => item.label), where).toEqual(links.map((link) => link.name))
+ expect(chips.map((item) => item.label), where).toEqual(cards.map((item) => item.label))
+ expect(duplicates(cards.map((item) => item.label!)), where).toEqual([])
+ for (const [i, link] of links.entries()) {
+ expect(cards[i]!.title, where).toBe(link.identity)
+ expect(cards[i]!.href, where).toMatch(new RegExp(`/${link.symbol.slug}/$`))
+ expect(cards[i]!.mark, where).toBeTruthy()
+ expect(cards[i]!.markup, `${where}: ${link.name}`).toBe(markup(link.name, before[i]!))
+ }
+ }
+ expect(changed.length).toBeGreaterThan(0)
+ }, 300_000)
+
+ describe('on the tmux C source reference', () => {
+ // The related types these two pages listed before the owner rule, which no C page takes.
+ const expected = {
+ cmd_list_panes_exec: ['c:enum:cmd_retval', 'c:struct:cmd', 'c:struct:cmdq_item'],
+ cmd_list_panes_window: ['c:struct:cmd', 'c:struct:session', 'c:struct:winlink', 'c:struct:cmdq_item'],
+ }
+
+ it.each(Object.entries(expected))('keeps the related types of %s, as a section of the page and in the chips', async (name, related) => {
+ const model = tmuxSourceModel('latest')
+ const byId = new Map(model.symbols.map((entry) => [entry.id, entry]))
+ const symbol = model.symbols.find((entry) => entry.name === name)!
+ const document = await reference({ source: tmuxReferenceContext('latest', symbol), owner: symbol, searchable: false }, undefined, '/')
+ const ids = [...document.querySelectorAll('h2[id^="api-"]')].map((heading) => heading.id)
+ // The section follows the declarations the function references, and a section a later change appends may follow it.
+ expect(ids).toContain('api-referenced-declarations')
+ expect(ids.indexOf('api-related-types')).toBeGreaterThan(ids.indexOf('api-referenced-declarations'))
+ const labels = related.map((id) => byId.get(id)!.name)
+ const cards = shown(document, '.api-related-card > a')
+ expect(cards.map((item) => item.label)).toEqual(labels)
+ expect(shown(document, 'nav.api-related a').map((item) => item.label)).toEqual(labels)
+ for (const [i, item] of cards.entries()) {
+ expect(item.markup, item.label!).toBe(item.label)
+ expect(item.title, item.label!).toBe(item.label)
+ expect(item.href, item.label!).toBe(tmuxReferenceUrl('latest', byId.get(related[i]!)!))
+ expect(item.mark, item.label!).toBeTruthy()
+ }
+ }, 120_000)
+ })
})
From 23b7e6e83a7de8515e7cab9da2ce3a3e258f3257 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Sat, 24 Oct 2026 09:12:51 -0500
Subject: [PATCH 41/53] fix(site) Keep Python's tmux minimum at 3.2a
why: The 3.3a sweep moved the Python, tmuxp and libtmux-mcp pages to a
floor that none of them declares. At tmux-python/libtmux master,
TMUX_MIN_VERSION is "3.2a", the README says "tmux: >= 3.2a", and the CI
matrix starts at 3.2a. The 3.3a raise exists only in the open draft
tmux-python/libtmux#779, so a reader on 3.2a would be told to upgrade
for a library that runs there. The refusal sentence added to the Python
pages was also untrue: libtmux exposes has_minimum_version, which
compares the `tmux -V` of its executable with TMUX_MIN_VERSION, and no
operation in src/libtmux calls it, so nothing refuses an older daemon.
Evidence, pinned to the trunk heads read on 2026-10-24:
- libtmux e5cb17c: src/libtmux/common.py TMUX_MIN_VERSION = "3.2a"
https://github.com/tmux-python/libtmux/blob/e5cb17c855fb9c9427e9c51a7239d6e843f4ede0/src/libtmux/common.py#L29
README "tmux: >= 3.2a"
https://github.com/tmux-python/libtmux/blob/e5cb17c855fb9c9427e9c51a7239d6e843f4ede0/README.md#L33
tests.yml tmux-version matrix begins at 3.2a
https://github.com/tmux-python/libtmux/blob/e5cb17c855fb9c9427e9c51a7239d6e843f4ede0/.github/workflows/tests.yml#L15
- tmuxp 7965262: README "tmux support: 3.2+"; matrix begins at 3.2a
https://github.com/tmux-python/tmuxp/blob/7965262d4a376f5f6cd9238b6ce4189d35a5d9e7/README.md#L313
- libtmux-mcp 263541d: README "tmux >= 3.2a on $PATH"; compatibility
table "< 3.2a: Not supported (libtmux requirement)"
https://github.com/tmux-python/libtmux-mcp/blob/263541d4b7c72507ab64bbb066592181522eec6c/docs/reference/compatibility.md#L20
what:
- Restore 3.2a on the Python guides, the MCP entry and guide pages,
the tmuxp workspace pages, the shared workspace installation page's
tmuxp paragraph and the Python home quickstart prerequisites
- Restore the "3.2+" rows of the options and hooks requirements table,
which sits beside the 3.3+ rows for individual hooks
- Keep the link to the shared tmux support guide on the two Python
pages that gained it, and drop the sentence that said an older daemon
is refused before any effect
---
.../_workspace-shared/workspace/guides/installation.md | 2 +-
site/src/content/docs/ports/py/guides/attaching-to-tmux.md | 2 +-
site/src/content/docs/ports/py/mcp/guides.md | 2 +-
site/src/content/docs/ports/py/mcp/index.md | 2 +-
site/src/content/docs/ports/py/topics/options-and-hooks.md | 4 ++--
site/src/content/docs/ports/py/workspace/guides.md | 2 +-
.../docs/ports/py/workspace/reference/compatibility.md | 2 +-
site/src/data/home-examples.json | 2 +-
8 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/site/src/content/_workspace-shared/workspace/guides/installation.md b/site/src/content/_workspace-shared/workspace/guides/installation.md
index 6b2c49550..41109c8c4 100644
--- a/site/src/content/_workspace-shared/workspace/guides/installation.md
+++ b/site/src/content/_workspace-shared/workspace/guides/installation.md
@@ -11,7 +11,7 @@ title: Install and load a workspace
The runnable terminal loader is the separate Python application tmuxp. Its
-documented prerequisites are Python 3.10 or newer and tmux 3.3a or newer. Install
+documented prerequisites are Python 3.10 or newer and tmux 3.2a or newer. Install
it in an isolated tool environment with uv:
```console
$ uv tool install tmuxp
diff --git a/site/src/content/docs/ports/py/guides/attaching-to-tmux.md b/site/src/content/docs/ports/py/guides/attaching-to-tmux.md
index d7f0624ff..4a007a2c0 100644
--- a/site/src/content/docs/ports/py/guides/attaching-to-tmux.md
+++ b/site/src/content/docs/ports/py/guides/attaching-to-tmux.md
@@ -38,7 +38,7 @@ print(session.session_name)
## Setup and run
-Use an empty directory on Linux with Git and tmux 3.3a or newer installed.
+Use an empty directory on Linux with Git and tmux 3.2a or newer installed.
This example was checked with Python 3.14.6.
diff --git a/site/src/content/docs/ports/py/mcp/guides.md b/site/src/content/docs/ports/py/mcp/guides.md
index 3985fe063..72925dd3f 100644
--- a/site/src/content/docs/ports/py/mcp/guides.md
+++ b/site/src/content/docs/ports/py/mcp/guides.md
@@ -10,7 +10,7 @@ sidebar:
---
Configure the client to launch `libtmux-mcp` with a named tmux socket.
-Install [uv](https://docs.astral.sh/uv/) first, and make tmux 3.3a or newer
+Install [uv](https://docs.astral.sh/uv/) first, and make tmux 3.2a or newer
available in the environment the client passes to the server.
## Launch the server
diff --git a/site/src/content/docs/ports/py/mcp/index.md b/site/src/content/docs/ports/py/mcp/index.md
index 0279535d7..cd7ec11c0 100644
--- a/site/src/content/docs/ports/py/mcp/index.md
+++ b/site/src/content/docs/ports/py/mcp/index.md
@@ -13,7 +13,7 @@ run commands, and wait for their results. The distribution and executable are
`libtmux-mcp`; Python imports use `libtmux_mcp`.
The server runs over standard input and output. It requires Python 3.10 or
-newer and tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](../../../tmux/guides/tmux-support/). Its default toolsets are `inspect`, `manage`,
+newer and tmux 3.2a or newer; see [tmux support](../../../tmux/guides/tmux-support/). Its default toolsets are `inspect`, `manage`,
and `execute`; deletion tools require an explicit selection.
## Start here
diff --git a/site/src/content/docs/ports/py/topics/options-and-hooks.md b/site/src/content/docs/ports/py/topics/options-and-hooks.md
index aea739c2b..44c04cfda 100644
--- a/site/src/content/docs/ports/py/topics/options-and-hooks.md
+++ b/site/src/content/docs/ports/py/topics/options-and-hooks.md
@@ -82,8 +82,8 @@ The compatibility notes list these tmux requirements:
| Feature | Minimum tmux |
|---------|-------------|
-| All options/hooks features | 3.3a+ |
-| Window/pane hook *scope flags* (`-w`, `-p`) accepted | 3.3a+; see the supported-scope caveat above |
+| All options/hooks features | 3.2+ |
+| Window/pane hook *scope flags* (`-w`, `-p`) accepted | 3.2+; see the supported-scope caveat above |
| `client-active`, `window-resized` hooks | 3.3+ |
| `pane-title-changed` hook | 3.2+ |
diff --git a/site/src/content/docs/ports/py/workspace/guides.md b/site/src/content/docs/ports/py/workspace/guides.md
index b52c391c5..b705f5abd 100644
--- a/site/src/content/docs/ports/py/workspace/guides.md
+++ b/site/src/content/docs/ports/py/workspace/guides.md
@@ -9,7 +9,7 @@ sidebar:
tableOfContents: true
---
-Install tmuxp as a Python tool, with Python 3.10 or newer and tmux 3.3a or newer
+Install tmuxp as a Python tool, with Python 3.10 or newer and tmux 3.2a or newer
available on the host:
```console
diff --git a/site/src/content/docs/ports/py/workspace/reference/compatibility.md b/site/src/content/docs/ports/py/workspace/reference/compatibility.md
index 7d0735957..f193a557e 100644
--- a/site/src/content/docs/ports/py/workspace/reference/compatibility.md
+++ b/site/src/content/docs/ports/py/workspace/reference/compatibility.md
@@ -13,7 +13,7 @@ tableOfContents: true
These pages document tmuxp 1.74.0 at the source revision linked below. Install
tmuxp in its own Python environment and let its dependency resolver select a
compatible libtmux release. The walkthroughs use Python 3.10 or newer and
-tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see [tmux support](../../../../../tmux/guides/tmux-support/).
+tmux 3.2a or newer; see [tmux support](../../../../../tmux/guides/tmux-support/).
## Configuration and extensions
diff --git a/site/src/data/home-examples.json b/site/src/data/home-examples.json
index 33bba2b83..24d28a1a6 100644
--- a/site/src/data/home-examples.json
+++ b/site/src/data/home-examples.json
@@ -18,7 +18,7 @@
"code": "from __future__ import annotations\n\nfrom pathlib import Path\nimport shutil\nimport tempfile\nimport time\n\nimport libtmux\n\ndirectory = Path(tempfile.mkdtemp(prefix=\"libtmux-py-home-\"))\nsocket = directory / \"tmux.sock\"\nserver = libtmux.Server(socket_path=socket, config_file=\"/dev/null\")\n\ntry:\n session = server.new_session(session_name=\"demo\")\n window = session.active_window\n assert window is not None\n pane = window.split(shell=\"sh\")\n\n pane.send_keys(\"printf '\\\\nHello world\\\\n'\", enter=True)\n\n deadline = time.monotonic() + 5\n while \"Hello world\" not in pane.capture_pane():\n if time.monotonic() >= deadline:\n raise TimeoutError(\"The pane did not print Hello world\")\n time.sleep(0.02)\n\n print(\"Hello world\")\nexcept Exception as error:\n raise RuntimeError(\"tmux quickstart failed\") from error\nfinally:\n if socket.exists():\n server.kill()\n shutil.rmtree(directory)\n"
}
],
- "prerequisites": "POSIX shell, Git, tmux 3.3a or newer, Python 3.14.6 and uv (tested 0.12.0).",
+ "prerequisites": "POSIX shell, Git, tmux 3.2a or newer, Python 3.14.6 and uv (tested 0.12.0).",
"commands": [
"git init -q source\ngit -C source fetch -q --depth=1 \\\n https://github.com/tmux-python/libtmux.git \\\n 9fdd083a8181a827889337b63cd4e6daea661a8c\ngit -C source checkout -q --detach FETCH_HEAD\nuv venv .venv\nuv pip install --python .venv/bin/python ./source",
"unset TMUX TMUX_PANE\nexport ENV=/dev/null BASH_ENV=/dev/null SHELL=/bin/sh\n.venv/bin/python quickstart.py"
From 400da2a64445443dcf538ef55257d28acc603bec Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Sat, 24 Oct 2026 09:12:51 -0500
Subject: [PATCH 42/53] fix(site) State each port's own tmux floor in the guide
why: The support guide opened with "Every libtmux port ... support tmux
3.3a and newer", and tmux-minimum.test.ts required every minimum on the
site to name 3.3a. Two ports declare another floor, so the guide and the
check both contradicted their sources, and the check could not catch a
Python page that claimed 3.3a, which is the mistake the previous commit
removes. No port declares a floor above 3.3a.
Evidence, pinned to the trunk heads read on 2026-10-24:
- Elixir 2cc4430: priv/tmux/support.json has "tmux_minimum": "3.3" and
lists 3.3, 3.3a, 3.4 and 3.8 as required Linux releases; the README
says "3.3 minimum; tested with 3.3, 3.3a, 3.4 and 3.8". lib/ holds no
version check, so the floor is declared and tested, not refused at
run time.
https://github.com/libtmux/libtmux-elixir/blob/2cc4430595da7e3b1c50148d1e476baf70191194/priv/tmux/support.json
- Python: see the previous commit. common.py compares the `tmux -V` of
the executable with TMUX_MIN_VERSION in has_minimum_version, which no
operation in src/libtmux calls.
https://github.com/tmux-python/libtmux/blob/e5cb17c855fb9c9427e9c51a7239d6e843f4ede0/src/libtmux/common.py#L608
- The rs standard-library-core page documents a prototype pinned at
libtmux-rs d7541fb, whose README says 3.2a; that experiment is gone
from libtmux-rs master, so the page keeps the floor of its pin.
https://github.com/libtmux/libtmux-rs/blob/d7541fbace16d6a45882cd0af0ea6880f9c21748/experiments/standard-library-core/README.md#L36
what:
- Open the guide with "no port requires a tmux newer than 3.3a" and add
a list of minimums: 3.2a for Python, tmuxp and libtmux-mcp, 3.3 for
Elixir, 3.3a for every other port
- Say that Python exposes an executable check that its operations do
not call and that Elixir has no run-time refusal, beside the rules
that judge the daemon
- Check each statement against its port's floor: Python and Elixir
pages must name theirs, other pages 3.3a
- List the statements that keep another floor by file and version with
the reason, and fail an entry that no longer matches its text
- Fail when the guide's list lacks a floor the check knows
- Without the entries the check reported the Elixir and Python
statements and the rs prototype; with them it passes, a Python page
that says 3.3a again fails, and an entry whose text is gone fails
---
site/src/content/docs/guides/tmux-support.md | 29 +++--
site/test/tmux-minimum.test.ts | 127 +++++++++++++++++--
2 files changed, 134 insertions(+), 22 deletions(-)
diff --git a/site/src/content/docs/guides/tmux-support.md b/site/src/content/docs/guides/tmux-support.md
index 1d7c9b117..a7f48ff1f 100644
--- a/site/src/content/docs/guides/tmux-support.md
+++ b/site/src/content/docs/guides/tmux-support.md
@@ -9,18 +9,26 @@ sidebar:
tableOfContents: true
---
-Every libtmux port, the MCP servers and the workspace builders support tmux
-3.3a and newer. A daemon older than 3.3a is refused before the requested
-operation has any effect.
+No libtmux port requires a tmux newer than 3.3a. The ports, the MCP servers
+and the workspace builders support tmux 3.3a and newer, except Python and
+Elixir, which state an earlier floor. A port that enforces its minimum
+refuses an older daemon before the requested operation has any effect.
+
+## Minimum by port
+
+- Python (`libtmux`), tmuxp and `libtmux-mcp`: tmux 3.2a.
+- Elixir: tmux 3.3.
+- Every other port, with its MCP server and workspace builder: tmux 3.3a.
## The core minimum
The minimum for ordinary reads, writes, batches, raw commands, workspace
-loading and MCP tools is tmux 3.3a. Releases compare in full, including patch
-letters, so 3.3 is below the minimum and 3.3a is the first supported release.
-A development build such as `next-3.9` ranks below the release it precedes, and
-a release candidate ranks below its release. A version the library cannot
-read is refused, not assumed to be new enough.
+loading and MCP tools is the port's own, tmux 3.3a for most ports. Releases
+compare in full, including patch letters, so 3.3 is below a 3.3a minimum and
+3.3a is the first supported release. A development build such as `next-3.9`
+ranks below the release it precedes, and a release candidate ranks below its
+release. A version the library cannot read is refused, not assumed to be new
+enough.
Libraries judge the daemon that answers on the selected socket, not the `tmux`
executable that sends the command. The two can differ, for example when a
@@ -38,6 +46,11 @@ newer client binary talks to a server started by an older one. The rules are:
- The refusal raises the port's version error and happens before the command
runs, so a refused call leaves no session, window, option or buffer behind.
+The Python library does not refuse an older tmux by itself. Its
+`has_minimum_version` helper compares the version that the `tmux` executable
+reports with 3.2a, and no library operation calls it. The Elixir port declares
+its floor and tests it, and has no runtime refusal.
+
Running `tmux -V` or `tmux -h` on an older executable still works; see the
[command reference](/tmux/latest/manual/full/#COMMANDS). Their output does not
authorize later operations.
diff --git a/site/test/tmux-minimum.test.ts b/site/test/tmux-minimum.test.ts
index a1311601b..283f00e05 100644
--- a/site/test/tmux-minimum.test.ts
+++ b/site/test/tmux-minimum.test.ts
@@ -4,16 +4,69 @@ import { fileURLToPath } from 'node:url'
import { describe, expect, it } from 'vitest'
/**
- * Every statement of a tmux minimum names the core floor.
+ * Every statement of a tmux minimum names the floor of the port it is about.
*
* A requirement phrased "tmux X or newer", "tmux X+" or "tmux X through Y"
* is a support promise. These pages, example prerequisites and install notes
- * must agree with the floor in the core tmux support contract. Facts about
- * tmux itself, such as the release that added a format field, use other
- * phrasing, or follow "on", and are not matched. Staged port guides come from
- * pinned port revisions and carry their own floor.
+ * must agree with the floor in the core tmux support contract, which is 3.3a
+ * unless the port declares another. Facts about tmux itself, such as the
+ * release that added a format field, use other phrasing, or follow "on", and
+ * are not matched. Staged port guides come from pinned port revisions and
+ * carry their own floor.
*/
const FLOOR = '3.3a'
+
+/**
+ * Ports whose own documented floor is not the core one. Every statement below
+ * the path names that floor, so a page for the port cannot quietly claim the
+ * core one. A path ending in "/" covers every file below it.
+ */
+export const PORT_FLOORS = [
+ {
+ path: 'site/src/content/docs/ports/py/',
+ version: '3.2a',
+ why: 'libtmux and libtmux-mcp declare TMUX_MIN_VERSION and a README floor of 3.2a',
+ },
+ {
+ path: 'site/src/content/docs/ports/elixir/',
+ version: '3.3',
+ why: 'priv/tmux/support.json declares tmux_minimum 3.3, and 3.3 is a required CI release',
+ },
+]
+
+/**
+ * Single statements elsewhere that name another floor on purpose, usually in
+ * a file that speaks for several ports. An entry that matches no statement
+ * fails, so an exemption cannot outlive the text it covers.
+ */
+export const OTHER_FLOORS = [
+ {
+ path: 'site/src/content/_workspace-shared/workspace/guides/installation.md',
+ version: '3.2a',
+ why: 'the tmuxp paragraph; tmuxp runs on the libtmux floor, 3.2a',
+ },
+ {
+ path: 'site/src/data/home-examples.json',
+ version: '3.2a',
+ why: 'the Python quickstart prerequisites',
+ },
+ {
+ path: 'site/src/data/home-examples.json',
+ version: '3.3',
+ why: 'the Elixir quickstart prerequisites; priv/tmux/support.json declares tmux_minimum 3.3',
+ },
+ {
+ path: 'site/src/lib/ports.ts',
+ version: '3.3',
+ why: 'the Elixir install notes; priv/tmux/support.json declares tmux_minimum 3.3',
+ },
+ {
+ path: 'site/src/content/docs/ports/rs/concepts/standard-library-core.md',
+ version: '3.2a',
+ why: 'documents a prototype pinned at an older libtmux-rs revision whose own README says 3.2a',
+ },
+]
+
const ROOT = join(dirname(fileURLToPath(import.meta.url)), '../..')
const RANGES = [
'site/src/content',
@@ -37,6 +90,24 @@ export function minimums(text: string): string[] {
return found
}
+interface Statement { path: string, version: string }
+interface Floor { path: string, version: string }
+
+/** Statements that disagree with their floor, then entries that excuse or require nothing. */
+export function mismatches(statements: Statement[], ports: Floor[], others: Floor[]): string[] {
+ const covers = (entry: Floor, statement: Statement) =>
+ statement.version === entry.version && statement.path.startsWith(entry.path)
+ const expected = (statement: Statement) =>
+ ports.find((port) => statement.path.startsWith(port.path))?.version ?? FLOOR
+ const wrong = statements
+ .filter((statement) => statement.version !== expected(statement) && !others.some((entry) => covers(entry, statement)))
+ .map((statement) => `${statement.path}: tmux ${statement.version}, expected ${expected(statement)}`)
+ const unused = [...ports, ...others]
+ .filter((entry) => !statements.some((statement) => covers(entry, statement)))
+ .map((entry) => `stale entry: ${entry.path} names tmux ${entry.version}, which no statement there states`)
+ return [...wrong, ...unused]
+}
+
describe('tmux minimum statements', () => {
it('recognizes each phrasing of a minimum', () => {
expect(minimums('Use tmux 3.2a or newer.')).toEqual(['3.2a'])
@@ -47,17 +118,45 @@ describe('tmux minimum statements', () => {
expect(minimums('The example ran on tmux 3.2a and 3.7c.')).toEqual([])
})
- it('names the core floor everywhere a minimum is stated', () => {
- const stale: string[] = []
- let seen = 0
+ it('names the floor of its port everywhere a minimum is stated', () => {
+ const statements: Statement[] = []
for (const path of RANGES.flatMap(files)) {
if (!/\.(md|mdx|json|ts)$/.test(path) || path.includes('/_staged/')) continue
- for (const version of minimums(readFileSync(join(ROOT, path), 'utf8'))) {
- seen += 1
- if (version !== FLOOR) stale.push(`${path}: tmux ${version}`)
- }
+ for (const version of minimums(readFileSync(join(ROOT, path), 'utf8'))) statements.push({ path, version })
+ }
+ expect(statements.length).toBeGreaterThan(50)
+ expect(mismatches(statements, PORT_FLOORS, OTHER_FLOORS)).toEqual([])
+ })
+
+ it('lists each floor in the support guide', () => {
+ const guide = readFileSync(join(ROOT, 'site/src/content/docs/guides/tmux-support.md'), 'utf8')
+ const section = guide.slice(guide.indexOf('## Minimum by port'), guide.indexOf('## The core minimum'))
+ expect(section).not.toBe('')
+ for (const version of [FLOOR, ...PORT_FLOORS.map((port) => port.version)]) {
+ expect(section).toContain(`: tmux ${version}.`)
}
- expect(seen).toBeGreaterThan(50)
- expect(stale).toEqual([])
+ })
+
+ it('fails a wrong floor, a port page on the core floor and an entry that matches nothing', () => {
+ const ports = [{ path: 'a/', version: '3.2a' }]
+ const others = [{ path: 'm.md', version: '3.3' }]
+ const clean = [
+ { path: 'a/b.md', version: '3.2a' },
+ { path: 'c.md', version: FLOOR },
+ { path: 'm.md', version: '3.3' },
+ ]
+ expect(mismatches(clean, ports, others)).toEqual([])
+ expect(mismatches([...clean, { path: 'c.md', version: '3.2a' }], ports, others)).toEqual([
+ 'c.md: tmux 3.2a, expected 3.3a',
+ ])
+ expect(mismatches([...clean, { path: 'a/d.md', version: FLOOR }], ports, others)).toEqual([
+ 'a/d.md: tmux 3.3a, expected 3.2a',
+ ])
+ expect(mismatches(clean.slice(1), ports, others)).toEqual([
+ 'stale entry: a/ names tmux 3.2a, which no statement there states',
+ ])
+ expect(mismatches(clean.slice(0, 2), ports, others)).toEqual([
+ 'stale entry: m.md names tmux 3.3, which no statement there states',
+ ])
})
})
From 256fa6b0e157a4215aa8ebd8471e0670043e94c9 Mon Sep 17 00:00:00 2001
From: Tony Narlock
Date: Sat, 24 Oct 2026 09:12:51 -0500
Subject: [PATCH 43/53] fix(site[data]) State tmux 3.3a in the JVM example
intros
why: The tmux 3.3a sweep changed the JVM example template in
jvm-examples.ts to "tmux 3.3a through 3.7c", but the Java, Kotlin and
Scala API models still hold the text it produced before, so the
complete examples the site renders kept telling readers 3.2a was
enough. libtmux-java master declares 3.3a for the core, the MCP server
and the workspace CLI, and enforces it in TmuxVersion.MINIMUM.
Main made the same template and model change for the other ports in
924496b03 and c65a5360d; the JVM ports were left because their
pages still said 3.2a.
Evidence, libtmux-java master 08ee74b, read on 2026-10-24:
- libtmux/src/main/java/io/github/libtmux/TmuxVersion.java declares
MINIMUM = new TmuxVersion(3, 3, "a")
https://github.com/libtmux/libtmux-java/blob/08ee74b26ceee96c399daf9348bebcbade7e5188/libtmux/src/main/java/io/github/libtmux/TmuxVersion.java#L45
- README: "tmux 3.3a through 3.7c" for ordinary operations
https://github.com/libtmux/libtmux-java/blob/08ee74b26ceee96c399daf9348bebcbade7e5188/README.md#L718
- The Kotlin and Scala READMEs state the same floor.
https://github.com/libtmux/libtmux-java/blob/08ee74b26ceee96c399daf9348bebcbade7e5188/libtmux-scala/README.md#L92
what:
- Replace "tmux 3.2a through 3.7c" with "tmux 3.3a through 3.7c" in the
generated example intros of the Java, Kotlin and Scala models, the
substitution a regeneration at the unchanged pin makes
- Leave the text extracted from the pinned sources alone; it changes
with a pin bump
---
site/src/data/api/java.json | 2 +-
site/src/data/api/kotlin.json | 2 +-
site/src/data/api/scala.json | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/site/src/data/api/java.json b/site/src/data/api/java.json
index bd1539af5..d378fd8fa 100644
--- a/site/src/data/api/java.json
+++ b/site/src/data/api/java.json
@@ -1 +1 @@
-{"port":"java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractor":"@libtmux/api-model@0.0.1","symbols":[{"id":"io.github.libtmux.batch.Batch.Batch","name":"Batch","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"Several tmux commands in one invocation, each with an outcome of its own.","body":"tmux runs a group until a command fails and then discards the rest, so the number of replies\ncannot say which command failed: an error in the first position and an error in the last both\ncome back as one nonzero exit. Counting replies is wrong in every position but one.\n\nA marker is therefore interleaved after each operation. Markers are discarded along with\neverything else after a failure, so the last marker seen is exactly the last operation tmux ran,\nand the operations either side of that boundary are known rather than guessed."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/Batch.java","line":24,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.Batch","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.Batch.Batch","product":"core","slug":"io-github-libtmux-batch-batch-batch"},{"id":"io.github.libtmux.batch.Batch.Batch.Batch","name":"Batch","kind":"method","modifiers":[],"parent":"io.github.libtmux.batch.Batch.Batch","signatures":[{"raw":"public Batch(Function>, CommandResult> dispatch)","params":[{"name":"dispatch","type":"Function>, CommandResult>","doc":"runs the assembled commands in one invocation and returns tmux's raw reply"}],"typeScopeBoundary":false}],"doc":{"summary":"Collects operations to run together."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/Batch.java","line":36,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.Batch.Batch","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.Batch.Batch.Batch","product":"core","slug":"io-github-libtmux-batch-batch-batch-batch"},{"id":"io.github.libtmux.batch.Batch.Batch.add","name":"add","kind":"method","modifiers":["overload"],"parent":"io.github.libtmux.batch.Batch.Batch","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public Batch add(String... argv)","params":[{"name":"argv","type":"String","variadic":"positional"}],"returns":"Batch","typeScopeBoundary":false},{"raw":"@Operation(Kind.CAPTURED)\n public Batch add(List argv)","params":[{"name":"argv","type":"List"}],"returns":"Batch","typeScopeBoundary":false}],"doc":{"summary":"Adds one tmux command, its arguments already separate elements."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/Batch.java","line":41,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.Batch.add","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.Batch.Batch.add","product":"core","slug":"io-github-libtmux-batch-batch-batch-add"},{"id":"io.github.libtmux.batch.Batch.Batch.size","name":"size","kind":"method","modifiers":[],"parent":"io.github.libtmux.batch.Batch.Batch","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public int size()","params":[],"returns":"int","typeScopeBoundary":false}],"doc":{"summary":"How many operations have been collected."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/Batch.java","line":57,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.Batch.size","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.Batch.Batch.size","product":"core","slug":"io-github-libtmux-batch-batch-batch-size"},{"id":"io.github.libtmux.batch.Batch.Batch.length","name":"length","kind":"method","modifiers":[],"parent":"io.github.libtmux.batch.Batch.Batch","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public int length()","params":[],"returns":"int","typeScopeBoundary":false}],"doc":{"summary":"How many bytes the collected operations come to as the one command tmux parses.","body":"tmux packs a command into MAX_IMSGSIZE, 16384 bytes, and refuses a longer one with\n{@code command too long}; measured, it takes about 16300 of them. A batch taken from a handle\ntravels as this one string plus the guard that fences it, so it costs this and a little more.\nOne dispatched as separate arguments costs less, since nothing there is quoted."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/Batch.java","line":70,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.Batch.length","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.Batch.Batch.length","product":"core","slug":"io-github-libtmux-batch-batch-batch-length"},{"id":"io.github.libtmux.batch.Batch.Batch.run","name":"run","kind":"method","modifiers":[],"parent":"io.github.libtmux.batch.Batch.Batch","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public BatchResult run()","params":[],"returns":"BatchResult","typeScopeBoundary":false,"returnsDoc":"one result per operation, in submission order"}],"doc":{"summary":"Runs every collected operation in one tmux invocation."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/Batch.java","line":80,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.Batch.run","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.Batch.Batch.run","product":"core","slug":"io-github-libtmux-batch-batch-batch-run"},{"id":"io.github.libtmux.batch.BatchResult.BatchResult","name":"BatchResult","kind":"class","modifiers":[],"signatures":[{"raw":"public record BatchResult(@ReadOnly List operations)","params":[{"name":"operations","type":"List","doc":"one result per submitted operation, in submission order"}]}],"typeScopeBoundary":false,"doc":{"summary":"What became of every operation in one batch."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/BatchResult.java","line":12,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.BatchResult","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.BatchResult.BatchResult","product":"core","slug":"io-github-libtmux-batch-batchresult-batchresult"},{"id":"io.github.libtmux.batch.BatchResult.BatchResult.succeeded","name":"succeeded","kind":"method","modifiers":[],"parent":"io.github.libtmux.batch.BatchResult.BatchResult","signatures":[{"raw":"public boolean succeeded()","params":[],"returns":"boolean","typeScopeBoundary":false}],"doc":{"summary":"Whether tmux ran every operation and all of them succeeded."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/BatchResult.java","line":19,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.BatchResult.succeeded","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.BatchResult.BatchResult.succeeded","product":"core","slug":"io-github-libtmux-batch-batchresult-batchresult-succeeded"},{"id":"io.github.libtmux.batch.BatchResult.BatchResult.failure","name":"failure","kind":"method","modifiers":[],"parent":"io.github.libtmux.batch.BatchResult.BatchResult","signatures":[{"raw":"public Optional failure()","params":[],"returns":"Optional","typeScopeBoundary":false}],"doc":{"summary":"The operation that failed, if one did. Everything after it was discarded by tmux."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/BatchResult.java","line":24,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.BatchResult.failure","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.BatchResult.BatchResult.failure","product":"core","slug":"io-github-libtmux-batch-batchresult-batchresult-failure"},{"id":"io.github.libtmux.batch.BatchResult.BatchResult.toString","name":"toString","kind":"method","modifiers":[],"parent":"io.github.libtmux.batch.BatchResult.BatchResult","signatures":[{"raw":"@Override\n public String toString()","params":[],"returns":"String","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/BatchResult.java","line":30,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.BatchResult.toString","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.BatchResult.BatchResult.toString","product":"core","slug":"io-github-libtmux-batch-batchresult-batchresult-tostring"},{"id":"io.github.libtmux.batch.BatchResult.BatchResult.operations","name":"operations","kind":"method","parent":"io.github.libtmux.batch.BatchResult.BatchResult","modifiers":[],"signatures":[{"params":[],"returns":"List"}],"doc":{"summary":"one result per submitted operation, in submission order"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/BatchResult.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.BatchResult.operations","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.BatchResult.BatchResult.operations","product":"core","slug":"io-github-libtmux-batch-batchresult-batchresult-operations"},{"id":"io.github.libtmux.batch.OperationOutcome.OperationOutcome","name":"OperationOutcome","kind":"enum","modifiers":[],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"What became of one operation in a batch."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/OperationOutcome.java","line":4,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.OperationOutcome","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.OperationOutcome.OperationOutcome","product":"core","slug":"io-github-libtmux-batch-operationoutcome-operationoutcome"},{"id":"io.github.libtmux.batch.OperationOutcome.OperationOutcome.COMPLETE","name":"COMPLETE","kind":"constant","modifiers":[],"parent":"io.github.libtmux.batch.OperationOutcome.OperationOutcome","signatures":[],"typeScopeBoundary":true,"doc":{"summary":"tmux ran it and it succeeded."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/OperationOutcome.java","line":6,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.OperationOutcome.COMPLETE","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.OperationOutcome.OperationOutcome.COMPLETE","product":"core","slug":"io-github-libtmux-batch-operationoutcome-operationoutcome-complete"},{"id":"io.github.libtmux.batch.OperationOutcome.OperationOutcome.FAILED","name":"FAILED","kind":"constant","modifiers":[],"parent":"io.github.libtmux.batch.OperationOutcome.OperationOutcome","signatures":[],"typeScopeBoundary":true,"doc":{"summary":"tmux ran it and it failed. Everything after it was discarded."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/OperationOutcome.java","line":8,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.OperationOutcome.FAILED","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.OperationOutcome.OperationOutcome.FAILED","product":"core","slug":"io-github-libtmux-batch-operationoutcome-operationoutcome-failed"},{"id":"io.github.libtmux.batch.OperationOutcome.OperationOutcome.SKIPPED","name":"SKIPPED","kind":"constant","modifiers":[],"parent":"io.github.libtmux.batch.OperationOutcome.OperationOutcome","signatures":[],"typeScopeBoundary":true,"doc":{"summary":"tmux never reached it, because an earlier operation failed."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/OperationOutcome.java","line":10,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.OperationOutcome.SKIPPED","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.OperationOutcome.OperationOutcome.SKIPPED","product":"core","slug":"io-github-libtmux-batch-operationoutcome-operationoutcome-skipped"},{"id":"io.github.libtmux.batch.OperationOutcome.OperationOutcome.UNKNOWN","name":"UNKNOWN","kind":"constant","modifiers":[],"parent":"io.github.libtmux.batch.OperationOutcome.OperationOutcome","signatures":[],"typeScopeBoundary":true,"doc":{"summary":"Whether tmux applied it cannot be determined."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/OperationOutcome.java","line":12,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.OperationOutcome.UNKNOWN","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.OperationOutcome.OperationOutcome.UNKNOWN","product":"core","slug":"io-github-libtmux-batch-operationoutcome-operationoutcome-unknown"},{"id":"io.github.libtmux.batch.OperationResult.OperationResult","name":"OperationResult","kind":"class","modifiers":[],"signatures":[{"raw":"public record OperationResult(\n @ReadOnly List argv,\n OperationOutcome outcome,\n @ReadOnly List stdout,\n @ReadOnly List stderr)","params":[{"name":"argv","type":"List","doc":"the operation as it was submitted"},{"name":"outcome","type":"OperationOutcome","doc":"what became of it"},{"name":"stdout","type":"List","doc":"the lines this operation produced, separated from its neighbours'"},{"name":"stderr","type":"List","doc":"the error text, which tmux emits without saying which operation produced it, so it is attached to the one that failed"}]}],"typeScopeBoundary":false,"doc":{"summary":"One operation's own result within a batch."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/OperationResult.java","line":15,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.OperationResult","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.OperationResult.OperationResult","product":"core","slug":"io-github-libtmux-batch-operationresult-operationresult"},{"id":"io.github.libtmux.batch.OperationResult.OperationResult.succeeded","name":"succeeded","kind":"method","modifiers":[],"parent":"io.github.libtmux.batch.OperationResult.OperationResult","signatures":[{"raw":"public boolean succeeded()","params":[],"returns":"boolean","typeScopeBoundary":false}],"doc":{"summary":"Whether tmux ran this operation and it succeeded."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/OperationResult.java","line":28,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.OperationResult.succeeded","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.OperationResult.OperationResult.succeeded","product":"core","slug":"io-github-libtmux-batch-operationresult-operationresult-succeeded"},{"id":"io.github.libtmux.batch.OperationResult.OperationResult.toString","name":"toString","kind":"method","modifiers":[],"parent":"io.github.libtmux.batch.OperationResult.OperationResult","signatures":[{"raw":"@Override\n public String toString()","params":[],"returns":"String","typeScopeBoundary":false}],"doc":{"summary":"Counts only: argv and output carry pane content and socket paths."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/OperationResult.java","line":33,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.OperationResult.toString","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.OperationResult.OperationResult.toString","product":"core","slug":"io-github-libtmux-batch-operationresult-operationresult-tostring"},{"id":"io.github.libtmux.batch.OperationResult.OperationResult.argv","name":"argv","kind":"method","parent":"io.github.libtmux.batch.OperationResult.OperationResult","modifiers":[],"signatures":[{"params":[],"returns":"List"}],"doc":{"summary":"the operation as it was submitted"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/OperationResult.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.OperationResult.argv","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.OperationResult.OperationResult.argv","product":"core","slug":"io-github-libtmux-batch-operationresult-operationresult-argv"},{"id":"io.github.libtmux.batch.OperationResult.OperationResult.outcome","name":"outcome","kind":"method","parent":"io.github.libtmux.batch.OperationResult.OperationResult","modifiers":[],"signatures":[{"params":[],"returns":"OperationOutcome"}],"doc":{"summary":"what became of it"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/OperationResult.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.OperationResult.outcome","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.OperationResult.OperationResult.outcome","product":"core","slug":"io-github-libtmux-batch-operationresult-operationresult-outcome"},{"id":"io.github.libtmux.batch.OperationResult.OperationResult.stdout","name":"stdout","kind":"method","parent":"io.github.libtmux.batch.OperationResult.OperationResult","modifiers":[],"signatures":[{"params":[],"returns":"List"}],"doc":{"summary":"the lines this operation produced, separated from its neighbours'"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/OperationResult.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.OperationResult.stdout","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.OperationResult.OperationResult.stdout","product":"core","slug":"io-github-libtmux-batch-operationresult-operationresult-stdout"},{"id":"io.github.libtmux.batch.OperationResult.OperationResult.stderr","name":"stderr","kind":"method","parent":"io.github.libtmux.batch.OperationResult.OperationResult","modifiers":[],"signatures":[{"params":[],"returns":"List"}],"doc":{"summary":"the error text, which tmux emits without saying which operation produced it, so it is attached to the one that failed"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/batch/OperationResult.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.batch.OperationResult.stderr","namespace":"io.github.libtmux.batch","publicId":"io.github.libtmux.batch.OperationResult.OperationResult.stderr","product":"core","slug":"io-github-libtmux-batch-operationresult-operationresult-stderr"},{"id":"io.github.libtmux.BufferInfo.BufferInfo","name":"BufferInfo","kind":"class","modifiers":[],"signatures":[{"raw":"public record BufferInfo(String name, int size)","params":[{"name":"name","type":"String","doc":"the buffer name, which is how every other buffer command addresses it"},{"name":"size","type":"int","doc":"how many bytes it holds"}]}],"typeScopeBoundary":false,"doc":{"summary":"One tmux paste buffer, as a listing described it."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/BufferInfo.java","line":9,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.BufferInfo","namespace":"io.github.libtmux","publicId":"io.github.libtmux.BufferInfo.BufferInfo","product":"core","slug":"io-github-libtmux-bufferinfo-bufferinfo"},{"id":"io.github.libtmux.BufferInfo.BufferInfo.name","name":"name","kind":"method","parent":"io.github.libtmux.BufferInfo.BufferInfo","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"doc":{"summary":"the buffer name, which is how every other buffer command addresses it"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/BufferInfo.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.BufferInfo.name","namespace":"io.github.libtmux","publicId":"io.github.libtmux.BufferInfo.BufferInfo.name","product":"core","slug":"io-github-libtmux-bufferinfo-bufferinfo-name"},{"id":"io.github.libtmux.BufferInfo.BufferInfo.size","name":"size","kind":"method","parent":"io.github.libtmux.BufferInfo.BufferInfo","modifiers":[],"signatures":[{"params":[],"returns":"int"}],"doc":{"summary":"how many bytes it holds"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/BufferInfo.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.BufferInfo.size","namespace":"io.github.libtmux","publicId":"io.github.libtmux.BufferInfo.BufferInfo.size","product":"core","slug":"io-github-libtmux-bufferinfo-bufferinfo-size"},{"id":"io.github.libtmux.Buffers.Buffers","name":"Buffers","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"The tmux server's paste buffers.","body":"Buffers are the server's, not a session's: anything copied in one session can be pasted into\nanother. They are addressed by name rather than by the stack position tmux also accepts, because\na position moves whenever anything else is copied."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Buffers.java","line":23,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Buffers","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Buffers.Buffers","product":"core","slug":"io-github-libtmux-buffers-buffers"},{"id":"io.github.libtmux.Buffers.Buffers.EXACT_NAMED_DELETE","name":"EXACT_NAMED_DELETE","kind":"attribute","modifiers":["static","readonly"],"parent":"io.github.libtmux.Buffers.Buffers","signatures":[],"typeScopeBoundary":true,"type":"TmuxVersion","value":"new TmuxVersion(3, 4, \"\")","doc":{"summary":"tmux's own history dates the fix to {@code 0f6227f4} (\"When deleting or renaming a buffer and a buffer name is specified, complain if the buffer doesn't exist instead of silently deleting or renaming the most recent buffer\", GitHub issue 3205); {@code git tag --contains} places it on {@code 3.4} and nothing earlier, so 3.3 and 3.3a both have the bug. Confirmed on the matrix: {@code set-buffer -b a x; set-buffer -b b y; delete-buffer -b nope} answers {@code unknown buffer: nope} on 3.4 and leaves both buffers, but on 3.3a it exits 0 and takes {@code b}, the one {@code delete-buffer} was never told to touch."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Buffers.java","line":36,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Buffers.EXACT_NAMED_DELETE","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Buffers.Buffers.EXACT_NAMED_DELETE","product":"core","slug":"io-github-libtmux-buffers-buffers-exact_named_delete"},{"id":"io.github.libtmux.Buffers.Buffers.Buffers","name":"Buffers","kind":"method","modifiers":[],"parent":"io.github.libtmux.Buffers.Buffers","signatures":[{"raw":"Buffers(Server server)","params":[{"name":"server","type":"Server"}],"typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/Buffers.java","line":40,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Buffers.Buffers","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Buffers.Buffers.Buffers","product":"core","slug":"io-github-libtmux-buffers-buffers-buffers"},{"id":"io.github.libtmux.Buffers.Buffers.list","name":"list","kind":"method","modifiers":[],"parent":"io.github.libtmux.Buffers.Buffers","signatures":[{"raw":"@ReadOnly\n @Operation(Kind.READ)\n public List list()","params":[],"returns":"List","typeScopeBoundary":false,"returnsDoc":"an immutable list, empty if the live server holds no buffers","raises":[{"type":"LibTmuxException","doc":"if the listing fails, including when no daemon is running"}]}],"doc":{"summary":"Captures every buffer the server holds, in tmux's order."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Buffers.java","line":50,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Buffers.list","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Buffers.Buffers.list","product":"core","slug":"io-github-libtmux-buffers-buffers-list"},{"id":"io.github.libtmux.Buffers.Buffers.set","name":"set","kind":"method","modifiers":[],"parent":"io.github.libtmux.Buffers.Buffers","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public void set(String name, String contents)","params":[{"name":"name","type":"String"},{"name":"contents","type":"String"}],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Puts text in a named buffer, replacing whatever was there.","body":"The contents end the options, because they are the one argument here tmux would otherwise\nread as flags: {@code set(\"clip\", \"-nfoo\")} used to rename the buffer to {@code foo} and write\nnothing, and report success."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Buffers.java","line":69,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Buffers.set","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Buffers.Buffers.set","product":"core","slug":"io-github-libtmux-buffers-buffers-set"},{"id":"io.github.libtmux.Buffers.Buffers.show","name":"show","kind":"method","modifiers":[],"parent":"io.github.libtmux.Buffers.Buffers","signatures":[{"raw":"@Operation(Kind.READ)\n public String show(String name)","params":[{"name":"name","type":"String"}],"returns":"String","typeScopeBoundary":false,"raises":[{"type":"TargetGoneException","doc":"if the server has no buffer by that name"},{"type":"ServerUnavailableException","doc":"if no daemon is running"}]}],"doc":{"summary":"What a buffer holds, without any line breaks it ends with.","body":"tmux prints a buffer as it is, and the transport drops trailing blank lines, so {@code \"a\"}\nand {@code \"a\\n\"} read the same. A marker printed after it cannot keep them: tmux writes a\nbuffer through its file stream, which a second command in the same invocation interrupts.\n{@link #save} writes the exact bytes."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Buffers.java","line":85,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Buffers.show","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Buffers.Buffers.show","product":"core","slug":"io-github-libtmux-buffers-buffers-show"},{"id":"io.github.libtmux.Buffers.Buffers.delete","name":"delete","kind":"method","modifiers":[],"parent":"io.github.libtmux.Buffers.Buffers","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public void delete(String name)","params":[{"name":"name","type":"String"}],"returns":"void","typeScopeBoundary":false,"raises":[{"type":"TargetGoneException","doc":"if the server has no buffer by that name"},{"type":"ServerUnavailableException","doc":"if no daemon is running"},{"type":"UnsupportedFeatureException","doc":"before tmux 3.4, whose named deletion silently removes the top buffer when the name is absent"}]}],"doc":{"summary":"Removes a buffer by its exact name."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Buffers.java","line":105,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Buffers.delete","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Buffers.Buffers.delete","product":"core","slug":"io-github-libtmux-buffers-buffers-delete"},{"id":"io.github.libtmux.Buffers.Buffers.save","name":"save","kind":"method","modifiers":[],"parent":"io.github.libtmux.Buffers.Buffers","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public void save(String name, Path file)","params":[{"name":"name","type":"String"},{"name":"file","type":"Path"}],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Writes a buffer's contents to a file."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Buffers.java","line":121,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Buffers.save","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Buffers.Buffers.save","product":"core","slug":"io-github-libtmux-buffers-buffers-save"},{"id":"io.github.libtmux.Buffers.Buffers.load","name":"load","kind":"method","modifiers":[],"parent":"io.github.libtmux.Buffers.Buffers","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public void load(String name, Path file)","params":[{"name":"name","type":"String"},{"name":"file","type":"Path"}],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Reads a file into a named buffer."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Buffers.java","line":127,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Buffers.load","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Buffers.Buffers.load","product":"core","slug":"io-github-libtmux-buffers-buffers-load"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec","name":"CaptureSpec","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"What part of a pane to read, and how.","body":"The shape {@link SplitSpec} uses. A plain {@link Pane#capture()} reads what is on screen; this\nis how to reach the scrollback above it, or to keep what tmux otherwise strips.\n\nLines are numbered from the top of the visible area, so {@code 0} is the first row on screen\nand negatives climb into the history. {@code fromStartOfHistory()} is the whole of what tmux\nkept.","examples":[{"lang":"java","code":"List everything = pane.capture(c -> c.fromStartOfHistory());\nList lastTen = pane.capture(c -> c.from(-10));"}]},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":23,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec","product":"core","slug":"io-github-libtmux-capturespec-capturespec"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.builder","name":"builder","kind":"method","modifiers":["static"],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec","signatures":[{"raw":"public static Builder builder()","params":[],"returns":"Builder","typeScopeBoundary":true}],"doc":{"summary":"A builder that reads what is on screen and nothing else."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":69,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.builder","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.builder","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-17ql"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.argv","name":"argv","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec","signatures":[{"raw":"List argv(String target, TmuxVersion running)","params":[{"name":"target","type":"String"},{"name":"running","type":"TmuxVersion"}],"returns":"List","typeScopeBoundary":false,"raises":[{"type":"UnsupportedFeatureException","doc":"if the spec asks for something {@code running} does not have"}]}],"doc":{"summary":"The command that reads the pane."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":78,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.argv","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.argv","product":"core","slug":"io-github-libtmux-capturespec-capturespec-argv"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","name":"Builder","kind":"class","modifiers":["static","readonly"],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec","signatures":[],"typeScopeBoundary":true,"doc":{"summary":"Collects the choices, each named for what it does rather than for the flag it sets."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":123,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-v00t"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.from","name":"from","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder from(int line)","params":[{"name":"line","type":"int","doc":"{@code 0} is the first row on screen; negatives climb into the scrollback"}],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Starts at a line, counted from the top of the visible area."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":145,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.from","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.from","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-from"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.fromStartOfHistory","name":"fromStartOfHistory","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder fromStartOfHistory()","params":[],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Starts at the oldest line tmux still has."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":151,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.fromStartOfHistory","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.fromStartOfHistory","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-fromstartofhistory"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.to","name":"to","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder to(int line)","params":[{"name":"line","type":"int"}],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Ends at a line, counted the same way as {@link #from}."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":157,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.to","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.to","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-to"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.toEndOfHistory","name":"toEndOfHistory","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder toEndOfHistory()","params":[],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Ends at the newest line, including anything below the visible area."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":163,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.toEndOfHistory","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.toEndOfHistory","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-toendofhistory"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.withEscapeSequences","name":"withEscapeSequences","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder withEscapeSequences()","params":[],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Keeps the escape sequences that colour and position the text."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":169,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.withEscapeSequences","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.withEscapeSequences","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-withescapesequences"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.escapingNonPrintable","name":"escapingNonPrintable","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder escapingNonPrintable()","params":[],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Writes anything unprintable as an octal escape rather than dropping it."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":175,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.escapingNonPrintable","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.escapingNonPrintable","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-escapingnonprintable"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.joiningWrappedLines","name":"joiningWrappedLines","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder joiningWrappedLines()","params":[],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Joins a line tmux wrapped back into the one line it was."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":181,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.joiningWrappedLines","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.joiningWrappedLines","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-joiningwrappedlines"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.preservingTrailingSpace","name":"preservingTrailingSpace","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder preservingTrailingSpace()","params":[],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Keeps the spaces at the end of a line, which tmux otherwise drops."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":187,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.preservingTrailingSpace","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.preservingTrailingSpace","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-preservingtrailingspace"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.trimmingTrailingSpace","name":"trimmingTrailingSpace","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder trimmingTrailingSpace()","params":[],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Drops trailing space and the empty lines below the content. Requires tmux 3.4."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":193,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.trimmingTrailingSpace","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.trimmingTrailingSpace","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-trimmingtrailingspace"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.fromAlternateScreen","name":"fromAlternateScreen","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder fromAlternateScreen()","params":[],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Reads the alternate screen, which is what a full-screen program draws on."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":199,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.fromAlternateScreen","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.fromAlternateScreen","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-fromalternatescreen"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.pendingOnly","name":"pendingOnly","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder pendingOnly()","params":[],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Reads only output tmux has not drawn yet."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":205,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.pendingOnly","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.pendingOnly","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-pendingonly"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.fromModeScreen","name":"fromModeScreen","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder fromModeScreen()","params":[],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Reads what a mode is showing rather than the pane beneath it. Requires tmux 3.6."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":211,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.fromModeScreen","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.fromModeScreen","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-frommodescreen"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.withHyperlinks","name":"withHyperlinks","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder withHyperlinks()","params":[],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Keeps hyperlink markers. Requires tmux 3.7."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":217,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.withHyperlinks","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.withHyperlinks","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-withhyperlinks"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.withLineNumbers","name":"withLineNumbers","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public Builder withLineNumbers()","params":[],"returns":"Builder","typeScopeBoundary":false}],"doc":{"summary":"Prefixes each line with its number. Requires tmux 3.7."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":223,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.withLineNumbers","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.withLineNumbers","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-withlinenumbers"},{"id":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.build","name":"build","kind":"method","modifiers":[],"parent":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder","signatures":[{"raw":"public CaptureSpec build()","params":[],"returns":"CaptureSpec","typeScopeBoundary":false}],"doc":{"summary":"The finished spec."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CaptureSpec.java","line":229,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CaptureSpec.Builder.build","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CaptureSpec.CaptureSpec.Builder.build","product":"core","slug":"io-github-libtmux-capturespec-capturespec-builder-build"},{"id":"io.github.libtmux.catalog.Advanced.Advanced","name":"Advanced","kind":"interface","modifiers":["annotation"],"signatures":[{"raw":"@Documented\n@Retention(RUNTIME)\n@Target({TYPE, METHOD})\npublic @interface Advanced","params":[]}],"typeScopeBoundary":false,"doc":{"summary":"Public for orchestration across processes or clients, such as the MCP server's pane reservations; not part of the surface a language facade mirrors."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/catalog/Advanced.java","line":15,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.catalog.Advanced","namespace":"io.github.libtmux.catalog","publicId":"io.github.libtmux.catalog.Advanced.Advanced","product":"core","slug":"io-github-libtmux-catalog-advanced-advanced"},{"id":"io.github.libtmux.catalog.Kind.Kind","name":"Kind","kind":"enum","modifiers":[],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"What shape a facade needs to give one operation of the core API.","body":"A Kotlin or Scala wrapper, or a generated reference page, reads this off {@link Operation}\nrather than guessing from a method's name or return type."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/catalog/Kind.java","line":9,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.catalog.Kind","namespace":"io.github.libtmux.catalog","publicId":"io.github.libtmux.catalog.Kind.Kind","product":"core","slug":"io-github-libtmux-catalog-kind-kind"},{"id":"io.github.libtmux.catalog.Kind.Kind.CAPTURED","name":"CAPTURED","kind":"constant","modifiers":[],"parent":"io.github.libtmux.catalog.Kind.Kind","signatures":[],"typeScopeBoundary":true,"doc":{"summary":"No tmux I/O: answers from the handle's own capture, or collects a command to send later. Field accessors, navigation within one capture, and building a batch or chain."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/catalog/Kind.java","line":15,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.catalog.Kind.CAPTURED","namespace":"io.github.libtmux.catalog","publicId":"io.github.libtmux.catalog.Kind.Kind.CAPTURED","product":"core","slug":"io-github-libtmux-catalog-kind-kind-captured"},{"id":"io.github.libtmux.catalog.Kind.Kind.READ","name":"READ","kind":"constant","modifiers":[],"parent":"io.github.libtmux.catalog.Kind.Kind","signatures":[],"typeScopeBoundary":true,"doc":{"summary":"Contacts tmux and changes nothing: listings, captures, {@code show-*}, expansion, liveness, lookups."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/catalog/Kind.java","line":18,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.catalog.Kind.READ","namespace":"io.github.libtmux.catalog","publicId":"io.github.libtmux.catalog.Kind.Kind.READ","product":"core","slug":"io-github-libtmux-catalog-kind-kind-read"},{"id":"io.github.libtmux.catalog.Kind.Kind.MUTATION","name":"MUTATION","kind":"constant","modifiers":[],"parent":"io.github.libtmux.catalog.Kind.Kind","signatures":[],"typeScopeBoundary":true,"doc":{"summary":"Changes tmux state: sending keys, renaming, killing, splitting, setting options, pasting, resizing."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/catalog/Kind.java","line":21,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.catalog.Kind.MUTATION","namespace":"io.github.libtmux.catalog","publicId":"io.github.libtmux.catalog.Kind.Kind.MUTATION","product":"core","slug":"io-github-libtmux-catalog-kind-kind-mutation"},{"id":"io.github.libtmux.catalog.Kind.Kind.WAIT","name":"WAIT","kind":"constant","modifiers":[],"parent":"io.github.libtmux.catalog.Kind.Kind","signatures":[],"typeScopeBoundary":true,"doc":{"summary":"Blocks until something else happens; the waiting itself changes nothing."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/catalog/Kind.java","line":24,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.catalog.Kind.WAIT","namespace":"io.github.libtmux.catalog","publicId":"io.github.libtmux.catalog.Kind.Kind.WAIT","product":"core","slug":"io-github-libtmux-catalog-kind-kind-wait"},{"id":"io.github.libtmux.catalog.Kind.Kind.STREAM","name":"STREAM","kind":"constant","modifiers":[],"parent":"io.github.libtmux.catalog.Kind.Kind","signatures":[],"typeScopeBoundary":true,"doc":{"summary":"Returns a subscription, stream, or publisher of events."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/catalog/Kind.java","line":27,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.catalog.Kind.STREAM","namespace":"io.github.libtmux.catalog","publicId":"io.github.libtmux.catalog.Kind.Kind.STREAM","product":"core","slug":"io-github-libtmux-catalog-kind-kind-stream"},{"id":"io.github.libtmux.catalog.Kind.Kind.LIFECYCLE","name":"LIFECYCLE","kind":"constant","modifiers":[],"parent":"io.github.libtmux.catalog.Kind.Kind","signatures":[],"typeScopeBoundary":true,"doc":{"summary":"Opens, attaches, derives, or closes a resource."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/catalog/Kind.java","line":30,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.catalog.Kind.LIFECYCLE","namespace":"io.github.libtmux.catalog","publicId":"io.github.libtmux.catalog.Kind.Kind.LIFECYCLE","product":"core","slug":"io-github-libtmux-catalog-kind-kind-lifecycle"},{"id":"io.github.libtmux.catalog.Operation.Operation","name":"Operation","kind":"interface","modifiers":["annotation"],"signatures":[{"raw":"@Documented\n@Retention(RUNTIME)\n@Target(METHOD)\npublic @interface Operation","params":[]}],"typeScopeBoundary":false,"doc":{"summary":"Classifies one public method of the core API as a tmux operation of a given {@link Kind}.","body":"Every public method that performs or describes a tmux operation carries this, so a facade\nnever has to infer the shape of a call from its name or signature."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/catalog/Operation.java","line":16,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.catalog.Operation","namespace":"io.github.libtmux.catalog","publicId":"io.github.libtmux.catalog.Operation.Operation","product":"core","slug":"io-github-libtmux-catalog-operation-operation"},{"id":"io.github.libtmux.catalog.Operation.Operation.value","name":"value","kind":"method","modifiers":["annotation"],"parent":"io.github.libtmux.catalog.Operation.Operation","signatures":[{"raw":"Kind value();","params":[],"returns":"Kind","typeScopeBoundary":false}],"doc":{"summary":"What shape this operation gives a facade."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/catalog/Operation.java","line":22,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.catalog.Operation.value","namespace":"io.github.libtmux.catalog","publicId":"io.github.libtmux.catalog.Operation.Operation.value","product":"core","slug":"io-github-libtmux-catalog-operation-operation-value"},{"id":"io.github.libtmux.catalog.Operation.Operation.tmuxSince","name":"tmuxSince","kind":"method","modifiers":["annotation"],"parent":"io.github.libtmux.catalog.Operation.Operation","signatures":[{"raw":"String tmuxSince() default \"\";","params":[],"returns":"String","typeScopeBoundary":false}],"value":"\"\"","doc":{"summary":"The first tmux release that has this operation, when it is newer than the supported floor, 3.2a. Empty when the whole supported range has it."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/catalog/Operation.java","line":28,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.catalog.Operation.tmuxSince","namespace":"io.github.libtmux.catalog","publicId":"io.github.libtmux.catalog.Operation.Operation.tmuxSince","product":"core","slug":"io-github-libtmux-catalog-operation-operation-tmuxsince"},{"id":"io.github.libtmux.Channel.Channel","name":"Channel","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"One of tmux's wait-for channels, named once.","body":"A channel is server-wide and shared by everything on it, including programs running in panes.\nNothing creates or destroys one: a name either has a signal remembered against it or does not.\n\ntmux's own {@code wait-for} has two traps, and this exists to close both. It exits successfully\nwhen the server dies under the waiter, which is indistinguishable from a real signal, so the\nserver is checked afterwards rather than believed. And a signal sent when nobody is waiting is\nremembered, satisfying the next wait whenever that happens — possibly in a later run of a\ndifferent program — so {@link #drain()} is how a caller starts from a known state on a channel\nwhose history is not its own."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Channel.java","line":21,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Channel","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Channel.Channel","product":"core","slug":"io-github-libtmux-channel-channel"},{"id":"io.github.libtmux.Channel.Channel.Channel","name":"Channel","kind":"method","modifiers":[],"parent":"io.github.libtmux.Channel.Channel","signatures":[{"raw":"Channel(Server server, String name)","params":[{"name":"server","type":"Server"},{"name":"name","type":"String"}],"typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/Channel.java","line":29,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Channel.Channel","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Channel.Channel.Channel","product":"core","slug":"io-github-libtmux-channel-channel-channel"},{"id":"io.github.libtmux.Channel.Channel.name","name":"name","kind":"method","modifiers":[],"parent":"io.github.libtmux.Channel.Channel","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public String name()","params":[],"returns":"String","typeScopeBoundary":false}],"doc":{"summary":"The name this channel is known by on its server."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Channel.java","line":35,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Channel.name","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Channel.Channel.name","product":"core","slug":"io-github-libtmux-channel-channel-name"},{"id":"io.github.libtmux.Channel.Channel.signal","name":"signal","kind":"method","modifiers":[],"parent":"io.github.libtmux.Channel.Channel","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public void signal()","params":[],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Signals the channel, waking one waiter, or being remembered until something waits.","body":"{@code -S} takes no argument of its own — it says which of wait-for's three modes this is —\nso the name that follows is a positional and needs the options ended before it, exactly as\nthe wait does."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Channel.java","line":47,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Channel.signal","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Channel.Channel.signal","product":"core","slug":"io-github-libtmux-channel-channel-signal"},{"id":"io.github.libtmux.Channel.Channel.await","name":"await","kind":"method","modifiers":[],"parent":"io.github.libtmux.Channel.Channel","signatures":[{"raw":"@Operation(Kind.WAIT)\n public WakeReason await(Duration timeout) throws InterruptedException","params":[{"name":"timeout","type":"Duration","doc":"how long to wait"}],"returns":"WakeReason","typeScopeBoundary":false,"returnsDoc":"why the wait ended, which is never simply \"successfully\"","raises":[{"type":"InterruptedException","doc":"if the waiting thread is interrupted, which is a cancellation rather than a timeout and so is not reported as one"}]}],"doc":{"summary":"Waits for something to signal the channel."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Channel.java","line":60,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Channel.await","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Channel.Channel.await","product":"core","slug":"io-github-libtmux-channel-channel-await"},{"id":"io.github.libtmux.Channel.Channel.awaitReservingCapacity","name":"awaitReservingCapacity","kind":"method","modifiers":[],"parent":"io.github.libtmux.Channel.Channel","signatures":[{"raw":"@Operation(Kind.WAIT)\n public WakeReason awaitReservingCapacity(Duration timeout) throws InterruptedException","params":[{"name":"timeout","type":"Duration"}],"returns":"WakeReason","typeScopeBoundary":false,"raises":[{"type":"io.github.libtmux.exception.DispatchException","doc":"if the wait could not be dispatched"},{"type":"InterruptedException","doc":"if the waiting thread is interrupted, which is a cancellation rather than a timeout and so is not reported as one"}]}],"doc":{"summary":"Waits while preserving process capacity for a call through this server that signals it.","body":"Use this when the waiter and its release share a bounded transport. A wait released outside\nthat transport should use {@link #await}; reserving capacity for it only rejects useful\nconcurrency."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Channel.java","line":76,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Channel.awaitReservingCapacity","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Channel.Channel.awaitReservingCapacity","product":"core","slug":"io-github-libtmux-channel-channel-awaitreservingcapacity"},{"id":"io.github.libtmux.Channel.Channel.drain","name":"drain","kind":"method","modifiers":[],"parent":"io.github.libtmux.Channel.Channel","signatures":[{"raw":"@Operation(Kind.WAIT)\n public boolean drain() throws InterruptedException","params":[],"returns":"boolean","typeScopeBoundary":false,"returnsDoc":"whether a signal was there to consume","raises":[{"type":"InterruptedException","doc":"if the waiting thread is interrupted"}]}],"doc":{"summary":"Consumes a signal already waiting, so a stale one cannot satisfy a later wait."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Channel.java","line":87,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Channel.drain","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Channel.Channel.drain","product":"core","slug":"io-github-libtmux-channel-channel-drain"},{"id":"io.github.libtmux.Channel.Channel.toString","name":"toString","kind":"method","modifiers":[],"parent":"io.github.libtmux.Channel.Channel","signatures":[{"raw":"@Override\n public String toString()","params":[],"returns":"String","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/Channel.java","line":92,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Channel.toString","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Channel.Channel.toString","product":"core","slug":"io-github-libtmux-channel-channel-tostring"},{"id":"io.github.libtmux.Client.Client","name":"Client","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"One attached tmux client, as one capture saw it.","body":"Identity is the server and the client name, which is how tmux addresses it. What it is\nattached to is state: a client can switch sessions without becoming a different client.\n\n{@link #name()}, {@link #session()}, and {@link #attachment()} return what the capture holds\nand do no I/O; {@link #refresh()} reads again. Every other method asks tmux now."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":23,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client","product":"core","slug":"io-github-libtmux-client-client"},{"id":"io.github.libtmux.Client.Client.Client","name":"Client","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"Client(Server server, ServerSnapshot snapshot, ClientState state)","params":[{"name":"server","type":"Server"},{"name":"snapshot","type":"ServerSnapshot"},{"name":"state","type":"ClientState"}],"typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":29,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.Client","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.Client","product":"core","slug":"io-github-libtmux-client-client-client"},{"id":"io.github.libtmux.Client.Client.name","name":"name","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public String name()","params":[],"returns":"String","typeScopeBoundary":false}],"doc":{"summary":"The client's terminal name, which is how tmux addresses it."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":36,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.name","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.name","product":"core","slug":"io-github-libtmux-client-client-name"},{"id":"io.github.libtmux.Client.Client.detach","name":"detach","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public void detach()","params":[],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Detaches this client, leaving whatever it was attached to running.","body":"Detaching is not killing: the session outlives the client, which is the reason tmux exists."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":46,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.detach","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.detach","product":"core","slug":"io-github-libtmux-client-client-detach"},{"id":"io.github.libtmux.Client.Client.detachOthers","name":"detachOthers","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public void detachOthers()","params":[],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Detaches every other client, leaving this one attached."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":52,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.detachOthers","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.detachOthers","product":"core","slug":"io-github-libtmux-client-client-detachothers"},{"id":"io.github.libtmux.Client.Client.switchTo","name":"switchTo","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public void switchTo(Session session)","params":[{"name":"session","type":"Session"}],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Moves this client to another session.","body":"The client keeps its identity: switching is a change of what it is looking at, not a\ndetach and a fresh attach."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":63,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.switchTo","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.switchTo","product":"core","slug":"io-github-libtmux-client-client-switchto"},{"id":"io.github.libtmux.Client.Client.redraw","name":"redraw","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public void redraw()","params":[],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Asks tmux to redraw this client.","body":"Not {@link #refresh()}, which takes a new capture of what tmux knows. This one is tmux's\n{@code refresh-client}, and it changes the terminal rather than this handle."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":78,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.redraw","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.redraw","product":"core","slug":"io-github-libtmux-client-client-redraw"},{"id":"io.github.libtmux.Client.Client.server","name":"server","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public Server server()","params":[],"returns":"Server","typeScopeBoundary":false}],"doc":{"summary":"The server this client is connected to."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":84,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.server","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.server","product":"core","slug":"io-github-libtmux-client-client-server"},{"id":"io.github.libtmux.Client.Client.snapshot","name":"snapshot","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"ServerSnapshot snapshot()","params":[],"returns":"ServerSnapshot","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":89,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.snapshot","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.snapshot","product":"core","slug":"io-github-libtmux-client-client-snapshot"},{"id":"io.github.libtmux.Client.Client.session","name":"session","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public Optional session()","params":[],"returns":"Optional","typeScopeBoundary":false}],"doc":{"summary":"The session this client was attached to when captured. A pure read of the capture."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":94,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.session","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.session","product":"core","slug":"io-github-libtmux-client-client-session"},{"id":"io.github.libtmux.Client.Client.attachment","name":"attachment","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public Optional attachment()","params":[],"returns":"Optional","typeScopeBoundary":false}],"doc":{"summary":"What this client was looking at when captured. A pure read: it issues no command.","body":"Empty when the capture shows the client attached to nothing, or shows a session whose\nactive window or pane the capture did not include."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":105,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.attachment","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.attachment","product":"core","slug":"io-github-libtmux-client-client-attachment"},{"id":"io.github.libtmux.Client.Client.fetchAttachment","name":"fetchAttachment","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"@Operation(Kind.READ)\n public Optional fetchAttachment()","params":[],"returns":"Optional","typeScopeBoundary":false,"raises":[{"type":"TargetGoneException","doc":"if this client has detached"}]}],"doc":{"summary":"Takes a new capture and returns what this client is looking at now.","body":"Named to say it dispatches, unlike {@link #attachment()}. Every call is one live capture."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":120,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.fetchAttachment","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.fetchAttachment","product":"core","slug":"io-github-libtmux-client-client-fetchattachment"},{"id":"io.github.libtmux.Client.Client.refresh","name":"refresh","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"@CheckReturnValue\n @Operation(Kind.READ)\n public Client refresh()","params":[],"returns":"Client","typeScopeBoundary":false,"raises":[{"type":"TargetGoneException","doc":"if this client has detached, or a different daemon answers on the endpoint"},{"type":"ServerUnavailableException","doc":"if no daemon is running"}]}],"doc":{"summary":"Takes a new capture and returns this client as it is now.","body":"This handle remains unchanged, as every handle's does."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":134,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.refresh","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.refresh","product":"core","slug":"io-github-libtmux-client-client-refresh"},{"id":"io.github.libtmux.Client.Client.equals","name":"equals","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"@Override\n public boolean equals(Object other)","params":[{"name":"other","type":"Object"}],"returns":"boolean","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":145,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.equals","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.equals","product":"core","slug":"io-github-libtmux-client-client-equals"},{"id":"io.github.libtmux.Client.Client.hashCode","name":"hashCode","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"@Override\n public int hashCode()","params":[],"returns":"int","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":152,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.hashCode","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.hashCode","product":"core","slug":"io-github-libtmux-client-client-hashcode"},{"id":"io.github.libtmux.Client.Client.toString","name":"toString","kind":"method","modifiers":[],"parent":"io.github.libtmux.Client.Client","signatures":[{"raw":"@Override\n public String toString()","params":[],"returns":"String","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/Client.java","line":157,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Client.toString","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Client.Client.toString","product":"core","slug":"io-github-libtmux-client-client-tostring"},{"id":"io.github.libtmux.ClientAttachment.ClientAttachment","name":"ClientAttachment","kind":"class","modifiers":[],"signatures":[{"raw":"public record ClientAttachment(Session session, Window activeWindow, Pane activePane)","params":[{"name":"session","type":"Session","doc":"the session the client is attached to"},{"name":"activeWindow","type":"Window","doc":"that session's active window"},{"name":"activePane","type":"Pane","doc":"that window's active pane, which is what the client's keystrokes reach"}]}],"typeScopeBoundary":false,"doc":{"summary":"What a client was looking at.","body":"All three are present together or not at all. A client attached to a session is looking at\nexactly one window of it and one pane of that window; an attachment holding only some of those\nwould describe a state tmux does not have."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/ClientAttachment.java","line":14,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.ClientAttachment","namespace":"io.github.libtmux","publicId":"io.github.libtmux.ClientAttachment.ClientAttachment","product":"core","slug":"io-github-libtmux-clientattachment-clientattachment"},{"id":"io.github.libtmux.ClientAttachment.ClientAttachment.session","name":"session","kind":"method","parent":"io.github.libtmux.ClientAttachment.ClientAttachment","modifiers":[],"signatures":[{"params":[],"returns":"Session"}],"doc":{"summary":"the session the client is attached to"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/ClientAttachment.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.ClientAttachment.session","namespace":"io.github.libtmux","publicId":"io.github.libtmux.ClientAttachment.ClientAttachment.session","product":"core","slug":"io-github-libtmux-clientattachment-clientattachment-session"},{"id":"io.github.libtmux.ClientAttachment.ClientAttachment.activeWindow","name":"activeWindow","kind":"method","parent":"io.github.libtmux.ClientAttachment.ClientAttachment","modifiers":[],"signatures":[{"params":[],"returns":"Window"}],"doc":{"summary":"that session's active window"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/ClientAttachment.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.ClientAttachment.activeWindow","namespace":"io.github.libtmux","publicId":"io.github.libtmux.ClientAttachment.ClientAttachment.activeWindow","product":"core","slug":"io-github-libtmux-clientattachment-clientattachment-activewindow"},{"id":"io.github.libtmux.ClientAttachment.ClientAttachment.activePane","name":"activePane","kind":"method","parent":"io.github.libtmux.ClientAttachment.ClientAttachment","modifiers":[],"signatures":[{"params":[],"returns":"Pane"}],"doc":{"summary":"that window's active pane, which is what the client's keystrokes reach"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/ClientAttachment.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.ClientAttachment.activePane","namespace":"io.github.libtmux","publicId":"io.github.libtmux.ClientAttachment.ClientAttachment.activePane","product":"core","slug":"io-github-libtmux-clientattachment-clientattachment-activepane"},{"id":"io.github.libtmux.CommandChain.CommandChain","name":"CommandChain","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"A sequence of tmux commands where each one acts on what the last one made.","body":"tmux moves its own current target as a group runs: a {@code new-window} makes the new window\ncurrent, a following {@code split-window} splits that window, and a following {@code send-keys}\ntypes into the pane that split produced. None of these steps names a target, and that is the\npoint — the alternative is a round trip per step to learn the id of the thing just created.\n\nThe whole chain is one tmux invocation, and every step is attributed individually, so a chain\nthat fails halfway says which step failed and which never ran."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CommandChain.java","line":23,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CommandChain","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CommandChain.CommandChain","product":"core","slug":"io-github-libtmux-commandchain-commandchain"},{"id":"io.github.libtmux.CommandChain.CommandChain.CommandChain","name":"CommandChain","kind":"method","modifiers":[],"parent":"io.github.libtmux.CommandChain.CommandChain","signatures":[{"raw":"CommandChain(Batch batch, Supplier running)","params":[{"name":"batch","type":"Batch"},{"name":"running","type":"Supplier"}],"typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/CommandChain.java","line":28,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CommandChain.CommandChain","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CommandChain.CommandChain.CommandChain","product":"core","slug":"io-github-libtmux-commandchain-commandchain-commandchain"},{"id":"io.github.libtmux.CommandChain.CommandChain.newWindow","name":"newWindow","kind":"method","modifiers":[],"parent":"io.github.libtmux.CommandChain.CommandChain","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public CommandChain newWindow(String name)","params":[{"name":"name","type":"String"}],"returns":"CommandChain","typeScopeBoundary":false}],"doc":{"summary":"Creates a window and makes it the one following steps act on."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CommandChain.java","line":34,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CommandChain.newWindow","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CommandChain.CommandChain.newWindow","product":"core","slug":"io-github-libtmux-commandchain-commandchain-newwindow"},{"id":"io.github.libtmux.CommandChain.CommandChain.renameWindow","name":"renameWindow","kind":"method","modifiers":[],"parent":"io.github.libtmux.CommandChain.CommandChain","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public CommandChain renameWindow(String name)","params":[{"name":"name","type":"String"}],"returns":"CommandChain","typeScopeBoundary":false}],"doc":{"summary":"Renames the current window."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CommandChain.java","line":40,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CommandChain.renameWindow","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CommandChain.CommandChain.renameWindow","product":"core","slug":"io-github-libtmux-commandchain-commandchain-renamewindow"},{"id":"io.github.libtmux.CommandChain.CommandChain.splitLeftRight","name":"splitLeftRight","kind":"method","modifiers":[],"parent":"io.github.libtmux.CommandChain.CommandChain","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public CommandChain splitLeftRight()","params":[],"returns":"CommandChain","typeScopeBoundary":false}],"doc":{"summary":"Splits the current pane into a left and a right one.","body":"Named for what it produces rather than for tmux's {@code -h}, which reads as though it\ndescribed the divider."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CommandChain.java","line":51,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CommandChain.splitLeftRight","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CommandChain.CommandChain.splitLeftRight","product":"core","slug":"io-github-libtmux-commandchain-commandchain-splitleftright"},{"id":"io.github.libtmux.CommandChain.CommandChain.splitTopBottom","name":"splitTopBottom","kind":"method","modifiers":[],"parent":"io.github.libtmux.CommandChain.CommandChain","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public CommandChain splitTopBottom()","params":[],"returns":"CommandChain","typeScopeBoundary":false}],"doc":{"summary":"Splits the current pane into a top and a bottom one."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CommandChain.java","line":57,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CommandChain.splitTopBottom","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CommandChain.CommandChain.splitTopBottom","product":"core","slug":"io-github-libtmux-commandchain-commandchain-splittopbottom"},{"id":"io.github.libtmux.CommandChain.CommandChain.sendLine","name":"sendLine","kind":"method","modifiers":[],"parent":"io.github.libtmux.CommandChain.CommandChain","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public CommandChain sendLine(String command)","params":[{"name":"command","type":"String"}],"returns":"CommandChain","typeScopeBoundary":false}],"doc":{"summary":"Types a line into the current pane and presses Enter, which is how a command gets run."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CommandChain.java","line":63,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CommandChain.sendLine","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CommandChain.CommandChain.sendLine","product":"core","slug":"io-github-libtmux-commandchain-commandchain-sendline"},{"id":"io.github.libtmux.CommandChain.CommandChain.arrange","name":"arrange","kind":"method","modifiers":[],"parent":"io.github.libtmux.CommandChain.CommandChain","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public CommandChain arrange(String layout)","params":[{"name":"layout","type":"String"}],"returns":"CommandChain","typeScopeBoundary":false,"raises":[{"type":"IllegalArgumentException","doc":"if tmux would not recognise the layout, which on some versions ends the whole server rather than the command"},{"type":"UnsupportedFeatureException","doc":"if the layout name arrived after this release, which tmux cannot tell from any other name it does not know"}]}],"doc":{"summary":"Arranges the current window."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CommandChain.java","line":76,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CommandChain.arrange","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CommandChain.CommandChain.arrange","product":"core","slug":"io-github-libtmux-commandchain-commandchain-arrange"},{"id":"io.github.libtmux.CommandChain.CommandChain.then","name":"then","kind":"method","modifiers":["overload"],"parent":"io.github.libtmux.CommandChain.CommandChain","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public CommandChain then(String... argv)","params":[{"name":"argv","type":"String","variadic":"positional"}],"returns":"CommandChain","typeScopeBoundary":false},{"raw":"@Operation(Kind.CAPTURED)\n public CommandChain then(List argv)","params":[{"name":"argv","type":"List"}],"returns":"CommandChain","typeScopeBoundary":false}],"doc":{"summary":"Adds any tmux command, for whatever this class does not name."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CommandChain.java","line":82,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CommandChain.then","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CommandChain.CommandChain.then","product":"core","slug":"io-github-libtmux-commandchain-commandchain-then"},{"id":"io.github.libtmux.CommandChain.CommandChain.run","name":"run","kind":"method","modifiers":[],"parent":"io.github.libtmux.CommandChain.CommandChain","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public BatchResult run()","params":[],"returns":"BatchResult","typeScopeBoundary":false}],"doc":{"summary":"Runs the whole chain in one tmux invocation, attributing each step."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/CommandChain.java","line":96,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.CommandChain.run","namespace":"io.github.libtmux","publicId":"io.github.libtmux.CommandChain.CommandChain.run","product":"core","slug":"io-github-libtmux-commandchain-commandchain-run"},{"id":"io.github.libtmux.Commands.Commands","name":"Commands","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"The commands this tmux knows, read without starting a server to answer."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Commands.java","line":9,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Commands","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Commands.Commands","product":"core","slug":"io-github-libtmux-commands-commands"},{"id":"io.github.libtmux.Commands.Commands.Commands","name":"Commands","kind":"method","modifiers":[],"parent":"io.github.libtmux.Commands.Commands","signatures":[{"raw":"Commands(Server server)","params":[{"name":"server","type":"Server"}],"typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/Commands.java","line":13,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Commands.Commands","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Commands.Commands.Commands","product":"core","slug":"io-github-libtmux-commands-commands-commands"},{"id":"io.github.libtmux.Commands.Commands.list","name":"list","kind":"method","modifiers":[],"parent":"io.github.libtmux.Commands.Commands","signatures":[{"raw":"@ReadOnly\n @Operation(Kind.READ)\n public List list()","params":[],"returns":"List","typeScopeBoundary":false}],"doc":{"summary":"Every command, as tmux prints it."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Commands.java","line":18,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Commands.list","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Commands.Commands.list","product":"core","slug":"io-github-libtmux-commands-commands-list"},{"id":"io.github.libtmux.control.ControlClient.ControlClient","name":"ControlClient","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"A tmux client that stays attached and answers one command at a time.","body":"This is what a semicolon group cannot be. tmux discards a group after its first failure, so a\nclient has to infer which command failed; here each request is independent, so a failure\ndiscards nothing behind it.\n\nReplies arrive in request order, so the writer sends one request at a time and matches its\nreply by position. A reply is the first block tmux writes for the request: an acknowledgement,\nwhich work the command deferred may outlive. What that command queued, as {@code if-shell}\nqueues its branch, and what a hook ran, arrive as blocks of their own, and none of them is taken\nfor the next request's reply. A deadline before the writer picks a request writes nothing; a\ndeadline after that point ends the client because the next reply could no longer be attributed\nsafely.\n\nThe reader and writer are platform threads. A library does not own the virtual-thread\nscheduler: a caller's CPU-bound task that never blocks keeps its carrier, and either thread\nunable to run stops the client from making progress. The reader only\nresolves replies and fills bounded subscription buffers; subscriber code runs on the thread that\npulls a value.\n\n**Threads.** {@link #send} may be called from several threads at once: requests\nqueue in the order they arrive and each caller gets its own reply. A subscription is read by one\nthread at a time.\n\n**Close it.** The client holds an attached tmux client, which is what makes tmux\npush output to it, and closing is what detaches that client and stops its threads. A client that\nis forgotten does not hold the JVM open — its threads are daemons — and the attached tmux client\nexits once the JVM does, because it reads its commands from a pipe that closes with it. Until then\nit is listed among the session's clients like any other."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":69,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient"},{"id":"io.github.libtmux.control.ControlClient.ControlClient.attachUnfenced","name":"attachUnfenced","kind":"method","modifiers":["static","overload"],"parent":"io.github.libtmux.control.ControlClient.ControlClient","signatures":[{"raw":"@Operation(Kind.LIFECYCLE)\n public static ControlClient attachUnfenced(ServerConfig config, SessionId session)","params":[{"name":"config","type":"ServerConfig","doc":"which tmux and which server"},{"name":"session","type":"SessionId","doc":"the session to attach to"}],"returns":"ControlClient","typeScopeBoundary":true},{"raw":"@Operation(Kind.LIFECYCLE)\n public static ControlClient attachUnfenced(ServerConfig config, SessionId session, Duration timeout)","params":[{"name":"config","type":"ServerConfig","doc":"which tmux and which server"},{"name":"session","type":"SessionId","doc":"the session to attach to"},{"name":"timeout","type":"Duration","doc":"how long to wait for the client to become ready"}],"returns":"ControlClient","typeScopeBoundary":true}],"doc":{"summary":"Attaches a control client to whatever server now answers this endpoint.","body":"Attaching is what makes tmux push {@code %output}: a control client that never attaches is\ntold about command replies and nothing else.\n\nThis does not check which tmux process answered. A socket can be taken over by a new\nserver that reuses the same session id. {@link io.github.libtmux.Server#control} attaches to\nthe process a capture already named; prefer it."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":141,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient.attachUnfenced","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient.attachUnfenced","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient-attachunfenced"},{"id":"io.github.libtmux.control.ControlClient.ControlClient.attach","name":"attach","kind":"method","modifiers":["static","overload"],"parent":"io.github.libtmux.control.ControlClient.ControlClient","signatures":[{"raw":"@Operation(Kind.LIFECYCLE)\n public static ControlClient attach(\n ServerConfig config, SessionId session, long serverPid, String serverVersion, Duration timeout)","params":[{"name":"config","type":"ServerConfig"},{"name":"session","type":"SessionId"},{"name":"serverPid","type":"long","doc":"the tmux process a capture recorded"},{"name":"serverVersion","type":"String","doc":"the version text that process reported, compared as text"},{"name":"timeout","type":"Duration"}],"returns":"ControlClient","typeScopeBoundary":true},{"raw":"@Operation(Kind.LIFECYCLE)\n public static ControlClient attach(\n ControlCarrier carrier,\n ServerConfig config,\n SessionId session,\n long serverPid,\n java.util.OptionalLong serverStartTime,\n String serverVersion,\n Duration timeout)","params":[{"name":"carrier","type":"ControlCarrier"},{"name":"config","type":"ServerConfig"},{"name":"session","type":"SessionId"},{"name":"serverPid","type":"long"},{"name":"serverStartTime","type":"java.util.OptionalLong","doc":"when the captured process started, as {@code #{start_time}} reported it; compared when present, since a restarted tmux can be given the same pid and version"},{"name":"serverVersion","type":"String"},{"name":"timeout","type":"Duration"}],"returns":"ControlClient","typeScopeBoundary":true}],"doc":{"summary":"Attaches, then leaves unless the live server is still the process that was captured.","body":"A pid can be reused, so the version tmux reports is part of the check. A mismatch detaches\nbefore this client changes the server: layout refresh runs only after the check passes."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":170,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient.attach","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient.attach","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient-attach"},{"id":"io.github.libtmux.control.ControlClient.ControlClient.send","name":"send","kind":"method","modifiers":["overload"],"parent":"io.github.libtmux.control.ControlClient.ControlClient","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public ControlReply send(String... argv)","params":[{"name":"argv","type":"String","variadic":"positional"}],"returns":"ControlReply","typeScopeBoundary":false},{"raw":"@Operation(Kind.MUTATION)\n public ControlReply send(List argv)","params":[{"name":"argv","type":"List"}],"returns":"ControlReply","typeScopeBoundary":false},{"raw":"@Operation(Kind.MUTATION)\n public ControlReply send(List argv, Duration timeout)","params":[{"name":"argv","type":"List","doc":"the command, its arguments already separate elements"},{"name":"timeout","type":"Duration","doc":"how long to wait for tmux to answer"}],"returns":"ControlReply","typeScopeBoundary":false,"returnsDoc":"tmux's reply","raises":[{"type":"DispatchException","doc":"if the request cannot complete; its {@link DispatchException#outcome() outcome} is {@link DispatchOutcome#NOT_DISPATCHED} until the writer picks the request and {@link DispatchOutcome#UNKNOWN} afterwards"}]}],"doc":{"summary":"Runs one command and waits for its reply."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":311,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient.send","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient.send","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient-send"},{"id":"io.github.libtmux.control.ControlClient.ControlClient.isAlive","name":"isAlive","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlClient.ControlClient","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public boolean isAlive()","params":[],"returns":"boolean","typeScopeBoundary":false}],"doc":{"summary":"Whether the client is still running.","body":"A control client is a client of the server it talks to, so it ends when that server does.\nA carrier holding one needs to tell \"this command failed\" from \"there is no longer anything\nto send commands to\", which are the same exception until this is asked."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":408,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient.isAlive","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient.isAlive","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient-isalive"},{"id":"io.github.libtmux.control.ControlClient.ControlClient.subscribeOutput","name":"subscribeOutput","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlClient.ControlClient","signatures":[{"raw":"@Operation(Kind.STREAM)\n public EventSubscription subscribeOutput(int capacity)","params":[{"name":"capacity","type":"int","doc":"how many values this subscriber can retain before its oldest value is dropped"}],"returns":"EventSubscription","typeScopeBoundary":false,"returnsDoc":"a pull subscription owned by the caller","raises":[{"type":"IllegalArgumentException","doc":"if {@code capacity} is not positive"},{"type":"IllegalStateException","doc":"if the client has ended"}]}],"doc":{"summary":"Subscribes to terminal output tmux pushes."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":421,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient.subscribeOutput","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient.subscribeOutput","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient-subscribeoutput"},{"id":"io.github.libtmux.control.ControlClient.ControlClient.subscribeEvents","name":"subscribeEvents","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlClient.ControlClient","signatures":[{"raw":"@Operation(Kind.STREAM)\n public EventSubscription subscribeEvents(int capacity)","params":[{"name":"capacity","type":"int","doc":"how many values this subscriber can retain before its oldest value is dropped"}],"returns":"EventSubscription","typeScopeBoundary":false,"returnsDoc":"a pull subscription owned by the caller","raises":[{"type":"IllegalArgumentException","doc":"if {@code capacity} is not positive"},{"type":"IllegalStateException","doc":"if the client has ended"}]}],"doc":{"summary":"Subscribes to state changes tmux volunteers."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":434,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient.subscribeEvents","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient.subscribeEvents","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient-subscribeevents"},{"id":"io.github.libtmux.control.ControlClient.ControlClient.watch","name":"watch","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlClient.ControlClient","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public ControlReply watch(String name, String target, String format)","params":[{"name":"name","type":"String","doc":"what to call it; registering the same name again replaces the old one"},{"name":"target","type":"String","doc":"{@code %*} for every pane, {@code @*} for every window, a specific {@code %id} or {@code @id}, or the attached session (pass {@code \"\"} - see below)"},{"name":"format","type":"String","doc":"a tmux format, such as {@code #{pane_current_command}}"}],"returns":"ControlReply","typeScopeBoundary":false}],"doc":{"summary":"Asks tmux to report a format whenever its value changes.","body":"tmux re-expands the format about once a second and writes a {@code subscription-changed}\nevent only when the result differs from last time, so the comparison happens in the server and\na client that subscribes does nothing at all between changes. This is what makes watching a\nserver cost nothing while it is idle."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":452,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient.watch","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient.watch","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient-watch"},{"id":"io.github.libtmux.control.ControlClient.ControlClient.unwatch","name":"unwatch","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlClient.ControlClient","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public ControlReply unwatch(String name)","params":[{"name":"name","type":"String"}],"returns":"ControlReply","typeScopeBoundary":false}],"doc":{"summary":"Stops a watch. tmux reads a name with no colon in it as one to remove."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":471,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient.unwatch","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient.unwatch","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient-unwatch"},{"id":"io.github.libtmux.control.ControlClient.ControlClient.close","name":"close","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlClient.ControlClient","signatures":[{"raw":"@Operation(Kind.LIFECYCLE)\n @Override\n public void close()","params":[],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Ends the client, rejecting queued requests and resolving picked requests as uncertain."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":477,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient.close","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient.close","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient-close"},{"id":"io.github.libtmux.control.ControlClient.ControlClient.line","name":"line","kind":"method","modifiers":["static"],"parent":"io.github.libtmux.control.ControlClient.ControlClient","signatures":[{"raw":"static String line(List argv)","params":[{"name":"argv","type":"List"}],"returns":"String","typeScopeBoundary":true}],"doc":{"summary":"tmux parses a control-mode request as one line, so an argument has to survive its lexer. Single quotes preserve everything except a single quote, which is closed, escaped and reopened."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":524,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient.line","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient.line","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient-line"},{"id":"io.github.libtmux.control.ControlClient.ControlClient.standardError","name":"standardError","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlClient.ControlClient","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public String standardError()","params":[],"returns":"String","typeScopeBoundary":false}],"doc":{"summary":"The error text captured from this control process, at most 4096 bytes.","body":"Empty when the process wrote none. {@link #standardErrorTruncated()} says the stream\ncontinued past that bound. The text is whatever had been read when this is called."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":580,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient.standardError","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient.standardError","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient-standarderror"},{"id":"io.github.libtmux.control.ControlClient.ControlClient.standardErrorTruncated","name":"standardErrorTruncated","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlClient.ControlClient","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public boolean standardErrorTruncated()","params":[],"returns":"boolean","typeScopeBoundary":false}],"doc":{"summary":"Whether {@link #standardError()} stopped before the process finished writing it."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":588,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient.standardErrorTruncated","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient.standardErrorTruncated","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient-standarderrortruncated"},{"id":"io.github.libtmux.control.ControlClient.ControlClient.unescape","name":"unescape","kind":"method","modifiers":["static"],"parent":"io.github.libtmux.control.ControlClient.ControlClient","signatures":[{"raw":"static byte[] unescape(byte[] line, int from)","params":[{"name":"line","type":"byte[]"},{"name":"from","type":"int"}],"returns":"byte[]","typeScopeBoundary":true}],"doc":{"summary":"tmux writes a control byte or a backslash as a three-digit octal escape, and the rest raw."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlClient.java","line":721,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlClient.unescape","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlClient.ControlClient.unescape","product":"core","slug":"io-github-libtmux-control-controlclient-controlclient-unescape"},{"id":"io.github.libtmux.control.ControlEvent.ControlEvent","name":"ControlEvent","kind":"class","modifiers":[],"signatures":[{"raw":"public record ControlEvent(\n String kind, @ReadOnly List fields, Optional value, Notification notification)","params":[{"name":"kind","type":"String","doc":"the notification name, such as {@code window-add} or {@code subscription-changed}"},{"name":"fields","type":"List","doc":"the words that followed it, before any {@code :} separator"},{"name":"value","type":"Optional","doc":"what followed a {@code :} separator, which only a subscription carries"},{"name":"notification","type":"Notification","doc":"the same notification, typed"}]}],"typeScopeBoundary":false,"doc":{"summary":"Something tmux volunteered, rather than an answer to a request.","body":"A control client is told about changes as they happen — a window appearing, a session being\nrenamed, a layout moving — without anything asking. That is the difference between watching a\nserver and polling one.\n\nTwo readings of one line. {@link #notification()} is typed, for matching on: a sealed set of\nwhat tmux sends, with a {@link Notification.Unknown} case so that a notification a newer tmux adds\nstill arrives rather than being dropped. {@link #kind()}, {@link #fields()} and {@link #value()}\nare what tmux wrote, word by word, for anything the typed reading does not cover."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlEvent.java","line":26,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlEvent","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlEvent.ControlEvent","product":"core","slug":"io-github-libtmux-control-controlevent-controlevent"},{"id":"io.github.libtmux.control.ControlEvent.ControlEvent.ControlEvent","name":"ControlEvent","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlEvent.ControlEvent","signatures":[{"raw":"public ControlEvent(String kind, List fields, Optional value)","params":[{"name":"kind","type":"String"},{"name":"fields","type":"List"},{"name":"value","type":"Optional"}],"typeScopeBoundary":false}],"doc":{"summary":"An event from its words, with the typed reading taken from them.","body":"A name is rejoined from the words with single spaces, so one tmux wrote with a run of them\nreads back with one. {@link #parse} reads the line tmux wrote and has no such loss."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlEvent.java","line":39,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlEvent.ControlEvent","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlEvent.ControlEvent.ControlEvent","product":"core","slug":"io-github-libtmux-control-controlevent-controlevent-controlevent"},{"id":"io.github.libtmux.control.ControlEvent.ControlEvent.parse","name":"parse","kind":"method","modifiers":["static"],"parent":"io.github.libtmux.control.ControlEvent.ControlEvent","signatures":[{"raw":"static Optional parse(String line)","params":[{"name":"line","type":"String","doc":"the line as tmux wrote it, leading {@code %} and all"}],"returns":"Optional","typeScopeBoundary":true,"returnsDoc":"the event, or empty when the line is not a notification"}],"doc":{"summary":"Reads one notification line."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlEvent.java","line":49,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlEvent.parse","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlEvent.ControlEvent.parse","product":"core","slug":"io-github-libtmux-control-controlevent-controlevent-parse"},{"id":"io.github.libtmux.control.ControlEvent.ControlEvent.subscription","name":"subscription","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlEvent.ControlEvent","signatures":[{"raw":"public Optional subscription()","params":[],"returns":"Optional","typeScopeBoundary":false}],"doc":{"summary":"The name a subscription was registered under, for an event that came from one."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlEvent.java","line":74,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlEvent.subscription","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlEvent.ControlEvent.subscription","product":"core","slug":"io-github-libtmux-control-controlevent-controlevent-subscription"},{"id":"io.github.libtmux.control.ControlEvent.ControlEvent.paneId","name":"paneId","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlEvent.ControlEvent","signatures":[{"raw":"public Optional paneId()","params":[],"returns":"Optional","typeScopeBoundary":false}],"doc":{"summary":"The first field naming a pane, which is how an event says which pane it is about."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlEvent.java","line":79,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlEvent.paneId","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlEvent.ControlEvent.paneId","product":"core","slug":"io-github-libtmux-control-controlevent-controlevent-paneid"},{"id":"io.github.libtmux.control.ControlEvent.ControlEvent.windowId","name":"windowId","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlEvent.ControlEvent","signatures":[{"raw":"public Optional windowId()","params":[],"returns":"Optional","typeScopeBoundary":false}],"doc":{"summary":"The first field naming a window."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlEvent.java","line":87,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlEvent.windowId","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlEvent.ControlEvent.windowId","product":"core","slug":"io-github-libtmux-control-controlevent-controlevent-windowid"},{"id":"io.github.libtmux.control.ControlEvent.ControlEvent.kind","name":"kind","kind":"method","parent":"io.github.libtmux.control.ControlEvent.ControlEvent","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"doc":{"summary":"the notification name, such as {@code window-add} or {@code subscription-changed}"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlEvent.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlEvent.kind","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlEvent.ControlEvent.kind","product":"core","slug":"io-github-libtmux-control-controlevent-controlevent-kind"},{"id":"io.github.libtmux.control.ControlEvent.ControlEvent.fields","name":"fields","kind":"method","parent":"io.github.libtmux.control.ControlEvent.ControlEvent","modifiers":[],"signatures":[{"params":[],"returns":"List"}],"doc":{"summary":"the words that followed it, before any {@code :} separator"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlEvent.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlEvent.fields","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlEvent.ControlEvent.fields","product":"core","slug":"io-github-libtmux-control-controlevent-controlevent-fields"},{"id":"io.github.libtmux.control.ControlEvent.ControlEvent.value","name":"value","kind":"method","parent":"io.github.libtmux.control.ControlEvent.ControlEvent","modifiers":[],"signatures":[{"params":[],"returns":"Optional"}],"doc":{"summary":"what followed a {@code :} separator, which only a subscription carries"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlEvent.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlEvent.value","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlEvent.ControlEvent.value","product":"core","slug":"io-github-libtmux-control-controlevent-controlevent-value"},{"id":"io.github.libtmux.control.ControlEvent.ControlEvent.notification","name":"notification","kind":"method","parent":"io.github.libtmux.control.ControlEvent.ControlEvent","modifiers":[],"signatures":[{"params":[],"returns":"Notification"}],"doc":{"summary":"the same notification, typed"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlEvent.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlEvent.notification","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlEvent.ControlEvent.notification","product":"core","slug":"io-github-libtmux-control-controlevent-controlevent-notification"},{"id":"io.github.libtmux.control.ControlLineReader.ControlLineReader","name":"ControlLineReader","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"Reads bounded physical lines from a control client's byte stream."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlLineReader.java","line":13,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlLineReader","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlLineReader.ControlLineReader","product":"core","slug":"io-github-libtmux-control-controllinereader-controllinereader"},{"id":"io.github.libtmux.control.ControlLineReader.ControlLineReader.ControlLineReader","name":"ControlLineReader","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlLineReader.ControlLineReader","signatures":[{"raw":"ControlLineReader(InputStream source, int maxBytes)","params":[{"name":"source","type":"InputStream"},{"name":"maxBytes","type":"int"}],"typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlLineReader.java","line":18,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlLineReader.ControlLineReader","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlLineReader.ControlLineReader.ControlLineReader","product":"core","slug":"io-github-libtmux-control-controllinereader-controllinereader-controllinereader"},{"id":"io.github.libtmux.control.ControlLineReader.ControlLineReader.Line","name":"Line","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.ControlLineReader.ControlLineReader","signatures":[{"raw":"@SuppressWarnings(\"ArrayRecordComponent\") // Internal: read once by the thread that made it.\n record Line(String text, int encodedBytes, byte[] bytes)","params":[{"name":"text","type":"String"},{"name":"encodedBytes","type":"int"},{"name":"bytes","type":"byte[]"}]}],"typeScopeBoundary":true,"doc":{"summary":"A line as text, its length on the wire, and its bytes without the line ending."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlLineReader.java","line":27,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlLineReader.Line","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlLineReader.ControlLineReader.Line","product":"core","slug":"io-github-libtmux-control-controllinereader-controllinereader-line"},{"id":"io.github.libtmux.control.ControlLineReader.ControlLineReader.Line.text","name":"text","kind":"method","parent":"io.github.libtmux.control.ControlLineReader.ControlLineReader.Line","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlLineReader.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlLineReader.Line.text","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlLineReader.ControlLineReader.Line.text","product":"core","slug":"io-github-libtmux-control-controllinereader-controllinereader-line-text"},{"id":"io.github.libtmux.control.ControlLineReader.ControlLineReader.Line.encodedBytes","name":"encodedBytes","kind":"method","parent":"io.github.libtmux.control.ControlLineReader.ControlLineReader.Line","modifiers":[],"signatures":[{"params":[],"returns":"int"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlLineReader.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlLineReader.Line.encodedBytes","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlLineReader.ControlLineReader.Line.encodedBytes","product":"core","slug":"io-github-libtmux-control-controllinereader-controllinereader-line-encodedbytes"},{"id":"io.github.libtmux.control.ControlLineReader.ControlLineReader.Line.bytes","name":"bytes","kind":"method","parent":"io.github.libtmux.control.ControlLineReader.ControlLineReader.Line","modifiers":[],"signatures":[{"params":[],"returns":"byte[]"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlLineReader.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlLineReader.Line.bytes","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlLineReader.ControlLineReader.Line.bytes","product":"core","slug":"io-github-libtmux-control-controllinereader-controllinereader-line-bytes"},{"id":"io.github.libtmux.control.ControlLineReader.ControlLineReader.readLine","name":"readLine","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlLineReader.ControlLineReader","signatures":[{"raw":"@Nullable\n Line readLine() throws IOException","params":[],"returns":"Line","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlLineReader.java","line":30,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlLineReader.readLine","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlLineReader.ControlLineReader.readLine","product":"core","slug":"io-github-libtmux-control-controllinereader-controllinereader-readline"},{"id":"io.github.libtmux.control.ControlLineReader.ControlLineReader.close","name":"close","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlLineReader.ControlLineReader","signatures":[{"raw":"@Override\n public void close() throws IOException","params":[],"returns":"void","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlLineReader.java","line":58,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlLineReader.close","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlLineReader.ControlLineReader.close","product":"core","slug":"io-github-libtmux-control-controllinereader-controllinereader-close"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol","name":"ControlProtocol","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"Frames control-mode replies and encodes requests for tmux's command parser."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","line":14,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.DEFAULT_MAX_REPLY_BYTES","name":"DEFAULT_MAX_REPLY_BYTES","kind":"attribute","modifiers":["static","readonly"],"parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol","signatures":[],"typeScopeBoundary":true,"type":"int","value":"16 * 1024 * 1024","source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","line":16,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.DEFAULT_MAX_REPLY_BYTES","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.DEFAULT_MAX_REPLY_BYTES","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-default_max_reply_bytes"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.ControlProtocol","name":"ControlProtocol","kind":"method","modifiers":["overload"],"parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol","signatures":[{"raw":"ControlProtocol()","params":[],"typeScopeBoundary":false},{"raw":"ControlProtocol(int maxReplyBytes)","params":[{"name":"maxReplyBytes","type":"int"}],"typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","line":24,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.ControlProtocol","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.ControlProtocol","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-controlprotocol"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Result","name":"Result","kind":"interface","modifiers":[],"parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol","signatures":[],"typeScopeBoundary":true,"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","line":35,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.Result","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Result","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-result"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Awaiting","name":"Awaiting","kind":"enum","modifiers":[],"parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol","signatures":[],"typeScopeBoundary":true,"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","line":37,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.Awaiting","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Awaiting","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-awaiting"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Awaiting.INSTANCE","name":"INSTANCE","kind":"constant","modifiers":[],"parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Awaiting","signatures":[],"typeScopeBoundary":true,"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","line":38,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.Awaiting.INSTANCE","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Awaiting.INSTANCE","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-awaiting-instance"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Notification","name":"Notification","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol","signatures":[{"raw":"record Notification(String line) implements Result","params":[{"name":"line","type":"String"}]}],"typeScopeBoundary":true,"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","line":41,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.Notification","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Notification","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-notification"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Notification.line","name":"line","kind":"method","parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Notification","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.Notification.line","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Notification.line","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-notification-line"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Reply","name":"Reply","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol","signatures":[{"raw":"record Reply(OperationOutcome outcome, @ReadOnly List lines, boolean requested) implements Result","params":[{"name":"outcome","type":"OperationOutcome"},{"name":"lines","type":"List"},{"name":"requested","type":"boolean"}]}],"typeScopeBoundary":true,"doc":{"summary":"One reply block. {@code requested} is tmux's guard flag: set for a command this client wrote, and for any that command queued, and clear for what a hook ran."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","line":47,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.Reply","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Reply","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-reply"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Reply.outcome","name":"outcome","kind":"method","parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Reply","modifiers":[],"signatures":[{"params":[],"returns":"OperationOutcome"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.Reply.outcome","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Reply.outcome","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-reply-outcome"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Reply.lines","name":"lines","kind":"method","parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Reply","modifiers":[],"signatures":[{"params":[],"returns":"List"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.Reply.lines","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Reply.lines","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-reply-lines"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Reply.requested","name":"requested","kind":"method","parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Reply","modifiers":[],"signatures":[{"params":[],"returns":"boolean"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.Reply.requested","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.Reply.requested","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-reply-requested"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.accept","name":"accept","kind":"method","modifiers":["overload"],"parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol","signatures":[{"raw":"Result accept(String line)","params":[{"name":"line","type":"String"}],"returns":"Result","typeScopeBoundary":false},{"raw":"Result accept(String line, int encodedBytes)","params":[{"name":"line","type":"String"},{"name":"encodedBytes","type":"int"}],"returns":"Result","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","line":54,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.accept","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.accept","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-accept"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.line","name":"line","kind":"method","modifiers":["static"],"parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol","signatures":[{"raw":"static String line(List argv)","params":[{"name":"argv","type":"List"}],"returns":"String","typeScopeBoundary":true}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","line":98,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.line","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.line","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-line"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.LimitExceeded","name":"LimitExceeded","kind":"class","modifiers":["static","readonly"],"parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol","signatures":[],"typeScopeBoundary":true,"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","line":113,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.LimitExceeded","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.LimitExceeded","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-limitexceeded"},{"id":"io.github.libtmux.control.ControlProtocol.ControlProtocol.LimitExceeded.LimitExceeded","name":"LimitExceeded","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlProtocol.ControlProtocol.LimitExceeded","signatures":[{"raw":"LimitExceeded(int limit)","params":[{"name":"limit","type":"int"}],"typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlProtocol.java","line":116,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlProtocol.LimitExceeded.LimitExceeded","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlProtocol.ControlProtocol.LimitExceeded.LimitExceeded","product":"core","slug":"io-github-libtmux-control-controlprotocol-controlprotocol-limitexceeded-limitexceeded"},{"id":"io.github.libtmux.control.ControlReply.ControlReply","name":"ControlReply","kind":"class","modifiers":[],"signatures":[{"raw":"public record ControlReply(\n OperationOutcome outcome, @ReadOnly List lines)","params":[{"name":"outcome","type":"OperationOutcome","doc":"what tmux said became of it; never {@code SKIPPED}, because control-mode requests are independent and a failure discards nothing behind it"},{"name":"lines","type":"List","doc":"the lines tmux produced between the reply's own begin and end markers"}]}],"typeScopeBoundary":false,"doc":{"summary":"One command's reply in control mode."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlReply.java","line":14,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlReply","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlReply.ControlReply","product":"core","slug":"io-github-libtmux-control-controlreply-controlreply"},{"id":"io.github.libtmux.control.ControlReply.ControlReply.succeeded","name":"succeeded","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlReply.ControlReply","signatures":[{"raw":"public boolean succeeded()","params":[],"returns":"boolean","typeScopeBoundary":false}],"doc":{"summary":"Whether tmux ran the command and it succeeded."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlReply.java","line":22,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlReply.succeeded","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlReply.ControlReply.succeeded","product":"core","slug":"io-github-libtmux-control-controlreply-controlreply-succeeded"},{"id":"io.github.libtmux.control.ControlReply.ControlReply.toString","name":"toString","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlReply.ControlReply","signatures":[{"raw":"@Override\n public String toString()","params":[],"returns":"String","typeScopeBoundary":false}],"doc":{"summary":"Counts only: reply lines carry pane content."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlReply.java","line":27,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlReply.toString","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlReply.ControlReply.toString","product":"core","slug":"io-github-libtmux-control-controlreply-controlreply-tostring"},{"id":"io.github.libtmux.control.ControlReply.ControlReply.outcome","name":"outcome","kind":"method","parent":"io.github.libtmux.control.ControlReply.ControlReply","modifiers":[],"signatures":[{"params":[],"returns":"OperationOutcome"}],"doc":{"summary":"what tmux said became of it; never {@code SKIPPED}, because control-mode requests are independent and a failure discards nothing behind it"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlReply.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlReply.outcome","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlReply.ControlReply.outcome","product":"core","slug":"io-github-libtmux-control-controlreply-controlreply-outcome"},{"id":"io.github.libtmux.control.ControlReply.ControlReply.lines","name":"lines","kind":"method","parent":"io.github.libtmux.control.ControlReply.ControlReply","modifiers":[],"signatures":[{"params":[],"returns":"List"}],"doc":{"summary":"the lines tmux produced between the reply's own begin and end markers"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlReply.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlReply.lines","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlReply.ControlReply.lines","product":"core","slug":"io-github-libtmux-control-controlreply-controlreply-lines"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter","name":"ControlWriter","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"Owns the process-pipe write and the FIFO that attributes replies to requests.","body":"A request's reply is the first block tmux writes for it: an acknowledgement, which deferred\nwork may outlive. But tmux answers every command another one queues with a block of its own, as\n{@code if-shell} queues its branch and {@code run-shell} reports its job, numbered like any other.\nSo each request line is followed by a second, {@code display-message -p} of a marker unique to it:\ntmux runs that after everything the request queued, whether the request failed or not. Blocks\nbetween a reply and its marker belong to the request already answered, and are not handed to\nthe next one."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":34,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.DEFAULT_CAPACITY","name":"DEFAULT_CAPACITY","kind":"attribute","modifiers":["static","readonly"],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter","signatures":[],"typeScopeBoundary":true,"type":"int","value":"64","source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":36,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.DEFAULT_CAPACITY","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.DEFAULT_CAPACITY","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-default_capacity"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.ControlWriter","name":"ControlWriter","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter","signatures":[{"raw":"ControlWriter(BufferedWriter output, int capacity, Consumer failed)","params":[{"name":"output","type":"BufferedWriter"},{"name":"capacity","type":"int"},{"name":"failed","type":"Consumer"}],"typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":50,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.ControlWriter","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.ControlWriter","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-controlwriter"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.expectInitial","name":"expectInitial","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter","signatures":[{"raw":"Request expectInitial(Duration timeout)","params":[{"name":"timeout","type":"Duration"}],"returns":"Request","typeScopeBoundary":false}],"doc":{"summary":"Records the attach request dispatched by the process invocation."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":64,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.expectInitial","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.expectInitial","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-expectinitial"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.start","name":"start","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter","signatures":[{"raw":"void start()","params":[],"returns":"void","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":73,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.start","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.start","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-start"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.exchange","name":"exchange","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter","signatures":[{"raw":"ControlReply exchange(String line, Duration timeout)","params":[{"name":"line","type":"String"},{"name":"timeout","type":"Duration"}],"returns":"ControlReply","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":77,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.exchange","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.exchange","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-exchange"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.takeTiming","name":"takeTiming","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter","signatures":[{"raw":"long[] takeTiming(long elapsed)","params":[{"name":"elapsed","type":"long"}],"returns":"long[]","typeScopeBoundary":false}],"doc":{"summary":"Queue time, then run time, for the last exchange on this thread; {@code elapsed} as run time when this thread made none."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":110,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.takeTiming","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.takeTiming","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-taketiming"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.complete","name":"complete","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter","signatures":[{"raw":"void complete(OperationOutcome outcome, List lines, boolean requested)","params":[{"name":"outcome","type":"OperationOutcome"},{"name":"lines","type":"List"},{"name":"requested","type":"boolean","doc":"tmux's guard flag: clear for a block a hook ran, which answers no request"}],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Called by the reader for each reply block, in the order tmux wrote them."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":121,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.complete","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.complete","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-complete"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.readerEnded","name":"readerEnded","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter","signatures":[{"raw":"void readerEnded()","params":[],"returns":"void","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":148,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.readerEnded","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.readerEnded","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-readerended"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.close","name":"close","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter","signatures":[{"raw":"void close()","params":[],"returns":"void","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":152,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.close","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.close","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-close"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.join","name":"join","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter","signatures":[{"raw":"void join(long timeoutMillis) throws InterruptedException","params":[{"name":"timeoutMillis","type":"long"}],"returns":"void","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":156,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.join","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.join","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-join"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.await","name":"await","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter","signatures":[{"raw":"ControlReply await(Request request)","params":[{"name":"request","type":"Request"}],"returns":"ControlReply","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":170,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.await","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.await","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-await"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","name":"Request","kind":"class","modifiers":["static","readonly"],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter","signatures":[],"typeScopeBoundary":true,"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":329,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.Request","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-request"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.pick","name":"pick","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","signatures":[{"raw":"boolean pick()","params":[],"returns":"boolean","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":356,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.Request.pick","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.pick","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-request-pick"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.timing","name":"timing","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","signatures":[{"raw":"long[] timing(long now)","params":[{"name":"now","type":"long"}],"returns":"long[]","typeScopeBoundary":false}],"doc":{"summary":"Queue time, then run time, up to now. A request never picked spent all of it queued."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":366,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.Request.timing","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.timing","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-request-timing"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.cancel","name":"cancel","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","signatures":[{"raw":"boolean cancel(DispatchException reason)","params":[{"name":"reason","type":"DispatchException"}],"returns":"boolean","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":373,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.Request.cancel","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.cancel","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-request-cancel"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.complete","name":"complete","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","signatures":[{"raw":"void complete(ControlReply reply)","params":[{"name":"reply","type":"ControlReply"}],"returns":"void","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":377,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.Request.complete","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.complete","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-request-complete"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.fail","name":"fail","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","signatures":[{"raw":"boolean fail(DispatchException reason)","params":[{"name":"reason","type":"DispatchException"}],"returns":"boolean","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":381,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.Request.fail","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.fail","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-request-fail"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.claimFailure","name":"claimFailure","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","signatures":[{"raw":"boolean claimFailure()","params":[],"returns":"boolean","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":389,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.Request.claimFailure","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.claimFailure","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-request-claimfailure"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.publishFailure","name":"publishFailure","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","signatures":[{"raw":"void publishFailure(DispatchException reason)","params":[{"name":"reason","type":"DispatchException"}],"returns":"void","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":393,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.Request.publishFailure","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.publishFailure","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-request-publishfailure"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.isDone","name":"isDone","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","signatures":[{"raw":"boolean isDone()","params":[],"returns":"boolean","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":406,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.Request.isDone","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.isDone","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-request-isdone"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.remainingNanos","name":"remainingNanos","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","signatures":[{"raw":"long remainingNanos()","params":[],"returns":"long","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":410,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.Request.remainingNanos","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.remainingNanos","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-request-remainingnanos"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.await","name":"await","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","signatures":[{"raw":"boolean await() throws InterruptedException","params":[],"returns":"boolean","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":415,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.Request.await","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.await","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-request-await"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.answer","name":"answer","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","signatures":[{"raw":"ControlReply answer()","params":[],"returns":"ControlReply","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":419,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.Request.answer","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.answer","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-request-answer"},{"id":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.awaitTerminal","name":"awaitTerminal","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.ControlWriter.ControlWriter.Request","signatures":[{"raw":"void awaitTerminal()","params":[],"returns":"void","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/ControlWriter.java","line":430,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.ControlWriter.Request.awaitTerminal","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.ControlWriter.ControlWriter.Request.awaitTerminal","product":"core","slug":"io-github-libtmux-control-controlwriter-controlwriter-request-awaitterminal"},{"id":"io.github.libtmux.control.Delivery.Delivery","name":"Delivery","kind":"interface","modifiers":[],"signatures":[],"typeScopeBoundary":false,"typeParams":["T"],"typeParamNames":["T"],"typeParameters":[{"name":"T","doc":"the event type"}],"doc":{"summary":"One step in a control subscription.","body":"A {@link Gap} sits in the sequence where events were discarded, ahead of the events that\nsurvived. It is not a side total: the next read is the gap, and the one after it is whatever\nremains."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Delivery.java","line":12,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Delivery","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Delivery.Delivery","product":"core","slug":"io-github-libtmux-control-delivery-delivery"},{"id":"io.github.libtmux.control.Delivery.Delivery.kept","name":"kept","kind":"method","modifiers":["static"],"parent":"io.github.libtmux.control.Delivery.Delivery","signatures":[{"raw":"static T kept(Delivery step)","params":[{"name":"step","type":"Delivery","doc":"the subscription's next step"}],"returns":"T","typeParamNames":["T"],"typeScopeBoundary":true,"typeParams":["T"],"typeParameters":[{"name":"T","doc":"the event type"}],"returnsDoc":"the event","raises":[{"type":"IllegalStateException","doc":"if {@code step} is a gap"}]}],"doc":{"summary":"The event a strict reader kept. A gap fails the read."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Delivery.java","line":22,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Delivery.kept","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Delivery.Delivery.kept","product":"core","slug":"io-github-libtmux-control-delivery-delivery-kept"},{"id":"io.github.libtmux.control.Delivery.Delivery.Event","name":"Event","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Delivery.Delivery","signatures":[{"raw":"record Event(T value) implements Delivery","params":[{"name":"value","type":"T","doc":"the event"}],"typeParamNames":["T"],"typeParams":["T"],"typeParameters":[{"name":"T","doc":"the event type"}]}],"typeScopeBoundary":true,"typeParams":["T"],"typeParamNames":["T"],"typeParameters":[{"name":"T","doc":"the event type"}],"doc":{"summary":"An event the subscription kept."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Delivery.java","line":35,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Delivery.Event","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Delivery.Delivery.Event","product":"core","slug":"io-github-libtmux-control-delivery-delivery-event"},{"id":"io.github.libtmux.control.Delivery.Delivery.Event.value","name":"value","kind":"method","parent":"io.github.libtmux.control.Delivery.Delivery.Event","modifiers":[],"signatures":[{"params":[],"returns":"T"}],"doc":{"summary":"the event"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Delivery.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Delivery.Event.value","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Delivery.Delivery.Event.value","product":"core","slug":"io-github-libtmux-control-delivery-delivery-event-value"},{"id":"io.github.libtmux.control.Delivery.Delivery.Gap","name":"Gap","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Delivery.Delivery","signatures":[{"raw":"record Gap(long missed) implements Delivery","params":[{"name":"missed","type":"long","doc":"the number discarded, at least one"}],"typeParamNames":["T"],"typeParams":["T"],"typeParameters":[{"name":"T","doc":"the event type"}]}],"typeScopeBoundary":true,"typeParams":["T"],"typeParamNames":["T"],"typeParameters":[{"name":"T","doc":"the event type"}],"doc":{"summary":"How many events were discarded since the previous read because the buffer was full."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Delivery.java","line":43,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Delivery.Gap","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Delivery.Delivery.Gap","product":"core","slug":"io-github-libtmux-control-delivery-delivery-gap"},{"id":"io.github.libtmux.control.Delivery.Delivery.Gap.missed","name":"missed","kind":"method","parent":"io.github.libtmux.control.Delivery.Delivery.Gap","modifiers":[],"signatures":[{"params":[],"returns":"long"}],"doc":{"summary":"the number discarded, at least one"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Delivery.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Delivery.Gap.missed","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Delivery.Delivery.Gap.missed","product":"core","slug":"io-github-libtmux-control-delivery-delivery-gap-missed"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription","name":"EventSubscription","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"typeParams":["T"],"typeParamNames":["T"],"typeParameters":[{"name":"T","doc":"the event type"}],"doc":{"summary":"Pulls events volunteered by one control client.","body":"Each subscription owns a fixed-capacity buffer. When that buffer is full, the next event\nreplaces its oldest event. The read that follows is a {@link Delivery.Gap} naming how many were\ndiscarded since the previous read, and only then the events that remain. {@link #droppedCount()}\nis the total across the subscription's life. Another subscription has its own buffer and its own\ngaps. The control protocol reader only offers values to these buffers, and never runs subscriber\ncode beyond a {@link #onReady readiness callback}.\n\nOne reader at a time. Public operations are thread-safe, and reads from different threads one\nafter another are fine — a coroutine or a fiber moves between threads — but a read that overlaps\nanother, or any read once {@link #stream()} or {@link #publisher()} has taken the subscription, is\nrefused with {@link IllegalStateException}: two readers would split one sequence and its gaps\nbetween them. For a second reader, subscribe again; each subscription gets every event.\n\n{@link #next()} blocks. {@link #poll()} never does, and {@link #onReady(Runnable)} arms a\none-shot wakeup for when there is something to poll, so an event loop or a coroutine can read\nwithout holding a thread while nothing arrives.\n\nA subscription does not reconnect. When it ends, {@link #next()} returns empty. {@link\n#cause()} is empty when the caller closed it, and set when the control client ended it. Attach\nagain from the captured session and read a snapshot; nothing already missed is replayed.\n\nEnding is terminal and wakes threads blocked in {@link #next()}. A caller's {@link #close()}\ndiscards buffered events: the caller has chosen not to read them, so they are not overflow and do\nnot increment the loss count. When the control client ends a subscription, what it had already\ndelivered stays readable, a pending gap first, and only then does a read return empty with\n{@link #cause()} set."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":53,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.EventSubscription","name":"EventSubscription","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"EventSubscription(int capacity, Consumer> onClose)","params":[{"name":"capacity","type":"int"},{"name":"onClose","type":"Consumer>"}],"typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":74,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.EventSubscription","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.EventSubscription","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-eventsubscription"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.offer","name":"offer","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"void offer(T event)","params":[{"name":"event","type":"T"}],"returns":"void","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":82,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.offer","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.offer","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-offer"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.droppedCount","name":"droppedCount","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public long droppedCount()","params":[],"returns":"long","typeScopeBoundary":false,"returnsDoc":"the monotonic loss count"}],"doc":{"summary":"Returns the exact number of events discarded because this subscription's buffer was full."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":118,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.droppedCount","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.droppedCount","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-droppedcount"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.cause","name":"cause","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public Optional cause()","params":[],"returns":"Optional","typeScopeBoundary":false}],"doc":{"summary":"Why this subscription ended, when the control client ended it.","body":"Empty when the subscription is still open, and empty when the caller closed it. A client\nthat died sets this before the read returns empty."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":134,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.cause","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.cause","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-cause"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.next","name":"next","kind":"method","modifiers":["overload"],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"@Operation(Kind.WAIT)\n public Optional> next() throws InterruptedException","params":[],"returns":"Optional>","typeScopeBoundary":false,"returnsDoc":"the next gap or event, or empty when the subscription has closed and no gap is waiting","raises":[{"type":"IllegalStateException","doc":"if another read is in progress, or a stream or publisher owns this subscription"},{"type":"InterruptedException","doc":"if the waiting thread is interrupted"}]},{"raw":"@Operation(Kind.WAIT)\n public Optional> next(Duration timeout) throws InterruptedException","params":[{"name":"timeout","type":"Duration","doc":"how long to wait, zero to inspect the buffer without waiting"}],"returns":"Optional>","typeScopeBoundary":false,"returnsDoc":"the next gap or event, or empty when none arrived before the deadline","raises":[{"type":"IllegalArgumentException","doc":"if {@code timeout} is negative"},{"type":"IllegalStateException","doc":"if another read is in progress, or a stream or publisher owns this subscription"},{"type":"InterruptedException","doc":"if the waiting thread is interrupted"}]}],"doc":{"summary":"Waits until the next step arrives or this subscription closes."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":152,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.next","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.next","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-next"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.poll","name":"poll","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public Optional> poll()","params":[],"returns":"Optional>","typeScopeBoundary":false,"returnsDoc":"the next gap or event, or empty when none is buffered; after the subscription has ended, empty once what it held is read","raises":[{"type":"IllegalStateException","doc":"if another read is in progress, or a stream or publisher owns this subscription"}]}],"doc":{"summary":"Returns the next step if one is waiting, without blocking."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":189,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.poll","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.poll","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-poll"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.onReady","name":"onReady","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public void onReady(Runnable callback)","params":[{"name":"callback","type":"Runnable"}],"returns":"void","typeScopeBoundary":false,"raises":[{"type":"IllegalStateException","doc":"if a callback is already armed, or a stream or publisher owns this subscription"}]}],"doc":{"summary":"Arms a one-shot wakeup for when this subscription has something to read, or has ended.","body":"Runs {@code callback} at once, on this thread, when a step is already waiting or the\nsubscription has ended. Otherwise it runs once, on the control client's reader thread, when the\nfirst step arrives or the subscription ends, and is then disarmed: drain with {@link #poll()}\nuntil it is empty, then arm again. Checking and arming happen under the lock that delivery\ntakes, so a step cannot slip between them unannounced.\n\nThe callback runs on the thread delivering events, so it must not block: resume a waiting\ncoroutine, complete a promise, and return. One that throws is logged and ignored, and delivery\ncontinues."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":220,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.onReady","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.onReady","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-onready"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.clearReady","name":"clearReady","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public void clearReady()","params":[],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Disarms the readiness callback, if one is armed. For a reader that stopped waiting."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":245,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.clearReady","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.clearReady","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-clearready"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.stream","name":"stream","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"@Operation(Kind.STREAM)\n public java.util.stream.Stream> stream()","params":[],"returns":"java.util.stream.Stream>","typeScopeBoundary":false,"raises":[{"type":"io.github.libtmux.exception.LibTmuxException","doc":"from the stream if the reading thread is interrupted; its interrupt status is set again"}]}],"doc":{"summary":"The steps still to come, in order, each read by the thread consuming the stream.","body":"Pull-only: a step is read when the stream asks for one, and events that arrive meanwhile\nwait in this subscription's buffer, so its capacity alone decides what becomes a {@link\nDelivery.Gap}. The stream ends when this subscription closes. When the control client ended\nit, the stream fails with {@link #cause()}. Closing the stream closes this subscription, and\nclosing this subscription from another thread ends a stream that is waiting.","examples":[{"lang":"java","code":"try (Stream> steps = subscription.stream()) {\n steps.map(Delivery::kept).forEach(output -> System.out.print(output.data()));\n}"}]},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":366,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.stream","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.stream","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-stream"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.publisher","name":"publisher","kind":"method","modifiers":["overload"],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"@Operation(Kind.STREAM)\n public Flow.Publisher> publisher()","params":[],"returns":"Flow.Publisher>","typeScopeBoundary":false},{"raw":"@Operation(Kind.STREAM)\n public Flow.Publisher> publisher(Executor executor)","params":[{"name":"executor","type":"Executor","doc":"where each blocking read for the subscriber runs; one that runs a task on the calling thread makes {@link Flow.Subscription#request request} block on tmux, which the Reactive Streams rules forbid"}],"returns":"Flow.Publisher>","typeScopeBoundary":false}],"doc":{"summary":"A {@link Flow.Publisher} view of this subscription's steps, delivered as demand allows.","body":"Reads that wait for the next step run on a fresh virtual thread, started only while a\nsubscriber has outstanding demand, so a subscriber that never asks never blocks anything. Use\n{@link #publisher(Executor)} to read somewhere else instead.\n\n@see #publisher(Executor)"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":406,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.publisher","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.publisher","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-publisher"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.isClosed","name":"isClosed","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"@Operation(Kind.CAPTURED)\n public boolean isClosed()","params":[],"returns":"boolean","typeScopeBoundary":false}],"doc":{"summary":"Whether this subscription has reached its terminal state.","body":"This distinguishes a timed read that expired from one that returned empty because the\nsubscription ended. A pending gap can still be read after the subscription has closed."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":685,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.isClosed","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.isClosed","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-isclosed"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.close","name":"close","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"@Operation(Kind.LIFECYCLE)\n @Override\n public void close()","params":[],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Discards buffered events, removes this subscriber, and wakes every waiting reader."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":696,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.close","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.close","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-close"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.end","name":"end","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"void end(@Nullable Throwable failure)","params":[{"name":"failure","type":"Throwable"}],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Ends this subscription as the control client saw it end, recording why. Unlike {@link #close()}, events already delivered stay readable."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":706,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.end","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.end","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-end"},{"id":"io.github.libtmux.control.EventSubscription.EventSubscription.finish","name":"finish","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.EventSubscription.EventSubscription","signatures":[{"raw":"void finish()","params":[],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Ends this subscription as a producer with nothing more to send: not a failure, and nothing is discarded."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java","line":711,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.EventSubscription.finish","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.EventSubscription.EventSubscription.finish","product":"core","slug":"io-github-libtmux-control-eventsubscription-eventsubscription-finish"},{"id":"io.github.libtmux.control.Notification.Notification","name":"Notification","kind":"interface","modifiers":[],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"What a control-mode notification says, typed, for matching on.","body":"Sealed, with {@link Unknown} as the case for everything else. tmux adds notifications between\nreleases, and a closed set with nowhere to put a new one would drop it; here a notification this\nlibrary does not model yet still arrives, as {@code Unknown}, and {@link ControlEvent#kind()} and\n{@link ControlEvent#fields()} still carry what tmux wrote.\n\nThe forms are tmux's own, from {@code control-notify.c}. A name — of a window, a session, a\nclient — is everything after the id, spaces included, as tmux writes it.","examples":[{"lang":"java","code":"switch (event.notification()) {\n case Notification.WindowRenamed(WindowId window, String name, boolean attached) -> relabel(window, name);\n case Notification.SessionsChanged changed -> refreshSessions();\n default -> {}\n}"}]},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":28,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification","product":"core","slug":"io-github-libtmux-control-notification-notification"},{"id":"io.github.libtmux.control.Notification.Notification.WindowAdded","name":"WindowAdded","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record WindowAdded(WindowId window, boolean attached) implements Notification","params":[{"name":"window","type":"WindowId"},{"name":"attached","type":"boolean"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %window-add}: a window was created; {@code attached} is false for {@code unlinked-window-add}."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":31,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.WindowAdded","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.WindowAdded","product":"core","slug":"io-github-libtmux-control-notification-notification-windowadded"},{"id":"io.github.libtmux.control.Notification.Notification.WindowAdded.window","name":"window","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.WindowAdded","modifiers":[],"signatures":[{"params":[],"returns":"WindowId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.WindowAdded.window","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.WindowAdded.window","product":"core","slug":"io-github-libtmux-control-notification-notification-windowadded-window"},{"id":"io.github.libtmux.control.Notification.Notification.WindowAdded.attached","name":"attached","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.WindowAdded","modifiers":[],"signatures":[{"params":[],"returns":"boolean"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.WindowAdded.attached","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.WindowAdded.attached","product":"core","slug":"io-github-libtmux-control-notification-notification-windowadded-attached"},{"id":"io.github.libtmux.control.Notification.Notification.WindowClosed","name":"WindowClosed","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record WindowClosed(WindowId window, boolean attached) implements Notification","params":[{"name":"window","type":"WindowId"},{"name":"attached","type":"boolean"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %window-close}: a window was destroyed; {@code attached} as for {@link WindowAdded}."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":34,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.WindowClosed","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.WindowClosed","product":"core","slug":"io-github-libtmux-control-notification-notification-windowclosed"},{"id":"io.github.libtmux.control.Notification.Notification.WindowClosed.window","name":"window","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.WindowClosed","modifiers":[],"signatures":[{"params":[],"returns":"WindowId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.WindowClosed.window","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.WindowClosed.window","product":"core","slug":"io-github-libtmux-control-notification-notification-windowclosed-window"},{"id":"io.github.libtmux.control.Notification.Notification.WindowClosed.attached","name":"attached","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.WindowClosed","modifiers":[],"signatures":[{"params":[],"returns":"boolean"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.WindowClosed.attached","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.WindowClosed.attached","product":"core","slug":"io-github-libtmux-control-notification-notification-windowclosed-attached"},{"id":"io.github.libtmux.control.Notification.Notification.WindowRenamed","name":"WindowRenamed","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record WindowRenamed(WindowId window, String name, boolean attached) implements Notification","params":[{"name":"window","type":"WindowId"},{"name":"name","type":"String"},{"name":"attached","type":"boolean"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %window-renamed}: a window has a new name; {@code attached} as for {@link WindowAdded}."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":37,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.WindowRenamed","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.WindowRenamed","product":"core","slug":"io-github-libtmux-control-notification-notification-windowrenamed"},{"id":"io.github.libtmux.control.Notification.Notification.WindowRenamed.window","name":"window","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.WindowRenamed","modifiers":[],"signatures":[{"params":[],"returns":"WindowId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.WindowRenamed.window","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.WindowRenamed.window","product":"core","slug":"io-github-libtmux-control-notification-notification-windowrenamed-window"},{"id":"io.github.libtmux.control.Notification.Notification.WindowRenamed.name","name":"name","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.WindowRenamed","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.WindowRenamed.name","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.WindowRenamed.name","product":"core","slug":"io-github-libtmux-control-notification-notification-windowrenamed-name"},{"id":"io.github.libtmux.control.Notification.Notification.WindowRenamed.attached","name":"attached","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.WindowRenamed","modifiers":[],"signatures":[{"params":[],"returns":"boolean"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.WindowRenamed.attached","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.WindowRenamed.attached","product":"core","slug":"io-github-libtmux-control-notification-notification-windowrenamed-attached"},{"id":"io.github.libtmux.control.Notification.Notification.WindowPaneChanged","name":"WindowPaneChanged","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record WindowPaneChanged(WindowId window, PaneId pane) implements Notification","params":[{"name":"window","type":"WindowId"},{"name":"pane","type":"PaneId"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %window-pane-changed}: a window's active pane changed."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":40,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.WindowPaneChanged","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.WindowPaneChanged","product":"core","slug":"io-github-libtmux-control-notification-notification-windowpanechanged"},{"id":"io.github.libtmux.control.Notification.Notification.WindowPaneChanged.window","name":"window","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.WindowPaneChanged","modifiers":[],"signatures":[{"params":[],"returns":"WindowId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.WindowPaneChanged.window","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.WindowPaneChanged.window","product":"core","slug":"io-github-libtmux-control-notification-notification-windowpanechanged-window"},{"id":"io.github.libtmux.control.Notification.Notification.WindowPaneChanged.pane","name":"pane","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.WindowPaneChanged","modifiers":[],"signatures":[{"params":[],"returns":"PaneId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.WindowPaneChanged.pane","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.WindowPaneChanged.pane","product":"core","slug":"io-github-libtmux-control-notification-notification-windowpanechanged-pane"},{"id":"io.github.libtmux.control.Notification.Notification.LayoutChanged","name":"LayoutChanged","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record LayoutChanged(WindowId window, WindowLayout layout) implements Notification","params":[{"name":"window","type":"WindowId"},{"name":"layout","type":"WindowLayout"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %layout-change}: a window's layout changed, in whichever form tmux reports it."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":43,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.LayoutChanged","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.LayoutChanged","product":"core","slug":"io-github-libtmux-control-notification-notification-layoutchanged"},{"id":"io.github.libtmux.control.Notification.Notification.LayoutChanged.window","name":"window","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.LayoutChanged","modifiers":[],"signatures":[{"params":[],"returns":"WindowId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.LayoutChanged.window","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.LayoutChanged.window","product":"core","slug":"io-github-libtmux-control-notification-notification-layoutchanged-window"},{"id":"io.github.libtmux.control.Notification.Notification.LayoutChanged.layout","name":"layout","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.LayoutChanged","modifiers":[],"signatures":[{"params":[],"returns":"WindowLayout"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.LayoutChanged.layout","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.LayoutChanged.layout","product":"core","slug":"io-github-libtmux-control-notification-notification-layoutchanged-layout"},{"id":"io.github.libtmux.control.Notification.Notification.SessionChanged","name":"SessionChanged","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record SessionChanged(SessionId session, String name) implements Notification","params":[{"name":"session","type":"SessionId"},{"name":"name","type":"String"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %session-changed}: the attached client is now attached to this session."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":46,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SessionChanged","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SessionChanged","product":"core","slug":"io-github-libtmux-control-notification-notification-sessionchanged"},{"id":"io.github.libtmux.control.Notification.Notification.SessionChanged.session","name":"session","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.SessionChanged","modifiers":[],"signatures":[{"params":[],"returns":"SessionId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SessionChanged.session","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SessionChanged.session","product":"core","slug":"io-github-libtmux-control-notification-notification-sessionchanged-session"},{"id":"io.github.libtmux.control.Notification.Notification.SessionChanged.name","name":"name","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.SessionChanged","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SessionChanged.name","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SessionChanged.name","product":"core","slug":"io-github-libtmux-control-notification-notification-sessionchanged-name"},{"id":"io.github.libtmux.control.Notification.Notification.SessionRenamed","name":"SessionRenamed","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record SessionRenamed(SessionId session, String name) implements Notification","params":[{"name":"session","type":"SessionId"},{"name":"name","type":"String"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %session-renamed}: a session has a new name."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":49,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SessionRenamed","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SessionRenamed","product":"core","slug":"io-github-libtmux-control-notification-notification-sessionrenamed"},{"id":"io.github.libtmux.control.Notification.Notification.SessionRenamed.session","name":"session","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.SessionRenamed","modifiers":[],"signatures":[{"params":[],"returns":"SessionId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SessionRenamed.session","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SessionRenamed.session","product":"core","slug":"io-github-libtmux-control-notification-notification-sessionrenamed-session"},{"id":"io.github.libtmux.control.Notification.Notification.SessionRenamed.name","name":"name","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.SessionRenamed","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SessionRenamed.name","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SessionRenamed.name","product":"core","slug":"io-github-libtmux-control-notification-notification-sessionrenamed-name"},{"id":"io.github.libtmux.control.Notification.Notification.SessionsChanged","name":"SessionsChanged","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record SessionsChanged() implements Notification","params":[]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %sessions-changed}: a session was created or destroyed."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":52,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SessionsChanged","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SessionsChanged","product":"core","slug":"io-github-libtmux-control-notification-notification-sessionschanged"},{"id":"io.github.libtmux.control.Notification.Notification.SessionWindowChanged","name":"SessionWindowChanged","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record SessionWindowChanged(SessionId session, WindowId window) implements Notification","params":[{"name":"session","type":"SessionId"},{"name":"window","type":"WindowId"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %session-window-changed}: a session's current window changed."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":55,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SessionWindowChanged","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SessionWindowChanged","product":"core","slug":"io-github-libtmux-control-notification-notification-sessionwindowchanged"},{"id":"io.github.libtmux.control.Notification.Notification.SessionWindowChanged.session","name":"session","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.SessionWindowChanged","modifiers":[],"signatures":[{"params":[],"returns":"SessionId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SessionWindowChanged.session","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SessionWindowChanged.session","product":"core","slug":"io-github-libtmux-control-notification-notification-sessionwindowchanged-session"},{"id":"io.github.libtmux.control.Notification.Notification.SessionWindowChanged.window","name":"window","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.SessionWindowChanged","modifiers":[],"signatures":[{"params":[],"returns":"WindowId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SessionWindowChanged.window","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SessionWindowChanged.window","product":"core","slug":"io-github-libtmux-control-notification-notification-sessionwindowchanged-window"},{"id":"io.github.libtmux.control.Notification.Notification.ClientSessionChanged","name":"ClientSessionChanged","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record ClientSessionChanged(String client, SessionId session, String name) implements Notification","params":[{"name":"client","type":"String"},{"name":"session","type":"SessionId"},{"name":"name","type":"String"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %client-session-changed}: another client is now attached to this session."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":58,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.ClientSessionChanged","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.ClientSessionChanged","product":"core","slug":"io-github-libtmux-control-notification-notification-clientsessionchanged"},{"id":"io.github.libtmux.control.Notification.Notification.ClientSessionChanged.client","name":"client","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.ClientSessionChanged","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.ClientSessionChanged.client","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.ClientSessionChanged.client","product":"core","slug":"io-github-libtmux-control-notification-notification-clientsessionchanged-client"},{"id":"io.github.libtmux.control.Notification.Notification.ClientSessionChanged.session","name":"session","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.ClientSessionChanged","modifiers":[],"signatures":[{"params":[],"returns":"SessionId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.ClientSessionChanged.session","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.ClientSessionChanged.session","product":"core","slug":"io-github-libtmux-control-notification-notification-clientsessionchanged-session"},{"id":"io.github.libtmux.control.Notification.Notification.ClientSessionChanged.name","name":"name","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.ClientSessionChanged","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.ClientSessionChanged.name","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.ClientSessionChanged.name","product":"core","slug":"io-github-libtmux-control-notification-notification-clientsessionchanged-name"},{"id":"io.github.libtmux.control.Notification.Notification.ClientDetached","name":"ClientDetached","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record ClientDetached(String client) implements Notification","params":[{"name":"client","type":"String"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %client-detached}: a client detached."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":61,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.ClientDetached","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.ClientDetached","product":"core","slug":"io-github-libtmux-control-notification-notification-clientdetached"},{"id":"io.github.libtmux.control.Notification.Notification.ClientDetached.client","name":"client","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.ClientDetached","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.ClientDetached.client","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.ClientDetached.client","product":"core","slug":"io-github-libtmux-control-notification-notification-clientdetached-client"},{"id":"io.github.libtmux.control.Notification.Notification.PaneModeChanged","name":"PaneModeChanged","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record PaneModeChanged(PaneId pane) implements Notification","params":[{"name":"pane","type":"PaneId"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %pane-mode-changed}: a pane entered or left a mode."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":64,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.PaneModeChanged","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.PaneModeChanged","product":"core","slug":"io-github-libtmux-control-notification-notification-panemodechanged"},{"id":"io.github.libtmux.control.Notification.Notification.PaneModeChanged.pane","name":"pane","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.PaneModeChanged","modifiers":[],"signatures":[{"params":[],"returns":"PaneId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.PaneModeChanged.pane","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.PaneModeChanged.pane","product":"core","slug":"io-github-libtmux-control-notification-notification-panemodechanged-pane"},{"id":"io.github.libtmux.control.Notification.Notification.PasteBufferChanged","name":"PasteBufferChanged","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record PasteBufferChanged(String buffer) implements Notification","params":[{"name":"buffer","type":"String"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %paste-buffer-changed}: a paste buffer was created or changed."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":67,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.PasteBufferChanged","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.PasteBufferChanged","product":"core","slug":"io-github-libtmux-control-notification-notification-pastebufferchanged"},{"id":"io.github.libtmux.control.Notification.Notification.PasteBufferChanged.buffer","name":"buffer","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.PasteBufferChanged","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.PasteBufferChanged.buffer","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.PasteBufferChanged.buffer","product":"core","slug":"io-github-libtmux-control-notification-notification-pastebufferchanged-buffer"},{"id":"io.github.libtmux.control.Notification.Notification.PasteBufferDeleted","name":"PasteBufferDeleted","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record PasteBufferDeleted(String buffer) implements Notification","params":[{"name":"buffer","type":"String"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %paste-buffer-deleted}: a paste buffer was deleted."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":70,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.PasteBufferDeleted","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.PasteBufferDeleted","product":"core","slug":"io-github-libtmux-control-notification-notification-pastebufferdeleted"},{"id":"io.github.libtmux.control.Notification.Notification.PasteBufferDeleted.buffer","name":"buffer","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.PasteBufferDeleted","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.PasteBufferDeleted.buffer","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.PasteBufferDeleted.buffer","product":"core","slug":"io-github-libtmux-control-notification-notification-pastebufferdeleted-buffer"},{"id":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged","name":"SubscriptionChanged","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record SubscriptionChanged(\n String name, String value, Optional session, Optional window, Optional pane)\n implements Notification","params":[{"name":"name","type":"String","doc":"what the subscription was registered under"},{"name":"value","type":"String","doc":"what the format expanded to"},{"name":"session","type":"Optional","doc":"the session it is about, when tmux named one"},{"name":"window","type":"Optional","doc":"the window, when tmux named one"},{"name":"pane","type":"Optional","doc":"the pane, when tmux named one"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %subscription-changed}: a watched format has a new value."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":81,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SubscriptionChanged","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged","product":"core","slug":"io-github-libtmux-control-notification-notification-subscriptionchanged"},{"id":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged.name","name":"name","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"doc":{"summary":"what the subscription was registered under"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SubscriptionChanged.name","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged.name","product":"core","slug":"io-github-libtmux-control-notification-notification-subscriptionchanged-name"},{"id":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged.value","name":"value","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"doc":{"summary":"what the format expanded to"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SubscriptionChanged.value","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged.value","product":"core","slug":"io-github-libtmux-control-notification-notification-subscriptionchanged-value"},{"id":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged.session","name":"session","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged","modifiers":[],"signatures":[{"params":[],"returns":"Optional"}],"doc":{"summary":"the session it is about, when tmux named one"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SubscriptionChanged.session","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged.session","product":"core","slug":"io-github-libtmux-control-notification-notification-subscriptionchanged-session"},{"id":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged.window","name":"window","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged","modifiers":[],"signatures":[{"params":[],"returns":"Optional"}],"doc":{"summary":"the window, when tmux named one"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SubscriptionChanged.window","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged.window","product":"core","slug":"io-github-libtmux-control-notification-notification-subscriptionchanged-window"},{"id":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged.pane","name":"pane","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged","modifiers":[],"signatures":[{"params":[],"returns":"Optional"}],"doc":{"summary":"the pane, when tmux named one"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.SubscriptionChanged.pane","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.SubscriptionChanged.pane","product":"core","slug":"io-github-libtmux-control-notification-notification-subscriptionchanged-pane"},{"id":"io.github.libtmux.control.Notification.Notification.Pause","name":"Pause","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record Pause(PaneId pane) implements Notification","params":[{"name":"pane","type":"PaneId"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %pause}: tmux stopped sending a pane's output to this client, which turned flow control on with {@code refresh-client -f pause-after=N} and fell N seconds behind. {@code refresh-client -A '%1:continue'} resumes it. tmux 3.2 and later."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":90,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.Pause","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.Pause","product":"core","slug":"io-github-libtmux-control-notification-notification-pause"},{"id":"io.github.libtmux.control.Notification.Notification.Pause.pane","name":"pane","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.Pause","modifiers":[],"signatures":[{"params":[],"returns":"PaneId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.Pause.pane","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.Pause.pane","product":"core","slug":"io-github-libtmux-control-notification-notification-pause-pane"},{"id":"io.github.libtmux.control.Notification.Notification.Continue","name":"Continue","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record Continue(PaneId pane) implements Notification","params":[{"name":"pane","type":"PaneId"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %continue}: a paused pane's output flows to this client again. tmux 3.2 and later."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":93,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.Continue","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.Continue","product":"core","slug":"io-github-libtmux-control-notification-notification-continue"},{"id":"io.github.libtmux.control.Notification.Notification.Continue.pane","name":"pane","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.Continue","modifiers":[],"signatures":[{"params":[],"returns":"PaneId"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.Continue.pane","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.Continue.pane","product":"core","slug":"io-github-libtmux-control-notification-notification-continue-pane"},{"id":"io.github.libtmux.control.Notification.Notification.Message","name":"Message","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record Message(String text) implements Notification","params":[{"name":"text","type":"String"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %message}: text another client showed on this one with {@code display-message -c}. tmux 3.4 and later."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":96,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.Message","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.Message","product":"core","slug":"io-github-libtmux-control-notification-notification-message"},{"id":"io.github.libtmux.control.Notification.Notification.Message.text","name":"text","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.Message","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.Message.text","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.Message.text","product":"core","slug":"io-github-libtmux-control-notification-notification-message-text"},{"id":"io.github.libtmux.control.Notification.Notification.ConfigError","name":"ConfigError","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record ConfigError(String cause) implements Notification","params":[{"name":"cause","type":"String"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %config-error}: a configuration file tmux loaded for this client had an error. tmux 3.4 and later."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":99,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.ConfigError","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.ConfigError","product":"core","slug":"io-github-libtmux-control-notification-notification-configerror"},{"id":"io.github.libtmux.control.Notification.Notification.ConfigError.cause","name":"cause","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.ConfigError","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.ConfigError.cause","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.ConfigError.cause","product":"core","slug":"io-github-libtmux-control-notification-notification-configerror-cause"},{"id":"io.github.libtmux.control.Notification.Notification.Exit","name":"Exit","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record Exit(Optional reason) implements Notification","params":[{"name":"reason","type":"Optional"}]}],"typeScopeBoundary":true,"doc":{"summary":"{@code %exit}: the client is exiting, with tmux's reason when it gave one."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":102,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.Exit","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.Exit","product":"core","slug":"io-github-libtmux-control-notification-notification-exit"},{"id":"io.github.libtmux.control.Notification.Notification.Exit.reason","name":"reason","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.Exit","modifiers":[],"signatures":[{"params":[],"returns":"Optional"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.Exit.reason","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.Exit.reason","product":"core","slug":"io-github-libtmux-control-notification-notification-exit-reason"},{"id":"io.github.libtmux.control.Notification.Notification.Unknown","name":"Unknown","kind":"class","modifiers":[],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"record Unknown(String kind) implements Notification","params":[{"name":"kind","type":"String"}]}],"typeScopeBoundary":true,"doc":{"summary":"A notification this library does not model; {@link ControlEvent} still carries all of it."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":105,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.Unknown","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.Unknown","product":"core","slug":"io-github-libtmux-control-notification-notification-unknown"},{"id":"io.github.libtmux.control.Notification.Notification.Unknown.kind","name":"kind","kind":"method","parent":"io.github.libtmux.control.Notification.Notification.Unknown","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.Unknown.kind","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.Unknown.kind","product":"core","slug":"io-github-libtmux-control-notification-notification-unknown-kind"},{"id":"io.github.libtmux.control.Notification.Notification.read","name":"read","kind":"method","modifiers":["static"],"parent":"io.github.libtmux.control.Notification.Notification","signatures":[{"raw":"static Notification read(String kind, String rest, Optional value)","params":[{"name":"kind","type":"String","doc":"the name without its {@code %}"},{"name":"rest","type":"String","doc":"what followed the name, as tmux wrote it, without any {@code \" : \"} value"},{"name":"value","type":"Optional","doc":"what followed {@code \" : \"}, which only a subscription carries"}],"returns":"Notification","typeScopeBoundary":true}],"doc":{"summary":"Reads one notification from its kind and the text after it."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/Notification.java","line":114,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.Notification.read","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.Notification.Notification.read","product":"core","slug":"io-github-libtmux-control-notification-notification-read"},{"id":"io.github.libtmux.control.PaneOutput.PaneOutput","name":"PaneOutput","kind":"class","modifiers":[],"signatures":[{"raw":"public record PaneOutput(PaneId pane, String data, ByteBuffer bytes)","params":[{"name":"pane","type":"PaneId","doc":"the pane that produced it"},{"name":"data","type":"String","doc":"this piece as text"},{"name":"bytes","type":"ByteBuffer","doc":"this piece exactly, read-only"}]}],"typeScopeBoundary":false,"doc":{"summary":"Terminal output tmux pushed without being asked.","body":"tmux cuts a pane's output into pieces by byte count, not by character. {@code bytes} is\nexactly what one piece carried, so a pane's pieces concatenate to what it wrote. {@code data} is\nthe same output as text, decoded per pane: a character cut between two pieces arrives whole with\nthe later one, and a byte that is not UTF-8 is written {@code \\xHH}."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/PaneOutput.java","line":20,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.PaneOutput","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.PaneOutput.PaneOutput","product":"core","slug":"io-github-libtmux-control-paneoutput-paneoutput"},{"id":"io.github.libtmux.control.PaneOutput.PaneOutput.PaneOutput","name":"PaneOutput","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.PaneOutput.PaneOutput","signatures":[{"raw":"public PaneOutput(PaneId pane, String data)","params":[{"name":"pane","type":"PaneId"},{"name":"data","type":"String"}],"typeScopeBoundary":false}],"doc":{"summary":"Output whose bytes are {@code data} in UTF-8."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/PaneOutput.java","line":33,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.PaneOutput.PaneOutput","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.PaneOutput.PaneOutput.PaneOutput","product":"core","slug":"io-github-libtmux-control-paneoutput-paneoutput-paneoutput"},{"id":"io.github.libtmux.control.PaneOutput.PaneOutput.bytes","name":"bytes","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.PaneOutput.PaneOutput","signatures":[{"raw":"@Override\n public ByteBuffer bytes()","params":[],"returns":"ByteBuffer","typeScopeBoundary":false}],"doc":{"summary":"This piece's bytes, read-only, positioned at the first."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/PaneOutput.java","line":38,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.PaneOutput.bytes","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.PaneOutput.PaneOutput.bytes","product":"core","slug":"io-github-libtmux-control-paneoutput-paneoutput-bytes"},{"id":"io.github.libtmux.control.PaneOutput.PaneOutput.toString","name":"toString","kind":"method","modifiers":[],"parent":"io.github.libtmux.control.PaneOutput.PaneOutput","signatures":[{"raw":"@Override\n public String toString()","params":[],"returns":"String","typeScopeBoundary":false}],"doc":{"summary":"Identifies the pane only: the data is terminal content."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/PaneOutput.java","line":44,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.PaneOutput.toString","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.PaneOutput.PaneOutput.toString","product":"core","slug":"io-github-libtmux-control-paneoutput-paneoutput-tostring"},{"id":"io.github.libtmux.control.PaneOutput.PaneOutput.pane","name":"pane","kind":"method","parent":"io.github.libtmux.control.PaneOutput.PaneOutput","modifiers":[],"signatures":[{"params":[],"returns":"PaneId"}],"doc":{"summary":"the pane that produced it"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/PaneOutput.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.PaneOutput.pane","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.PaneOutput.PaneOutput.pane","product":"core","slug":"io-github-libtmux-control-paneoutput-paneoutput-pane"},{"id":"io.github.libtmux.control.PaneOutput.PaneOutput.data","name":"data","kind":"method","parent":"io.github.libtmux.control.PaneOutput.PaneOutput","modifiers":[],"signatures":[{"params":[],"returns":"String"}],"doc":{"summary":"this piece as text"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/control/PaneOutput.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.control.PaneOutput.data","namespace":"io.github.libtmux.control","publicId":"io.github.libtmux.control.PaneOutput.PaneOutput.data","product":"core","slug":"io-github-libtmux-control-paneoutput-paneoutput-data"},{"id":"io.github.libtmux.Dimensions.Dimensions","name":"Dimensions","kind":"class","modifiers":[],"signatures":[{"raw":"public record Dimensions(int width, int height)","params":[{"name":"width","type":"int","doc":"columns"},{"name":"height","type":"int","doc":"rows"}]}],"typeScopeBoundary":false,"doc":{"summary":"How big something is, in terminal cells.","body":"A pair rather than two loose numbers, because width and height are only meaningful together and\na call site that takes them separately can transpose them without the compiler noticing."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Dimensions.java","line":12,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Dimensions","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Dimensions.Dimensions","product":"core","slug":"io-github-libtmux-dimensions-dimensions"},{"id":"io.github.libtmux.Dimensions.Dimensions.toString","name":"toString","kind":"method","modifiers":[],"parent":"io.github.libtmux.Dimensions.Dimensions","signatures":[{"raw":"@Override\n public String toString()","params":[],"returns":"String","typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/Dimensions.java","line":20,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Dimensions.toString","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Dimensions.Dimensions.toString","product":"core","slug":"io-github-libtmux-dimensions-dimensions-tostring"},{"id":"io.github.libtmux.Dimensions.Dimensions.width","name":"width","kind":"method","parent":"io.github.libtmux.Dimensions.Dimensions","modifiers":[],"signatures":[{"params":[],"returns":"int"}],"doc":{"summary":"columns"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Dimensions.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Dimensions.width","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Dimensions.Dimensions.width","product":"core","slug":"io-github-libtmux-dimensions-dimensions-width"},{"id":"io.github.libtmux.Dimensions.Dimensions.height","name":"height","kind":"method","parent":"io.github.libtmux.Dimensions.Dimensions","modifiers":[],"signatures":[{"params":[],"returns":"int"}],"doc":{"summary":"rows"},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Dimensions.java","repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Dimensions.height","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Dimensions.Dimensions.height","product":"core","slug":"io-github-libtmux-dimensions-dimensions-height"},{"id":"io.github.libtmux.Direction.Direction","name":"Direction","kind":"enum","modifiers":[],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"Which way to move or grow something.","body":"An enum rather than tmux's {@code -U -D -L -R} flags, so a call site says which way it means\nand a wrong direction cannot be spelled at all."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Direction.java","line":9,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Direction","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Direction.Direction","product":"core","slug":"io-github-libtmux-direction-direction"},{"id":"io.github.libtmux.Direction.Direction.UP","name":"UP","kind":"constant","modifiers":[],"parent":"io.github.libtmux.Direction.Direction","signatures":[],"typeScopeBoundary":true,"source":{"file":"libtmux/src/main/java/io/github/libtmux/Direction.java","line":10,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Direction.UP","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Direction.Direction.UP","product":"core","slug":"io-github-libtmux-direction-direction-up"},{"id":"io.github.libtmux.Direction.Direction.DOWN","name":"DOWN","kind":"constant","modifiers":[],"parent":"io.github.libtmux.Direction.Direction","signatures":[],"typeScopeBoundary":true,"source":{"file":"libtmux/src/main/java/io/github/libtmux/Direction.java","line":11,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Direction.DOWN","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Direction.Direction.DOWN","product":"core","slug":"io-github-libtmux-direction-direction-down"},{"id":"io.github.libtmux.Direction.Direction.LEFT","name":"LEFT","kind":"constant","modifiers":[],"parent":"io.github.libtmux.Direction.Direction","signatures":[],"typeScopeBoundary":true,"source":{"file":"libtmux/src/main/java/io/github/libtmux/Direction.java","line":12,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Direction.LEFT","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Direction.Direction.LEFT","product":"core","slug":"io-github-libtmux-direction-direction-left"},{"id":"io.github.libtmux.Direction.Direction.RIGHT","name":"RIGHT","kind":"constant","modifiers":[],"parent":"io.github.libtmux.Direction.Direction","signatures":[],"typeScopeBoundary":true,"source":{"file":"libtmux/src/main/java/io/github/libtmux/Direction.java","line":13,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Direction.RIGHT","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Direction.Direction.RIGHT","product":"core","slug":"io-github-libtmux-direction-direction-right"},{"id":"io.github.libtmux.Direction.Direction.Direction","name":"Direction","kind":"method","modifiers":[],"parent":"io.github.libtmux.Direction.Direction","signatures":[{"raw":"Direction(String flag)","params":[{"name":"flag","type":"String"}],"typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/Direction.java","line":17,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Direction.Direction","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Direction.Direction.Direction","product":"core","slug":"io-github-libtmux-direction-direction-direction"},{"id":"io.github.libtmux.Direction.Direction.flag","name":"flag","kind":"method","modifiers":[],"parent":"io.github.libtmux.Direction.Direction","signatures":[{"raw":"String flag()","params":[],"returns":"String","typeScopeBoundary":false}],"doc":{"summary":"The tmux flag that selects this direction."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Direction.java","line":22,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Direction.flag","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Direction.Direction.flag","product":"core","slug":"io-github-libtmux-direction-direction-flag"},{"id":"io.github.libtmux.Environment.Environment","name":"Environment","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"The environment tmux gives to processes it starts, at one scope.","body":"tmux keeps one environment per server and one per session, and hands the result to every\nprocess it spawns afterwards. That is what this is for: a pane opened later sees what is set here,\nso it is how a program refreshes a value that goes stale in a long-lived session — {@code\nSSH_AUTH_SOCK} after reconnecting, a token, a display.\n\nA scope is chosen when the view is obtained rather than passed to every call, as {@link\nOptions} does, so a caller cannot read one scope and write another. There are only the two scopes,\nbecause tmux has only those two.\n\nA name is in one of three states, and they are not the same question. It can be *set* to\na value, which {@link #get} answers. It can be *removed*, which is tmux's way of saying a\nnew process should not inherit it even though the server's own environment has it — {@link\n#isRemoved} answers that, and {@link #get} is empty for it. Or it can simply be absent, which is\nboth of those empty."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Environment.java","line":38,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Environment","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Environment.Environment","product":"core","slug":"io-github-libtmux-environment-environment"},{"id":"io.github.libtmux.Environment.Environment.global","name":"global","kind":"method","modifiers":["static"],"parent":"io.github.libtmux.Environment.Environment","signatures":[{"raw":"static Environment global(Server server)","params":[{"name":"server","type":"Server"}],"returns":"Environment","typeScopeBoundary":true}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/Environment.java","line":69,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Environment.global","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Environment.Environment.global","product":"core","slug":"io-github-libtmux-environment-environment-global"},{"id":"io.github.libtmux.Environment.Environment.session","name":"session","kind":"method","modifiers":["static"],"parent":"io.github.libtmux.Environment.Environment","signatures":[{"raw":"static Environment session(Server server, ServerSnapshot snapshot, SessionId session)","params":[{"name":"server","type":"Server"},{"name":"snapshot","type":"ServerSnapshot"},{"name":"session","type":"SessionId"}],"returns":"Environment","typeScopeBoundary":true}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/Environment.java","line":73,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Environment.session","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Environment.Environment.session","product":"core","slug":"io-github-libtmux-environment-environment-session"},{"id":"io.github.libtmux.Environment.Environment.get","name":"get","kind":"method","modifiers":[],"parent":"io.github.libtmux.Environment.Environment","signatures":[{"raw":"@Operation(Kind.READ)\n public Optional get(String name)","params":[{"name":"name","type":"String"}],"returns":"Optional","typeScopeBoundary":false,"raises":[{"type":"ServerUnavailableException","doc":"if no daemon is running"},{"type":"LibTmuxException","doc":"if the read otherwise fails"}]}],"doc":{"summary":"The value set for this name, or empty when it is removed or absent."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Environment.java","line":83,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Environment.get","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Environment.Environment.get","product":"core","slug":"io-github-libtmux-environment-environment-get"},{"id":"io.github.libtmux.Environment.Environment.isRemoved","name":"isRemoved","kind":"method","modifiers":[],"parent":"io.github.libtmux.Environment.Environment","signatures":[{"raw":"@Operation(Kind.READ)\n public boolean isRemoved(String name)","params":[{"name":"name","type":"String"}],"returns":"boolean","typeScopeBoundary":false,"raises":[{"type":"ServerUnavailableException","doc":"if no daemon is running"},{"type":"LibTmuxException","doc":"if the read otherwise fails"}]}],"doc":{"summary":"Whether new processes are told not to inherit this name."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Environment.java","line":94,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Environment.isRemoved","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Environment.Environment.isRemoved","product":"core","slug":"io-github-libtmux-environment-environment-isremoved"},{"id":"io.github.libtmux.Environment.Environment.all","name":"all","kind":"method","modifiers":[],"parent":"io.github.libtmux.Environment.Environment","signatures":[{"raw":"@ReadOnly\n @Operation(Kind.READ)\n public Map all()","params":[],"returns":"Map","typeScopeBoundary":false}],"doc":{"summary":"Every name set at this scope, in tmux's order. Removed names are not values, so not here."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Environment.java","line":100,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Environment.all","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Environment.Environment.all","product":"core","slug":"io-github-libtmux-environment-environment-all"},{"id":"io.github.libtmux.Environment.Environment.effective","name":"effective","kind":"method","modifiers":[],"parent":"io.github.libtmux.Environment.Environment","signatures":[{"raw":"@ReadOnly\n @Operation(Kind.READ)\n public Map effective()","params":[],"returns":"Map","typeScopeBoundary":false,"raises":[{"type":"ServerUnavailableException","doc":"if no daemon is running"},{"type":"LibTmuxException","doc":"if a read otherwise fails"}]}],"doc":{"summary":"What a process started from this scope is actually handed, both scopes taken together.","body":"{@link #all} answers for one scope, which is what a caller writing to it needs and not what\na pane opened later will see: tmux gives a new process the server's environment with the\nsession's laid over it, minus whatever the session marked as not to be inherited. At the\nserver scope the two are the same thing.\n\nThe counterpart to {@link Options#effective()}, and named after it."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Environment.java","line":123,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Environment.effective","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Environment.Environment.effective","product":"core","slug":"io-github-libtmux-environment-environment-effective"},{"id":"io.github.libtmux.Environment.Environment.removed","name":"removed","kind":"method","modifiers":[],"parent":"io.github.libtmux.Environment.Environment","signatures":[{"raw":"@ReadOnly\n @Operation(Kind.READ)\n public Set removed()","params":[],"returns":"Set","typeScopeBoundary":false}],"doc":{"summary":"Every name this scope tells a new process not to inherit."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Environment.java","line":136,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Environment.removed","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Environment.Environment.removed","product":"core","slug":"io-github-libtmux-environment-environment-removed"},{"id":"io.github.libtmux.Environment.Environment.set","name":"set","kind":"method","modifiers":[],"parent":"io.github.libtmux.Environment.Environment","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public void set(String name, String value)","params":[{"name":"name","type":"String"},{"name":"value","type":"String"}],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Sets a name to a literal value.","body":"The value is not expanded: a {@code #{...}} in it arrives as those characters. {@link\n#setExpanded} is how to ask for the other thing."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Environment.java","line":154,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Environment.set","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Environment.Environment.set","product":"core","slug":"io-github-libtmux-environment-environment-set"},{"id":"io.github.libtmux.Environment.Environment.setExpanded","name":"setExpanded","kind":"method","modifiers":[],"parent":"io.github.libtmux.Environment.Environment","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public void setExpanded(String name, String format)","params":[{"name":"name","type":"String"},{"name":"format","type":"String"}],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Sets a name to what a tmux format expands to now."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Environment.java","line":160,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Environment.setExpanded","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Environment.Environment.setExpanded","product":"core","slug":"io-github-libtmux-environment-environment-setexpanded"},{"id":"io.github.libtmux.Environment.Environment.unset","name":"unset","kind":"method","modifiers":[],"parent":"io.github.libtmux.Environment.Environment","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public void unset(String name)","params":[{"name":"name","type":"String"}],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Removes the name from this scope, so it is neither set nor marked."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Environment.java","line":166,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Environment.unset","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Environment.Environment.unset","product":"core","slug":"io-github-libtmux-environment-environment-unset"},{"id":"io.github.libtmux.Environment.Environment.remove","name":"remove","kind":"method","modifiers":[],"parent":"io.github.libtmux.Environment.Environment","signatures":[{"raw":"@Operation(Kind.MUTATION)\n public void remove(String name)","params":[{"name":"name","type":"String"}],"returns":"void","typeScopeBoundary":false}],"doc":{"summary":"Tells processes started after this not to inherit the name.","body":"Different from {@link #unset}: the name is remembered, as removed, and tmux subtracts it\nfrom what a new process is given rather than simply not adding it."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/Environment.java","line":177,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.Environment.remove","namespace":"io.github.libtmux","publicId":"io.github.libtmux.Environment.Environment.remove","product":"core","slug":"io-github-libtmux-environment-environment-remove"},{"id":"io.github.libtmux.exception.CardinalityException.CardinalityException","name":"CardinalityException","kind":"class","modifiers":["abstract"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"A lookup that required exactly one match, or at most one, did not get it.","body":"Loosen or tighten the filter, or handle the case explicitly."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/exception/CardinalityException.java","line":8,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.exception.CardinalityException","namespace":"io.github.libtmux.exception","publicId":"io.github.libtmux.exception.CardinalityException.CardinalityException","product":"core","slug":"io-github-libtmux-exception-cardinalityexception-cardinalityexception"},{"id":"io.github.libtmux.exception.CardinalityException.CardinalityException.CardinalityException","name":"CardinalityException","kind":"method","modifiers":[],"parent":"io.github.libtmux.exception.CardinalityException.CardinalityException","signatures":[{"raw":"CardinalityException(String message)","params":[{"name":"message","type":"String"}],"typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/exception/CardinalityException.java","line":13,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.exception.CardinalityException.CardinalityException","namespace":"io.github.libtmux.exception","publicId":"io.github.libtmux.exception.CardinalityException.CardinalityException.CardinalityException","product":"core","slug":"io-github-libtmux-exception-cardinalityexception-cardinalityexception-cardinalityexception"},{"id":"io.github.libtmux.exception.CardinalityException.CardinalityException.NoMatch","name":"NoMatch","kind":"class","modifiers":["static","readonly"],"parent":"io.github.libtmux.exception.CardinalityException.CardinalityException","signatures":[],"typeScopeBoundary":true,"doc":{"summary":"Nothing matched where the caller required something."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/exception/CardinalityException.java","line":18,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.exception.CardinalityException.NoMatch","namespace":"io.github.libtmux.exception","publicId":"io.github.libtmux.exception.CardinalityException.CardinalityException.NoMatch","product":"core","slug":"io-github-libtmux-exception-cardinalityexception-cardinalityexception-nomatch"},{"id":"io.github.libtmux.exception.CardinalityException.CardinalityException.NoMatch.NoMatch","name":"NoMatch","kind":"method","modifiers":[],"parent":"io.github.libtmux.exception.CardinalityException.CardinalityException.NoMatch","signatures":[{"raw":"public NoMatch(String message)","params":[{"name":"message","type":"String"}],"typeScopeBoundary":false}],"source":{"file":"libtmux/src/main/java/io/github/libtmux/exception/CardinalityException.java","line":21,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.exception.CardinalityException.NoMatch.NoMatch","namespace":"io.github.libtmux.exception","publicId":"io.github.libtmux.exception.CardinalityException.CardinalityException.NoMatch.NoMatch","product":"core","slug":"io-github-libtmux-exception-cardinalityexception-cardinalityexception-nomatch-nomatch"},{"id":"io.github.libtmux.exception.CardinalityException.CardinalityException.MultipleMatches","name":"MultipleMatches","kind":"class","modifiers":["static","readonly"],"parent":"io.github.libtmux.exception.CardinalityException.CardinalityException","signatures":[],"typeScopeBoundary":true,"doc":{"summary":"More than one thing matched where the caller required at most one."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/exception/CardinalityException.java","line":27,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.exception.CardinalityException.MultipleMatches","namespace":"io.github.libtmux.exception","publicId":"io.github.libtmux.exception.CardinalityException.CardinalityException.MultipleMatches","product":"core","slug":"io-github-libtmux-exception-cardinalityexception-cardinalityexception-multiplematches"},{"id":"io.github.libtmux.exception.CardinalityException.CardinalityException.MultipleMatches.MultipleMatches","name":"MultipleMatches","kind":"method","modifiers":[],"parent":"io.github.libtmux.exception.CardinalityException.CardinalityException.MultipleMatches","signatures":[{"raw":"public MultipleMatches(String message, int atLeast)","params":[{"name":"message","type":"String"},{"name":"atLeast","type":"int","doc":"how many matched, at least; never less than two"}],"typeScopeBoundary":false}],"doc":{"summary":""},"source":{"file":"libtmux/src/main/java/io/github/libtmux/exception/CardinalityException.java","line":33,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.exception.CardinalityException.MultipleMatches.MultipleMatches","namespace":"io.github.libtmux.exception","publicId":"io.github.libtmux.exception.CardinalityException.CardinalityException.MultipleMatches.MultipleMatches","product":"core","slug":"io-github-libtmux-exception-cardinalityexception-cardinalityexception-multiplematches-multiplematches"},{"id":"io.github.libtmux.exception.CardinalityException.CardinalityException.MultipleMatches.atLeast","name":"atLeast","kind":"method","modifiers":[],"parent":"io.github.libtmux.exception.CardinalityException.CardinalityException.MultipleMatches","signatures":[{"raw":"public int atLeast()","params":[],"returns":"int","typeScopeBoundary":false}],"doc":{"summary":"How many matched, at least.","body":"Exact when the matches came from a capture this library holds, as a handle lookup's do.\n{@link io.github.libtmux.query.Selections} stops at the second match, since its source may be\nlazy or unbounded, so there it is two."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/exception/CardinalityException.java","line":48,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.exception.CardinalityException.MultipleMatches.atLeast","namespace":"io.github.libtmux.exception","publicId":"io.github.libtmux.exception.CardinalityException.CardinalityException.MultipleMatches.atLeast","product":"core","slug":"io-github-libtmux-exception-cardinalityexception-cardinalityexception-multiplematches-atleast"},{"id":"io.github.libtmux.exception.CommandRejectedException.CommandRejectedException","name":"CommandRejectedException","kind":"class","modifiers":["readonly"],"signatures":[],"typeScopeBoundary":false,"doc":{"summary":"tmux ran a command to completion and refused it.","body":"The request reached a live server and tmux answered no: a duplicate session name, a target it\ncannot find, an option it does not know. Resending the same command gets the same answer, so read\n{@link #errorLines()} and change the request."},"source":{"file":"libtmux/src/main/java/io/github/libtmux/exception/CommandRejectedException.java","line":12,"repo":"libtmux/libtmux-java","revision":"a0ecbc16da00140e2520462d478a2af470878272","extractedRevision":"a0ecbc16da00140e2520462d478a2af470878272"},"qualifiedName":"io.github.libtmux.exception.CommandRejectedException","namespace":"io.github.libtmux.exception","publicId":"io.github.libtmux.exception.CommandRejectedException.CommandRejectedException","product":"core","slug":"io-github-libtmux-exception-commandrejectedexception-commandrejectedexception"},{"id":"io.github.libtmux.exception.CommandRejectedException.CommandRejectedException.CommandRejectedException","name":"CommandRejectedException","kind":"method","modifiers":["overload"],"parent":"io.github.libtmux.exception.CommandRejectedException.CommandRejectedException","signatures":[{"raw":"public CommandRejectedException(String message)","params":[{"name":"message","type":"String"}],"typeScopeBoundary":false},{"raw":"public CommandRejectedException(String message, String command, int exitCode, List