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

Captures every pane on the server.

Source and package
Qualified name
io.github.libtmux.scaladsl.cats.Server.panes
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.Language documentation [F[_]](self: Server[F])(using F: _root_.cats.effect.Async[F] ) Scala method declarationsDeclares a method, with its name, parameter lists and return type.Language documentation panes(): F[Vector[Pane[F]]]Scala extension methodsAdds methods callable on the receiver type without changing its definition.Language documentation [F[_]](self: Server[F])(using F: _root_.cats.effect.Async[F] ) Scala method declarationsDeclares a method, with its name, parameter lists and return type.Language documentation panes( expression: io.github.libtmux.scaladsl.query.Expr[ io.github.libtmux.Pane ] ): F[Vector[Pane[F]]]
Type parameters
Parameters

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 {
scala
application
}
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 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/ListPanes.scala. It starts a private tmux server of its own and stops it when the program closes it. View source

src/main/scala/ListPanes.scalaComplete program
package io.github.libtmux.examples.api.scalacats
import 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 panes, then the panes captured for one window. */
object ListPanes 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()
)
panes <- server.panes()
_ <- IO.println(s"panes=${panes.size}")
found <- server.session("work-one")
session <- IO.fromOption(found)(
new IllegalStateException("missing work-one")
)
window <- IO.fromOption(
session.windows.find(_.name.equals("editor"))
)(
new IllegalStateException("missing editor")
)
_ <- IO.println(s"window-panes=${window.panes.size}")
} 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.ListPanes && \
build/install/api-example/bin/api-example

Expected output:

panes=4
window-panes=2

Same owner

containment 1 of 48 shown

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

All 48 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.cats.Server.panes.

tmux command

task material

The tmux commands behind panes.

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 panes. 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 panes in each port
PortAPIDiffers from Scala
Scala io.github.libtmux.scaladsl.cats.Server.panes
Captures every pane on the server.
This page
Python libtmux.Server.panes
Panes contained in tmux server (across all windows in all sessions).
None recorded in the model
Ruby LibTmux::Server#list_panes
Behavior: Live acquisition.
None recorded in the model
Lua libtmux.Snapshot.panes None recorded in the model
PowerShell LibTmux\Get-TmuxPane
Read panes from a server, session or window.
free function3 overloads
Use the -Server parameter set to acquire panes across the server.
Julia LibTmux.panes free function
panes with a Snapshot reads every captured physical pane. Use paneoccurrences for session placements.
Erlang tmux_snapshot:panes/1
Return unique captured physical panes in numeric ID order without I/O. related/3 orders panes within a window by pane index.
free function
Returns unique captured physical panes without tmux I/O.
Elixir LibTmux.Snapshot.panes/1
Returns a materialized physical pane selection without I/O.
on Snapshot
Returns a Selection of every captured physical pane without contacting tmux.
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.
free function3 overloads
panes on a snapshot returns captured physical panes once each.
TypeScript server.Server.panes
Every pane on the server.
async
Rust server.Server.panes
List every pane on the server, preserving any failure.
async
Go tmux.Server.Panes
Panes materializes pane records for every winlink. Failures, including ErrNoServer, remain errors rather than empty results.
None recorded in the model
Java io.github.libtmux.Server.panes
Captures every pane on the server.
None recorded in the model
Clojure libtmux.core/panes!
Acquires captured pane occurrences.
free function
Acquires a new graph and returns its pane occurrences.
Kotlin io.github.libtmux.kotlin.Server.panes
Captures every pane on the server.
async
C# LibTmux.Server.Panes
Gets the panes this handle captured, across every window.
None recorded in the model
F# LibTmux.FSharp.Server.panes
Queries every pane.
free function
Builds a deferred pane query on the shared .NET LibTmux.Server. Query.list acquires panes across that server.
C++ libtmux::Server::panes readonly
Swift Server.panes()
Every pane on this server, in tmux's own order. A pane whose window has several session links appears once.
async
OCaml Libtmux.Snapshot.panes free function
Perl LibTmux::Snapshot::panes
Return a fresh LibTmux::PaneSelection containing each physical pane identity once. Membership edits cannot change the graph store.
on Snapshot
One entry per captured physical pane; raw listings preserve contextual rows separately.
Raku LibTmux::Model::Snapshot.panes
Captured physical panes; relation traversal never acquires newer data.
on Snapshot
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