Session.windows
This session's windows, in tmux's order.
Source and package
- Qualified name
-
io.github .libtmux .scaladsl .cats .Session. windows - Package
- io.github.libtmux.scaladsl.cats
- Declared in
Session- Distribution
- io.github.libtmux:libtmux-scala_3
- Source
- libtmux-scala-cats/build/generated/sources/catalog/scala/operations/GeneratedOperations.scala
-
- Type parameters
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
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.Session.windows.
In other ports
task equivalence 18 other ports mappedSource-verified mappings for List a session'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 This session's windows, in tmux's order. | This page |
| Python | libtmux Windows contained by session. | None recorded in the model |
| Ruby | Lib Behavior: Live acquisition. | None recorded in the model |
| PowerShell | Lib Read contextual windows from a server or session. | free function2 overloads Use the -Session parameter set to acquire placements in one session. |
| Julia | Lib | free function2 overloads windows with a captured SessionSnapshot reads distinct physical windows in that session. Use windowlinks for placements. |
| 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. | free function Pass windows, a captured session and its snapshot for a local relationship read. |
| 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 function3 overloads windows traverses a captured session. Repeated links preserve their physical-window multiplicity. |
| TypeScript | session Windows placed in this session, in listing order. | None recorded in the model |
| Rust | session List the windows linked into this session, preserving any failure. | async |
| Go | tmux Windows returns newly allocated shallow copies of this snapshot record's winlink views, and reports whether the receiver carries relations at all. | None recorded in the model |
| Java | io This session's windows, in tmux's order. A pure read of the capture. | None recorded in the model |
| Clojure | libtmux Returns the captured window occurrences in a snapshot or session. | free function Traverses one capture locally. It does not issue a list-windows command. |
| Kotlin | io This session's windows, in tmux's order. A pure read of the capture. | None recorded in the model |
| C# | Lib Gets the windows the capture found in this session. | None recorded in the model |
| F# | Lib Queries the window placements in a session. | free function Builds a deferred window query from one LibTmux.Session and its server. Query.list acquires placements scoped to that session ID. |
| C++ | libtmux:: | readonly |
| Swift | Snapshot The windows of a session, in tmux's order. | on Snapshot |
| OCaml | Libtmux Distinct windows in first-link order. All accesses are local. | free function Reads distinct captured global windows in this session. window_links preserves individual indexed placements. |
| Raku | Lib Captured session/index associations, including repeated links to one physical window. | Returns captured WindowLink placements. Follow each window relationship for the physical window. |
No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
Traverse Session::window_links and resolve each link’s window, preserving explicit session placement and multiplicity.
No equivalent is recorded in Lua or Elixir.