On this page
libtmux::Server::wait_for
- Module
- libtmux
- Declared in
- Server
- Package
- libtmux-cxx
- Source
- include/libtmux/server.hpp
- 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.
Discussed in Waiting and retrying
0 declared, 0 inherited