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

method libtmux-scala

Server.windows

Captures every winlink, preserving each session and index placement.

Source and package
Qualified name
io.github.libtmux.scaladsl.Server.windows
Package
io.github.libtmux.scaladsl
Declared in
Server
Distribution
io.github.libtmux:libtmux-scala_3
Source
libtmux-scala/build/generated/sources/catalog/scala/operations/GeneratedOperations.scala
Scala extension methodsAdds methods callable on the receiver type without changing its definition.Language documentation (self: Server) Scala method declarationsDeclares a method, with its name, parameter lists and return type.Language documentation windows(): Vector[Window]Scala extension methodsAdds methods callable on the receiver type without changing its definition.Language documentation (self: Server) Scala method declarationsDeclares a method, with its name, parameter lists and return type.Language documentation windows( expression: io.github.libtmux.scaladsl.query.Expr[ io.github.libtmux.Window ] ): Vector[Window]Scala extension methodsAdds methods callable on the receiver type without changing its definition.Language documentation (self: Server) Scala method declarationsDeclares a method, with its name, parameter lists and return type.Language documentation windows(id: io.github.libtmux.WindowId): Vector[ Window ]

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/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 {
scala
application
}
repositories { mavenCentral() }
dependencies {
implementation("io.github.libtmux:libtmux-scala_3:0.1.2")
implementation("org.scala-lang:scala3-library_3:3.9.0")
}
java { toolchain { languageVersion.set(JavaLanguageVersion.of(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/scala/ListWindows.scala. It starts a private tmux server of its own and stops it when the program closes it. View source

src/main/scala/ListWindows.scalaComplete program
package io.github.libtmux.examples.api.scaladirect
import io.github.libtmux.{SessionSpec, SplitSpec, WindowSpec}
import io.github.libtmux.scaladsl.*
import scala.util.Using
import scala.util.control.NonFatal
/** List all windows, then the windows captured for one session. */
object ListWindows {
def main(args: Array[String]): Unit = {
try {
Using.resource(Server.start()) { server =>
val workOne = server.newSession(
SessionSpec
.builder()
.named("work-one")
.firstWindowNamed("editor")
.running("/bin/cat")
.build()
)
workOne.windows.head.split(
SplitSpec.builder().toRight().running("/bin/cat").build()
)
workOne.newWindow(
WindowSpec
.builder()
.named("logs")
.running("/bin/cat")
.detached()
.build()
)
server.newSession(
SessionSpec
.builder()
.named("work-two")
.firstWindowNamed("editor")
.running("/bin/cat")
.build()
)
println("windows=" + server.windows().map(_.name).sorted.mkString(","))
val session =
server.session("work-one").getOrElse(sys.error("missing work-one"))
println(
"session-windows=" + session.windows.map(_.name).sorted.mkString(",")
)
}
} catch {
case NonFatal(error) =>
System.err.println("Example failed: " + error.getMessage)
sys.exit(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.scaladirect.ListWindows && \
build/install/api-example/bin/api-example

Expected output:

windows=editor,editor,logs
session-windows=editor,logs

Same owner

containment 1 of 51 shown

Other members of io.github.libtmux.scaladsl.Server whose names share windows. They sit on the same type; that does not make them behave alike.

All 51 members of Server

Recorded calls

source calls
No call edges in the Scala model.

The Scala 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.scaladsl.Server.windows.

tmux command

task material

The tmux commands behind windows.

tmux C API

task material

The C declarations in tmux that implement these commands.

In other ports

task equivalence 21 other ports mapped

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

List the server's windows in each port
PortAPIDiffers from Scala
Scala io.github.libtmux.scaladsl.Server.windows
Captures every winlink, preserving each session and index placement.
This page
Python libtmux.Server.windows
Windows contained in server's sessions.
None recorded in the model
Ruby LibTmux::Server#list_windows
Behavior: Live acquisition.
None recorded in the model
Lua libtmux.Snapshot.windows None recorded in the model
PowerShell LibTmux\Get-TmuxWindow
Read contextual windows from a server or session.
free function
Use the -Server parameter set to acquire window placements across all sessions.
Julia LibTmux.windows free function
windows with a Snapshot reads every captured physical window. Use windowlinks for session placements.
Erlang tmux_snapshot:windows/1
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 LibTmux.Snapshot.windows/1
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:windows
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.Server.windows
Every window on the server, including each placement of a linked window.
async
Rust server.Server.windows
List every window on the server, preserving any failure.
async
Go tmux.Server.Windows
Windows materializes one record per winlink. Failures, including ErrNoServer, remain errors rather than empty results.
None recorded in the model
Java io.github.libtmux.Server.windows
Captures every winlink, preserving each session and index placement.
None recorded in the model
Clojure libtmux.core/windows!
Acquires captured window occurrences.
free function
Acquires a new graph and returns its window placements without deduplicating linked windows.
Kotlin io.github.libtmux.kotlin.Server.windows
Captures every winlink, preserving each session and index placement.
async
C# LibTmux.Server.Windows
Gets the windows this handle captured, across every session.
None recorded in the model
F# LibTmux.FSharp.Server.windows
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::Server::windows
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.windows()
Every window on this server, in tmux's own order.
async
OCaml Libtmux.Snapshot.windows free function
Reads captured global windows; use window_links for indexed session placements.
Perl LibTmux::Snapshot::windows
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 LibTmux::Model::Snapshot.windows
Captured physical windows, unique by daemon-scoped identity.
on Snapshot
Physical windows occur once; window-links preserves placements.
No Haskell equivalent.

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

Esc
Search in

Type to search.

Reference previewOpen reference