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.

method libtmux-ts latest

ConnectedServer.waitFor

Resolve once the server satisfies matches, or reject on timeout.

Source and package
Qualified name
ConnectedServer.waitFor
Module
types
Declared in
ConnectedServer
Package
libtmux
Source
packages/libtmux/src/types.ts

Description#

This is the join between a snapshot and the stream: it subscribes first, then reads, so a change landing between those two steps is still seen. Doing it the other way round — read, then subscribe — waits forever on a condition that already came true. Notifications trigger immediate reads; bounded polling covers state changes tmux does not announce. An unannounced transition must persist until a sample to be observable.

Examples#

await live.waitFor((server) => server.windows.exists({ name: "build" }));
Parameters
Raises
  • WaitTimeoutError – when the deadline passes with the condition unmet.

  • LibTmuxError – when the connection ends first, which says nothing about the condition and so is not the same answer.

Guides#

Pages that discuss waitFor.

Esc

Type to search.

Reference previewOpen reference