Window.panes
This link's panes, in tmux's order. A pure read of the capture.
Source and package
- Qualified name
-
io.github .libtmux .kotlin .Window. panes - Package
- io.github.libtmux.kotlin
- Declared in
Window- Distribution
- io.github.libtmux:libtmux-kotlin
- Source
- libtmux-kotlin/src/main/kotlin/io/github/libtmux/kotlin/Window.kt
-
Examples
List all panes, then the panes captured for one window. Use JDK 25, Gradle 9 or newer, and tmux 3.3a or newer on Linux, with
/bin/catand/bin/shavailable. In an empty directory, save this consumer setup assettings.gradle.kts:rootProject.name = "api-example"Save this consumer setup as
build.gradle.kts. It depends on the 0.1.2 release from Maven Central:plugins {kotlin("jvm") version "2.4.10"application}repositories { mavenCentral() }dependencies {implementation("io.github.libtmux:libtmux-kotlin:0.1.2")}java { toolchain { languageVersion.set(JavaLanguageVersion.of(25)) } }kotlin { jvmToolchain(25) }application { mainClass.set(providers.gradleProperty("exampleMain")) }Save this consumer setup as
gradle.properties: View sourcegradle.properties org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=768m -Dfile.encoding=UTF-8kotlin.daemon.jvmargs=-Xmx2gorg.gradle.workers.max=2Save this complete program as
src/main/kotlin/ListPanes.kt. It starts a private tmux server of its own and stops it when the program closes it. View sourcesrc/main/kotlin/ListPanes.ktComplete program package io.github.libtmux.examples.api.kotlinimport io.github.libtmux.SplitSpecimport io.github.libtmux.kotlin.*import io.github.libtmux.kotlin.query.nameimport kotlin.system.exitProcessimport kotlinx.coroutines.runBlocking/** List all panes, then the panes captured for one window. */fun main() {try {runBlocking {withPrivateServer { server ->val workOne = server.newSession {name = "work-one"window { name = "editor"; running("/bin/cat") }window { name = "logs"; running("/bin/cat") }}workOne.windows.first().split(SplitSpec.builder().toRight().running("/bin/cat").build())server.newSession {name = "work-two"window { name = "editor"; running("/bin/cat") }}println("panes=${server.panes().size}")val session = server.session(Session.name eq "work-one")val window = session.windows.single { it.name == "editor" }println("window-panes=${window.panes.size}")}}} catch (error: Exception) {if (error is InterruptedException) Thread.currentThread().interrupt()System.err.println("Example failed: ${error.message}")exitProcess(1)}}Build the minimal consumer with Gradle and run the saved program. An operation or cleanup error makes the command exit unsuccessfully:
Terminal window $ gradle --console=plain --quiet installDist -PexampleMain=io.github.libtmux.examples.api.kotlin.ListPanesKt && \build/install/api-example/bin/api-exampleExpected output:
panes=4window-panes=2
In other ports
task equivalence 19 other ports mappedSource-verified mappings for List a window's panes. A mapping says these APIs perform the same task. It does not say they share defaults, errors or completion: check each page.
| Port | API | Differs from Kotlin |
|---|---|---|
| Kotlin | io This link's panes, in tmux's order. A pure read of the capture. | This page |
| Python | libtmux Panes contained by window. | None recorded in the model |
| Ruby | Lib Behavior: Live acquisition. | None recorded in the model |
| PowerShell | Lib Read panes from a server, session or window. | 3 overloads Use the -Window parameter set to acquire panes in one window. |
| Julia | Lib | 2 overloads panes with a captured WindowSnapshot reads panes in that window; missing coverage is an error. |
| Erlang | tmux Traverse a complete captured relationship without I/O. To-many relations return lists; to-one relations return a row or known absence. The input row must belong to this snapshot. Unloaded relations and mismatched rows return tagged errors. | Pass panes, a captured physical window and its snapshot for a local relationship read. |
| Common Lisp | libtmux: Return a fresh vector of captured physical panes, without I/O.
Snapshots preserve first occurrence; windows preserve the captured pane order. | 3 overloads panes traverses a captured window without contacting tmux. |
| TypeScript | window Panes of this window placement; a linked window keeps each set apart. | None recorded in the model |
| Rust | window List this window's panes, preserving any failure. | async |
| Go | tmux Panes returns newly allocated shallow copies of panes for this exact winlink, and reports whether the receiver carries relations at all. | None recorded in the model |
| Java | io This link's panes, in tmux's order. A pure read of the capture. | None recorded in the model |
| Clojure | libtmux Returns captured pane occurrences in a snapshot, session, or window. | Traverses one capture locally. It does not issue a list-panes command. |
| Scala | io This link's panes. | 2 overloads |
| C# | Lib Gets the panes the capture found in this window. | None recorded in the model |
| F# | Lib Queries the panes in a window. | Builds a deferred pane query from one LibTmux.Window and its server. Query.list acquires panes scoped to that window ID. |
| C++ | libtmux:: | readonly |
| Swift | Snapshot The panes of a window, in tmux's order. | 2 overloads |
| OCaml | Libtmux | Reads captured panes in one global window without I/O. |
| Perl | Lib LibTmux::Selection of LibTmux::Pane entities. Local captured data; no I/O. | Reads this physical window’s captured panes without I/O. |
| Raku | Lib Captured physical panes; relation traversal never acquires newer data. | None recorded in the model |
No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
No equivalent is recorded in Lua or Elixir.