Core Library0.xAPI Reference

Choose documentation 3

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.

Swift API

method libtmux-swift latest

Server.capture(_:since:limit:)

Reads only what a pane has printed since cursor.

Source and package
Qualified name
Server.capture(_:since:limit:)
Declared in
Server
Package
libtmux-swift
Source
Sources/LibTmux/CaptureSince.swift

Description#

Watching a pane by capturing it repeatedly sends the whole screen every time, nearly all of which the caller has already seen — which for an agent is context spent on nothing. This sends the difference.

Pass nil to start: the first read establishes where the pane is without returning its backlog, so a watcher begins at "from now on" rather than with a screenful of history. The source read is capped at 1 MiB; a wider result fails instead of allocating output the line limit would later discard.

  • Parameters:
    • pane: the pane to read.
    • cursor: where the last read stopped, or nil to start watching.
    • limit: the most lines to return, keeping the newest.
Parameters
Raises
Esc

Type to search.

Reference previewOpen reference