Core Library0.xGuides

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

Installation and requirements

Needs libtmux for Scala 0.x Install

Scala 3 collections and opaque handles over libtmux for Java.

libtmux.org libtmux-scala_3

Inspect and operate tmux through libtmux for Java with Scala collections. Server.panes returns an immutable Vector of handles, which are opaque aliases of the Java ones. The Cats module adds scoped effects.

io.github.libtmux:libtmux-scala_3 — the Scala artifacts are on Maven Central and release with the Java ones. API reference: libtmux.org for the current trunk, javadoc.io for a released version.

Releases are numbered 0.1.N, and each release increments N. The API is not settled: any release may change or remove exported identifiers, and the changelog marks each break. Pin an exact version to avoid one.

Contents — Quick start · What it leaves out · Support · Documentation

Quick start

libraryDependencies += "io.github.libtmux" %% "libtmux-scala" % "<version>"

From Gradle or Maven the coordinate is io.github.libtmux:libtmux-scala_3. The version is always libtmux’s own. Core depends on libtmux and the Scala 3 library only; Cats, FS2 and Ox arrive through libtmux-scala-cats and libtmux-scala-ox.

Server.panes: inspect captured panes

Start with a first client to build a ServerConfig from your tmux executable, socket and configuration file. Here config selects an existing server, and opening the client does not create a session:

import io.github.libtmux.scaladsl.{config => _, *}
import scala.util.Using
Using.resource(Server.open(config)) { server =>
val panes = server.panes()
val named = panes.filter(_.info.title().nonEmpty)
val commands = named.map(_.info.currentCommand())
assert(commands.size <= panes.size)
assert(panes.forall(p => p.window.info.context().equals(p.info.context())))
}

The operation closes its client and leaves tmux running.

  • Server.panes() acquires state. Reading info, traversing Pane.window, or filtering the captured vector performs no further tmux commands. A Window reaches its Session the same way.
  • refresh() returns a new capture.
  • A failed acquisition raises the original Java error. It does not become an empty vector.

What it leaves out

  • A Scala 2.13 build. There is none.
  • Effects in the core. Cats Effect and FS2 live in libtmux-scala-cats, and Ox in libtmux-scala-ox.
  • A parallel type. The handles are opaque aliases of the Java ones.

Support and status

  • Scala 3.9 and JDK 25 or newer.
  • tmux 3.3a through 3.8, the Java library’s range. Compatibility has the detail.
  • Releases. Releases are numbered 0.1.N, and each release increments N. The API is not settled: any release may change or remove exported identifiers, and the changelog marks each break. Pin an exact version to avoid one.

Documentation

  • Getting started: installation, a first owned client, and building from source.
  • Queries: native collections, the typed field DSL and strict cardinality.
  • Ownership: captured handles, borrowing and cleanup.
  • Execution: direct-style calls, bounded effects and command outcomes.
  • Streaming: subscriptions, cancellation and visible loss.
  • Compatibility: compilers, runtimes and what CI runs.
  • Examples: runnable programs, each executed against a real tmux.
  • Changelog — what each release of this module changed

The Java guide shows direct Java use without the facade. Source contracts live beside direct-style operations and Cats resources. For changes to existing APIs, see the repository’s migration notes.

Esc
Search in

Type to search.

Reference previewOpen reference