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

Kotlin API

API reference

Browse the Kotlin types and operations for working with tmux. Start with the core objects below, or search for a type or member.

27 types, 10 functions, 259 methods and 111 fields.

Also on Dokka · source libtmux/libtmux-java@4d77001ac74c
Server 2 types, 2 functions and constants
Server class 51 members

Manages sessions, windows, and panes on a tmux server.

LibTmuxDsl annotation

Marks every builder below so an inner block cannot reach an outer block's receiver by accident: split { directory = x } inside window { } resolves to the innermost SplitBuilder, never to the WindowBuilder it is nested in. Reaching the outer receiver on purpose still works, spelled explicitly (this@window.directory = x).

Starts a private tmux server, runs block, and ends the server — even if block throws or is cancelled. Closing it removes the server's directory and throws if the server still answers.

withServer function

Opens a Server, runs block, and closes it — even if block throws or is cancelled.

Session 2 types
Session class 26 members

A tmux session and its captured windows and properties.

SessionBuilder class 5 members

Configure a new session, its initial command, and its windows with Server.newSession.

Window 2 types
Window class 38 members

A tmux window at a specific position in a session.

WindowBuilder class 5 members

Configure a window and its pane splits inside a SessionBuilder block.

Pane 1 type
Pane class 53 members

A tmux pane, with operations for input, output, and layout.

Client 1 type
Client class 15 members

An attached tmux client and its captured properties.

Hooks 1 type
Hooks class 10 members

Read and update hooks for the server, session, window, or pane that owns this handle.

Options — Functions 2 functions and constants
orNull function In java.util.OptionalInt

The value, or null when absent: an exit status, a captured server pid.

orNull function In java.util.OptionalLong

The value, or null when absent.

Keys and bindings 1 type
Keys class 9 members

The server's key bindings, in one key table or across all of them.

Buffers 1 type
Buffers class 11 members

The tmux server's paste buffers.

Layout and geometry 1 type
SplitBuilder class 8 members

Choose the position, size, and working directory of a new pane split.

Environment 1 type
Environment class 14 members

Read and update environment variables used to start processes in tmux.

Commands 7 types, 1 function or constant
Batch class 9 members

Several tmux commands collected to run together in one invocation.

CommandChain class 13 members

A sequence of tmux commands where each one acts on what the last one made.

Commands class 6 members

The commands this tmux knows, read without starting a server to answer.

ExecutionPolicy class 4 members

Controls the dispatchers and concurrency limits for a Server's suspending operations.

MessageLog class 6 members

The server's own message log, newest last.

Prompt class 7 members

The server's command-prompt history.

Shell class 8 members

A shell command run by tmux, and a tmux command chosen by a shell command's exit status.

retryIfSafe function

Retries block up to times more times after a DispatchException whose DispatchException.safeToRetry says the exact same request can be sent again.

Control mode 1 type, 3 functions and constants
ControlClient class 11 members

A tmux client that stays attached and answers one command at a time.

await function

Waits for something to signal this channel.

As await, while preserving process capacity for a call that signals it.

withControl function

As withServer, for a ControlClient attached through server.

Queries 2 functions and constants
filter function

Selects the elements an expression matches.

not function

Inverts an expression, so !Pane_.active().isTrue() says what it means.

Queries — Fields 5 types
TextField class 7 members

Kotlin-idiomatic wrappers over Fields' typed field handles, each holding the Java handle it wraps. A value class, so this costs nothing beyond the Java object it already holds — the same choice io.github.libtmux.kotlin.Server's live handles reject, made here on purpose: a field handle carries exactly one property, which is what makes the boxing tradeoff free.

NumberField class 6 members

Build numeric comparisons for a captured tmux field.

FlagField class 2 members

Match a captured boolean field against true or false.

ToManyField class 3 members

Match an object by the captured children related to it.

ToOneField class 1 member

Match an object by one captured related object.

Constants and enums 1 type
Options class 13 members

Read and update options for the server, session, window, or pane that owns this handle.

By module 8 modules

Esc
Search in

Type to search.

Reference previewOpen reference