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
nilto 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
nilto start watching. - limit: the most lines to return, keeping the newest.
- Parameters: