Server.windows
Captures every winlink, preserving each session and index placement.
Source and package
- Qualified name
-
io.github .libtmux .scaladsl .cats .Server. windows - Package
- io.github.libtmux.scaladsl.cats
- Declared in
Server- Distribution
- io.github.libtmux:libtmux-scala_3
- Source
- libtmux-scala-cats/build/generated/sources/catalog/scala/operations/GeneratedOperations.scala
-
Scala extension methodsAdds methods callable on the receiver type without changing its definition. [F[_]](self: Server[F])(using F: _root_.cats [F] ).effect .Async Scala method declarationsDeclares a method, with its name, parameter lists and return type. windows(): F[Vector[Window[F]]]Scala extension methodsAdds methods callable on the receiver type without changing its definition. [F[_]](self: Server[F])(using F: _root_.cats [F] ).effect .Async Scala method declarationsDeclares a method, with its name, parameter lists and return type. windows( expression: io.github [ io.libtmux .scaladsl .query .Expr .github ] ): F[Vector[Window[F]]].libtmux .Window Scala extension methodsAdds methods callable on the receiver type without changing its definition. [F[_]](self: Server[F])(using F: _root_.cats [F] ).effect .Async Scala method declarationsDeclares a method, with its name, parameter lists and return type. windows(id: io.github ): F[ Vector[Window[F]] ].libtmux .Window Id -
- Type parameters
- Parameters
-
-
expression(io.github [io.libtmux .scaladsl .query .Expr .github ]) for.libtmux .Window windows(expression) -
id(io.github ) for.libtmux .Window Id windows(id)
-
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 {scalaapplication}repositories { mavenCentral() }dependencies {implementation("io.github.libtmux:libtmux-scala-cats_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 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/scala/ListWindows.scala. It starts a private tmux server of its own and stops it when the program closes it. View sourcesrc/main/scala/ListWindows.scalaComplete program package io.github.libtmux.examples.api.scalacatsimport io.github.libtmux.{SessionSpec, SplitSpec, WindowSpec}import io.github.libtmux.scaladsl.cats.*import _root_.cats.effect.{ExitCode, IO, IOApp}import _root_.cats.syntax.all.*/** List all windows, then the windows captured for one session. */object ListWindows extends IOApp {def run(args: List[String]): IO[ExitCode] = {val program = Server.start[IO]().use { server =>for {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())windows <- server.windows()_ <- IO.println("windows=" + windows.map(_.name).sorted.mkString(","))found <- server.session("work-one")session <- IO.fromOption(found)(new IllegalStateException("missing work-one"))_ <- IO.println("session-windows=" + session.windows.map(_.name).sorted.mkString(","))} yield ()}program.as(ExitCode.Success).handleErrorWith { error =>IO(System.err.println("Example failed: " + error.getMessage)).as(ExitCode.Error)}}}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.scalacats.ListWindows && \build/install/api-example/bin/api-exampleExpected output:
windows=editor,editor,logssession-windows=editor,logs
Same owner
containment 1 of 48 shownOther members of io.github.libtmux.scaladsl.cats.Server whose names share windows. They sit on the same type; that does not make them behave alike.
Recorded calls
source callsThe 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.cats.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 Scala |
|---|---|---|
| Scala | 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. | async |
| Rust | server List every window on the server, preserving any failure. | async |
| 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. |
| Kotlin | io Captures every winlink, preserving each session and index placement. | async |
| 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. | async |
| 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.