libtmux::Server::wait_for
- Module
- libtmux
- Declared in
- Server
- Package
- libtmux-cxx
- Source
- include/libtmux/server.hpp
- Other languages
- PythonRuby Lua TypeScript RustGo Java .NETSwift
- wait_for ( channel : std::string_view , timeout : std::optional< std::chrono::milliseconds > = {} ) expected< void, CommandFailure >
-
Block until someone signals this channel, or the deadline passes.
tmux latches a signal: one sent while nobody is waiting satisfies the next wait rather than being lost. That makes signal-before-wait safe, and it also means a stale signal can release a later waiter, so a channel is worth naming for one exchange rather than reusing.
A server that dies under a waiter makes tmux exit zero, which is indistinguishable from being signalled — a caller would carry on as though the other side had spoken. This reports that as a failure instead, which is the reason to prefer it over running the command.
Omitting
timeoutwaits with no deadline: if the channel is never signalled, this call never returns. Waiting is the whole point of the request, so that is deliberate rather than a gap — pass a timeout to bound it.Discussed in Capture pane output · Capturing output · Waiting and retrying
In other ports Wait for, signal or lock a channel
- Python
libtmux.Server.wait_for - Ruby
LibTmux::Server#wait_for - Lua No source-verified Lua equivalent is recorded for this operation.
- TypeScript no equivalent on
Server - Rust
server.Server.wait_for_channel - Go
tmux.Server.WaitFor - Java no equivalent on
Server - .NET
LibTmux.Server.WaitForAsync - Swift
Server.wait(for:)
- Python
0 declared, 0 inherited