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-kotlin

ControlClient.output

Terminal output tmux pushes, as a cold Flow.

Source and package
Qualified name
io.github.libtmux.kotlin.ControlClient.output
Package
io.github.libtmux.kotlin
Declared in
ControlClient
Distribution
io.github.libtmux:libtmux-kotlin
Source
libtmux-kotlin/src/main/kotlin/io/github/libtmux/kotlin/ControlClient.kt
public fun output( capacity: Int, onSubscribed: Kotlin suspending functionsAllows a function to call suspending operations and pause without blocking a thread. It does not start a coroutine by itself.Language documentation () -> Unit = {} ): Flow<Delivery<PaneOutput>>

Description

A fresh Java subscription opens per kotlinx.coroutines.flow.Flow.collect and closes when collection ends, cancels, or throws — fan-out means collecting twice, each with its own gap accounting. Not suspend: opening the subscription is local and does no tmux round trip: only collecting it reads.

Output tmux sends before the subscription opens is not delivered, and a cold flow opens it only when collection starts. So a command whose output is wanted belongs in onSubscribed, which runs once the subscription exists and before the first read, rather than before collect: control.output(32) { control.send("send-keys", ...) }.

Parameters
  • capacity (Int)

  • onSubscribed (Kotlin suspending functionsAllows a function to call suspending operations and pause without blocking a thread. It does not start a coroutine by itself.Language documentation)

    Default {}

Recorded calls

source calls
No call edges in the Kotlin model.

The Kotlin 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.kotlin.ControlClient.output.

Guides

task material

Pages that discuss output.

Esc
Search in

Type to search.

Reference previewOpen reference