Server.windows
Captures every winlink, preserving each session and index placement.
Source and package
- Qualified name
-
io.github .libtmux .kotlin .Server. windows - Package
- io.github.libtmux.kotlin
- Declared in
Server- Distribution
- io.github.libtmux:libtmux-kotlin
- Source
- libtmux-kotlin/build/generated/sources/operations/kotlin/io/github/libtmux/kotlin/ServerOperations.kt
- public
Kotlin suspending functionsAllows a function to call suspending operations and pause without blocking a thread. It does not start a coroutine by itself. fun Server.windows(): List<Window>publicKotlin suspending functionsAllows a function to call suspending operations and pause without blocking a thread. It does not start a coroutine by itself. fun Server.windows( expression: FilterExpr <io.github > ): List<Window>public.libtmux .Window Kotlin suspending functionsAllows a function to call suspending operations and pause without blocking a thread. It does not start a coroutine by itself. fun Server.windows(id: WindowId ): List< Window > -
- Parameters
-
-
expression(FilterExpr <io.github >) for.libtmux .Window windows(expression)
-
Examples
List all windows, then the windows captured for one session. 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/ListWindows.kt. It starts a private tmux server of its own and stops it when the program closes it. View sourcesrc/main/kotlin/ListWindows.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 windows, then the windows captured for one session. */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("windows=" + server.windows().map { it.name }.sorted().joinToString(","))val session = server.session(Session.name eq "work-one")println("session-windows=" + session.windows.map { it.name }.sorted().joinToString(","))}}} 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.ListWindowsKt && \build/install/api-example/bin/api-exampleExpected output:
windows=editor,editor,logssession-windows=editor,logs
Same owner
containment 1 of 51 shownOther members of io.github.libtmux.kotlin.Server whose names share windows. They sit on the same type; that does not make them behave alike.
Recorded calls
source callsThe Kotlin reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls io.github.libtmux.kotlin.Server.windows.
tmux command
task materialThe tmux commands behind windows.
list-windows -a server scope, cmd_list_windows_exec tmux C API
task materialThe C declarations in tmux that implement these commands.
In other ports
task equivalence 21 other ports mappedSource-verified mappings for List the server's windows. 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 Captures every winlink, preserving each session and index placement. | This page |
| Python | libtmux Windows contained in server's sessions. | None recorded in the model |
| Ruby | Lib Behavior: Live acquisition. | None recorded in the model |
| Lua | libtmux | None recorded in the model |
| PowerShell | Lib Read contextual windows from a server or session. | free function Use the -Server parameter set to acquire window placements across all sessions. |
| Julia | Lib | free function windows with a Snapshot reads every captured physical window. Use windowlinks for session placements. |
| Erlang | tmux Return unique captured physical windows in numeric ID order. Performs no I/O. Use window_links/1 for session-relative membership and indexes. | free function Returns unique captured physical windows. window_links/1 lists session memberships. |
| Elixir | Lib Returns a materialized physical window selection without I/O. | on Snapshot Returns a Selection of every captured physical window. window_links/1 lists session placements. |
| Common Lisp | libtmux: Return a fresh vector of captured windows, without I/O.
Snapshot windows are physical entities in first-occurrence order. Session
windows contain one item per link and preserve repeated physical windows. | free function windows on a snapshot returns captured physical windows once each. |
| TypeScript | server Every window on the server, including each placement of a linked window. | None recorded in the model |
| Rust | server List every window on the server, preserving any failure. | None recorded in the model |
| Go | tmux Windows materializes one record per winlink. Failures, including ErrNoServer, remain errors rather than empty results. | None recorded in the model |
| Java | io Captures every winlink, preserving each session and index placement. | None recorded in the model |
| Clojure | libtmux Acquires captured window occurrences. | free function Acquires a new graph and returns its window placements without deduplicating linked windows. |
| Scala | io Captures every winlink, preserving each session and index placement. | None recorded in the model |
| C# | Lib Gets the windows this handle captured, across every session. | None recorded in the model |
| F# | Lib Queries window placements across all sessions. | free function Builds a deferred query for placements across all sessions. Query.list acquires the results; a linked window appears once for each session placement. |
| C++ | libtmux:: tmux scopes window and pane listings to the current session unless asked for every one, so -a is part of the request rather than a caller's responsibility to remember. | readonly |
| Swift | Server Every window on this server, in tmux's own order. | None recorded in the model |
| OCaml | Libtmux | free function Reads captured global windows; use window_links for indexed session placements. |
| Perl | Lib Return a fresh LibTmux::WindowSelection containing each physical window identity once. Context lives in "window_links". | on Snapshot One entry per physical identity. window_links retains all session placements. |
| Raku | Lib Captured physical windows, unique by daemon-scoped identity. | on Snapshot Physical windows occur once; window-links preserves placements. |
No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.