Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Python API

Python documentation

libtmux.Server.wait_for

Python

View as Markdown

Module
libtmux
Declared in
Server
Package
libtmux
Source
src/libtmux/server.py
Other languages
Ruby Lua TypeScript RustGo Java .NETC++Swift
wait_for ( self , channel : str , lock : bool | None = None , unlock : bool | None = None , set_flag : bool | None = None ) → None
method [source]
method [source]
wait_for

Wait for, signal, or lock a channel via $ tmux wait-for.

Parameters
  • channel ( str ) – Channel name.

  • lock ( bool | None ) – Lock the channel (-L flag).

  • unlock ( bool | None ) – Unlock the channel (-U flag).

  • set_flag ( bool | None ) – Set the channel flag and wake waiters (-S flag).

Discussed in Capture pane output · Waiting and retrying

In other ports Wait for, signal or lock a channel

Examples

>>> server.new_session(session_name='wait_test')
Session(...)
>>> server.wait_for('test_channel', set_flag=True)
use libtmux::ChannelWait;
use std::time::Duration;
// Signalling first is safe: the channel keeps it.
server.signal_channel("ready").await?;
let outcome = server.wait_for_channel("ready", Duration::from_secs(5)).await?;
assert_eq!(outcome, ChannelWait::Signalled);
// The latch is spent, so a second wait runs out of time instead.
let again = server.wait_for_channel("ready", Duration::from_millis(200)).await?;
assert_eq!(again, ChannelWait::TimedOut);

0 declared, 0 inherited

Esc

Type to search.