Core Library0.xAPI reference

Choose documentation 1

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

property libtmux-kotlin

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
public val panes: List<Pane>

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/cat and /bin/sh available. In an empty directory, save this consumer setup as settings.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 source

gradle.properties
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=768m -Dfile.encoding=UTF-8
kotlin.daemon.jvmargs=-Xmx2g
org.gradle.workers.max=2

Save 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 source

src/main/kotlin/ListPanes.ktComplete program
package io.github.libtmux.examples.api.kotlin
import io.github.libtmux.SplitSpec
import io.github.libtmux.kotlin.*
import io.github.libtmux.kotlin.query.name
import kotlin.system.exitProcess
import 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-example

Expected output:

panes=4
window-panes=2

In other ports

task equivalence 19 other ports mapped

Source-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.

List a window's panes in each port
PortAPIDiffers from Kotlin
Kotlin io.github.libtmux.kotlin.Window.panes
This link's panes, in tmux's order. A pure read of the capture.
This page
Python libtmux.Window.panes
Panes contained by window.
None recorded in the model
Ruby LibTmux::Window#list_panes
Behavior: Live acquisition.
None recorded in the model
PowerShell LibTmux\Get-TmuxPane
Read panes from a server, session or window.
3 overloads
Use the -Window parameter set to acquire panes in one window.
Julia LibTmux.panes 2 overloads
panes with a captured WindowSnapshot reads panes in that window; missing coverage is an error.
Erlang tmux_snapshot:related/3
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:panes
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.Window.panes
Panes of this window placement; a linked window keeps each set apart.
None recorded in the model
Rust window.Window.panes
List this window's panes, preserving any failure.
async
Go tmux.Window.Panes
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.github.libtmux.Window.panes
This link's panes, in tmux's order. A pure read of the capture.
None recorded in the model
Clojure libtmux.data/panes
Returns captured pane occurrences in a snapshot, session, or window.
Traverses one capture locally. It does not issue a list-panes command.
Scala io.github.libtmux.scaladsl.Window.panes
This link's panes.
2 overloads
C# LibTmux.Window.Panes
Gets the panes the capture found in this window.
None recorded in the model
F# LibTmux.FSharp.Window.panes
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::Window::panes readonly
Swift Snapshot.panes(of:)
The panes of a window, in tmux's order.
2 overloads
OCaml Libtmux.Window.panes
Reads captured panes in one global window without I/O.
Perl LibTmux::Window::panes
LibTmux::Selection of LibTmux::Pane entities. Local captured data; no I/O.
Reads this physical window’s captured panes without I/O.
Raku LibTmux::Model::Window.panes
Captured physical panes; relation traversal never acquires newer data.
None recorded in the model
No Haskell equivalent.

No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.

No equivalent is recorded in Lua or Elixir.

Esc
Search in

Type to search.

Reference previewOpen reference